This commit is contained in:
Victor Shcherb 2015-10-22 01:03:51 +02:00
parent 37aefe99c2
commit 52ce34fae9
4 changed files with 14 additions and 12 deletions

View file

@ -445,10 +445,8 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
} }
audioNotesLayer = new AudioNotesLayer(activity, this); audioNotesLayer = new AudioNotesLayer(activity, this);
activity.getMapView().addLayer(audioNotesLayer, 3.5f); activity.getMapView().addLayer(audioNotesLayer, 3.5f);
if (recordControl == null) {
registerWidget(activity); registerWidget(activity);
} }
}
private void registerMediaListener(AudioManager am) { private void registerMediaListener(AudioManager am) {

View file

@ -296,7 +296,6 @@ public class DownloadActivity extends BaseDownloadActivity {
|| application.getSettings().SHOULD_SHOW_FREE_VERSION_BANNER.get(); || application.getSettings().SHOULD_SHOW_FREE_VERSION_BANNER.get();
initFreeVersionBanner(); initFreeVersionBanner();
updateFreeVersionBanner();
updateBannerInProgress(); updateBannerInProgress();
if (ctx.getCurrentTab() != UPDATES_TAB_NUMBER) { if (ctx.getCurrentTab() != UPDATES_TAB_NUMBER) {
@ -305,13 +304,17 @@ public class DownloadActivity extends BaseDownloadActivity {
} }
public void updateBannerInProgress() { public void updateBannerInProgress() {
updateBannerInProgress(true);
}
public void updateBannerInProgress(boolean showSpace) {
BasicProgressAsyncTask<?, ?, ?, ?> basicProgressAsyncTask = ctx.getDownloadThread().getCurrentRunningTask(); BasicProgressAsyncTask<?, ?, ?, ?> basicProgressAsyncTask = ctx.getDownloadThread().getCurrentRunningTask();
final boolean isFinished = basicProgressAsyncTask == null final boolean isFinished = basicProgressAsyncTask == null
|| basicProgressAsyncTask.getStatus() == AsyncTask.Status.FINISHED; || basicProgressAsyncTask.getStatus() == AsyncTask.Status.FINISHED;
if (isFinished) { if (isFinished) {
downloadProgressLayout.setOnClickListener(null); downloadProgressLayout.setOnClickListener(null);
updateDescriptionTextWithSize(ctx, downloadProgressLayout); updateDescriptionTextWithSize(ctx, downloadProgressLayout);
if (ctx.getCurrentTab() == UPDATES_TAB_NUMBER) { if (ctx.getCurrentTab() == UPDATES_TAB_NUMBER || !showSpace) {
downloadProgressLayout.setVisibility(View.GONE); downloadProgressLayout.setVisibility(View.GONE);
} }
updateFreeVersionBanner(); updateFreeVersionBanner();
@ -373,6 +376,7 @@ public class DownloadActivity extends BaseDownloadActivity {
}); });
laterButton.setOnClickListener(new ToggleCollapseFreeVersionBanner(freeVersionDescriptionTextView, laterButton.setOnClickListener(new ToggleCollapseFreeVersionBanner(freeVersionDescriptionTextView,
buttonsLinearLayout, freeVersionBannerTitle, application.getSettings())); buttonsLinearLayout, freeVersionBannerTitle, application.getSettings()));
updateFreeVersionBanner();
} }
private void updateFreeVersionBanner() { private void updateFreeVersionBanner() {

View file

@ -153,7 +153,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
@Override @Override
public void newDownloadIndexes() { public void newDownloadIndexes() {
if(banner != null) { if(banner != null) {
banner.updateBannerInProgress(); banner.updateBannerInProgress(false);
} }
reloadData(); reloadData();
} }
@ -161,7 +161,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
@Override @Override
public void downloadHasFinished() { public void downloadHasFinished() {
if(banner != null) { if(banner != null) {
banner.updateBannerInProgress(); banner.updateBannerInProgress(false);
} }
listAdapter.notifyDataSetChanged(); listAdapter.notifyDataSetChanged();
} }
@ -169,7 +169,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
@Override @Override
public void downloadInProgress() { public void downloadInProgress() {
if(banner != null) { if(banner != null) {
banner.updateBannerInProgress(); banner.updateBannerInProgress(false);
} }
listAdapter.notifyDataSetChanged(); listAdapter.notifyDataSetChanged();
} }

View file

@ -151,7 +151,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
@Override @Override
public void newDownloadIndexes() { public void newDownloadIndexes() {
if(banner != null) { if(banner != null) {
banner.updateBannerInProgress(); banner.updateBannerInProgress(false);
} }
updateSearchText(searchText); updateSearchText(searchText);
} }
@ -159,7 +159,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
@Override @Override
public void downloadHasFinished() { public void downloadHasFinished() {
if(banner != null) { if(banner != null) {
banner.updateBannerInProgress(); banner.updateBannerInProgress(false);
} }
listAdapter.notifyDataSetChanged(); listAdapter.notifyDataSetChanged();
} }
@ -167,7 +167,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
@Override @Override
public void downloadInProgress() { public void downloadInProgress() {
if(banner != null) { if(banner != null) {
banner.updateBannerInProgress(); banner.updateBannerInProgress(false);
} }
listAdapter.notifyDataSetChanged(); listAdapter.notifyDataSetChanged();
} }