[Android] Ensure scanning progress bar is well hidden

Geoffrey Métais git at videolan.org
Wed Mar 14 14:07:14 CET 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 14 14:06:51 2018 +0100| [db7f4810050d4035649b8e67ac0cf5f73f7c3f3c] | committer: Geoffrey Métais

Ensure scanning progress bar is well hidden

> https://code.videolan.org/videolan/vlc-android/commit/db7f4810050d4035649b8e67ac0cf5f73f7c3f3c
---

 .../videolan/vlc/gui/AudioPlayerContainerActivity.java   | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
index 79402a8dd..e6d75caf2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
@@ -313,13 +313,12 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
 
     private void updateProgressVisibility(int visibility) {
         boolean show = visibility == View.VISIBLE;
-        if ((mScanProgressLayout == null && !show) ||
-                (mScanProgressLayout != null && mScanProgressLayout.getVisibility() == visibility))
-            return;
-        if (show)
-            mActivityHandler.sendEmptyMessageDelayed(ACTION_DISPLAY_PROGRESSBAR, 1000);
-        else if (mScanProgressLayout != null)
-            mScanProgressLayout.setVisibility(visibility);
+        if (mScanProgressLayout != null && mScanProgressLayout.getVisibility() == visibility) return;
+        if (show) mActivityHandler.sendEmptyMessageDelayed(ACTION_DISPLAY_PROGRESSBAR, 1000);
+        else {
+            mActivityHandler.removeMessages(ACTION_DISPLAY_PROGRESSBAR);
+            UiTools.setViewVisibility(mScanProgressLayout, visibility);
+        }
     }
 
     private void showProgressBar() {
@@ -333,8 +332,7 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
                 updateContainerPadding(true);
                 applyMarginToProgressBar(mBottomSheetBehavior.getPeekHeight());
             }
-        } else if (mScanProgressLayout != null)
-            mScanProgressLayout.setVisibility(View.VISIBLE);
+        } else if (mScanProgressLayout != null) mScanProgressLayout.setVisibility(View.VISIBLE);
     }
 
     private void updateContainerPadding(boolean show) {



More information about the Android mailing list