[Android] Fix audioplayer opening
Geoffrey Métais
git at videolan.org
Tue Apr 5 13:03:40 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Apr 5 13:02:59 2016 +0200| [f569fbeacaaa810e607a0db7de465f846c29fbf0] | committer: Geoffrey Métais
Fix audioplayer opening
> https://code.videolan.org/videolan/vlc-android/commit/f569fbeacaaa810e607a0db7de465f846c29fbf0
---
.../vlc/gui/AudioPlayerContainerActivity.java | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
index 86bdc1e..726c4c4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
@@ -224,11 +224,16 @@ public class AudioPlayerContainerActivity extends AppCompatActivity implements P
* Show the audio player.
*/
public void showAudioPlayer() {
- mActionBar.collapseActionView();
- // Open the pane only if is entirely opened.
- if (mSlidingPane.getState() == mSlidingPane.STATE_OPENED_ENTIRELY)
- mSlidingPane.openPane();
- mAudioPlayerFilling.setVisibility(View.VISIBLE);
+ mActivityHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ mActionBar.collapseActionView();
+ // Open the pane only if is entirely opened.
+ if (mSlidingPane.getState() == mSlidingPane.STATE_OPENED_ENTIRELY)
+ mSlidingPane.openPane();
+ mAudioPlayerFilling.setVisibility(View.VISIBLE);
+ }
+ });
}
public int getSlidingPaneState() {
@@ -337,14 +342,14 @@ public class AudioPlayerContainerActivity extends AppCompatActivity implements P
String action = intent.getAction();
if (action.equalsIgnoreCase(Intent.ACTION_MEDIA_MOUNTED)) {
- mStorageHandlerHandler.sendEmptyMessage(ACTION_MEDIA_MOUNTED);
+ mActivityHandler.sendEmptyMessage(ACTION_MEDIA_MOUNTED);
} else if (action.equalsIgnoreCase(Intent.ACTION_MEDIA_UNMOUNTED)) {
- mStorageHandlerHandler.sendEmptyMessageDelayed(ACTION_MEDIA_UNMOUNTED, 100);
+ mActivityHandler.sendEmptyMessageDelayed(ACTION_MEDIA_UNMOUNTED, 100);
}
}
};
- Handler mStorageHandlerHandler = new StorageHandler(this);
+ Handler mActivityHandler = new StorageHandler(this);
private static final int ACTION_MEDIA_MOUNTED = 1337;
private static final int ACTION_MEDIA_UNMOUNTED = 1338;
More information about the Android
mailing list