From 52ce34fae9b92d76526b03e40e61ab3829685990 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 22 Oct 2015 01:03:51 +0200 Subject: [PATCH] Fix issue #1780 --- .../osmand/plus/audionotes/AudioVideoNotesPlugin.java | 4 +--- .../src/net/osmand/plus/download/DownloadActivity.java | 10 +++++++--- .../download/ui/DownloadResourceGroupFragment.java | 6 +++--- .../osmand/plus/download/ui/SearchDialogFragment.java | 6 +++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 99391f32b1..6fd3d11bcd 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -445,9 +445,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { } audioNotesLayer = new AudioNotesLayer(activity, this); activity.getMapView().addLayer(audioNotesLayer, 3.5f); - if (recordControl == null) { - registerWidget(activity); - } + registerWidget(activity); } private void registerMediaListener(AudioManager am) { diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 27d5c9796d..f678193a90 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -296,22 +296,25 @@ public class DownloadActivity extends BaseDownloadActivity { || application.getSettings().SHOULD_SHOW_FREE_VERSION_BANNER.get(); initFreeVersionBanner(); - updateFreeVersionBanner(); updateBannerInProgress(); if (ctx.getCurrentTab() != UPDATES_TAB_NUMBER) { downloadProgressLayout.setVisibility(View.VISIBLE); } } - + public void updateBannerInProgress() { + updateBannerInProgress(true); + } + + public void updateBannerInProgress(boolean showSpace) { BasicProgressAsyncTask basicProgressAsyncTask = ctx.getDownloadThread().getCurrentRunningTask(); final boolean isFinished = basicProgressAsyncTask == null || basicProgressAsyncTask.getStatus() == AsyncTask.Status.FINISHED; if (isFinished) { downloadProgressLayout.setOnClickListener(null); updateDescriptionTextWithSize(ctx, downloadProgressLayout); - if (ctx.getCurrentTab() == UPDATES_TAB_NUMBER) { + if (ctx.getCurrentTab() == UPDATES_TAB_NUMBER || !showSpace) { downloadProgressLayout.setVisibility(View.GONE); } updateFreeVersionBanner(); @@ -373,6 +376,7 @@ public class DownloadActivity extends BaseDownloadActivity { }); laterButton.setOnClickListener(new ToggleCollapseFreeVersionBanner(freeVersionDescriptionTextView, buttonsLinearLayout, freeVersionBannerTitle, application.getSettings())); + updateFreeVersionBanner(); } private void updateFreeVersionBanner() { diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java index ab1c55074e..5b2cc0ca42 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java @@ -153,7 +153,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow @Override public void newDownloadIndexes() { if(banner != null) { - banner.updateBannerInProgress(); + banner.updateBannerInProgress(false); } reloadData(); } @@ -161,7 +161,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow @Override public void downloadHasFinished() { if(banner != null) { - banner.updateBannerInProgress(); + banner.updateBannerInProgress(false); } listAdapter.notifyDataSetChanged(); } @@ -169,7 +169,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow @Override public void downloadInProgress() { if(banner != null) { - banner.updateBannerInProgress(); + banner.updateBannerInProgress(false); } listAdapter.notifyDataSetChanged(); } diff --git a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java index 1ac724d768..8aea646a1e 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java @@ -151,7 +151,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven @Override public void newDownloadIndexes() { if(banner != null) { - banner.updateBannerInProgress(); + banner.updateBannerInProgress(false); } updateSearchText(searchText); } @@ -159,7 +159,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven @Override public void downloadHasFinished() { if(banner != null) { - banner.updateBannerInProgress(); + banner.updateBannerInProgress(false); } listAdapter.notifyDataSetChanged(); } @@ -167,7 +167,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven @Override public void downloadInProgress() { if(banner != null) { - banner.updateBannerInProgress(); + banner.updateBannerInProgress(false); } listAdapter.notifyDataSetChanged(); }