[Android] Manage playlist UI init if HUD is not yet inflated
Geoffrey Métais
git at videolan.org
Thu Jan 12 17:15:46 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 12 17:14:49 2017 +0100| [80ae06581211c5a02f34c5beb9d6690c090afca9] | committer: Geoffrey Métais
Manage playlist UI init if HUD is not yet inflated
> https://code.videolan.org/videolan/vlc-android/commit/80ae06581211c5a02f34c5beb9d6690c090afca9
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 9271f49..fb1532a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -782,8 +782,14 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
initVideoParams();
+ initPlaylistUi();
+ }
+
+ private void initPlaylistUi() {
if (mService.hasPlaylist()) {
mPlaylistPrevious = (ImageView) findViewById(R.id.playlist_previous);
+ if (mPlaylistPrevious == null)
+ return; //player HUD not yet inflated
mPlaylistNext = (ImageView) findViewById(R.id.playlist_next);
mPlaylistAdapter = new PlaylistAdapter(this);
mPlaylistAdapter.setService(mService);
@@ -806,7 +812,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mPlaylistNext.setImageResource(R.drawable.ic_playlist_previous_circle);
}
}
-
}
private void initUI() {
@@ -2751,6 +2756,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
updatePausable(mService.isPausable());
updateNavStatus();
setHudClickListeners();
+ initPlaylistUi();
}
}
More information about the Android
mailing list