[Android] Video Playlist : add next and previous button
Alexandre Perraud
git at videolan.org
Tue Apr 12 14:00:27 CEST 2016
vlc-android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Tue Apr 12 11:11:54 2016 +0200| [b88a27aded068de32c5762a90cf6bafc1bd06d19] | committer: Alexandre Perraud
Video Playlist : add next and previous button
> https://code.videolan.org/videolan/vlc-android/commit/b88a27aded068de32c5762a90cf6bafc1bd06d19
---
vlc-android/res/layout/player_hud.xml | 24 ++++++++++++++++++++++
.../vlc/gui/video/VideoPlayerActivity.java | 12 +++++++++++
2 files changed, 36 insertions(+)
diff --git a/vlc-android/res/layout/player_hud.xml b/vlc-android/res/layout/player_hud.xml
index a86a8e8..0037f48 100644
--- a/vlc-android/res/layout/player_hud.xml
+++ b/vlc-android/res/layout/player_hud.xml
@@ -84,6 +84,18 @@
android:focusable="true"/>
<ImageView
+ android:id="@+id/playlist_previous"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:focusable="true"
+ android:longClickable="true"
+ android:scaleType="center"
+ android:src="@drawable/ic_playlist_previous_circle"
+ android:visibility="gone" />
+
+ <ImageView
android:id="@+id/player_overlay_rewind"
android:layout_width="0dp"
android:layout_height="match_parent"
@@ -118,6 +130,18 @@
android:visibility="gone" />
<ImageView
+ android:id="@+id/playlist_next"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:longClickable="true"
+ android:src="@drawable/ic_playlist_next_circle"
+ android:scaleType="center"
+ android:focusable="true"
+ android:visibility="gone" />
+
+ <ImageView
android:id="@+id/player_overlay_adv_function"
android:layout_width="0dp"
android:layout_height="match_parent"
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 d202130..7a56874 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -379,6 +379,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
mPlaylistToggle = (ImageView) findViewById(R.id.playlist_toggle);
+ mPlaylistPrevious = (ImageView) findViewById(R.id.playlist_previous);
+ mPlaylistNext = (ImageView) findViewById(R.id.playlist_next);
mPlaylist = (RecyclerView) findViewById(R.id.video_playlist);
mOverlayProgress = findViewById(R.id.progress_overlay);
@@ -751,7 +753,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mPlaylist.setLayoutManager(layoutManager);
mPlaylistToggle.setVisibility(View.VISIBLE);
+ mPlaylistPrevious.setVisibility(View.VISIBLE);
+ mPlaylistNext.setVisibility(View.VISIBLE);
mPlaylistToggle.setOnClickListener(VideoPlayerActivity.this);
+ mPlaylistPrevious.setOnClickListener(VideoPlayerActivity.this);
+ mPlaylistNext.setOnClickListener(VideoPlayerActivity.this);
mSeekbar.setNextFocusUpId(mPlaylistToggle.getId());
ItemTouchHelper.Callback callback = new SwipeDragItemTouchHelperCallback(mPlaylistAdapter);
@@ -2174,6 +2180,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
case R.id.playlist_toggle:
togglePlaylist();
break;
+ case R.id.playlist_next:
+ mService.next();
+ break;
+ case R.id.playlist_previous:
+ mService.previous();
+ break;
case R.id.player_overlay_forward:
seekDelta(10000);
break;
More information about the Android
mailing list