Skip to content

Commit

Permalink
Add play queue button to video details fragment
Browse files Browse the repository at this point in the history
* Add play queue button to video details fragment

* Use existing ic_list icon

* Still open play queue even when queue is empty

* Change app:srcCompat to android:src
  • Loading branch information
HybridAU committed Sep 14, 2022
1 parent ebce4c5 commit 9db0133
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,9 @@ public void onClick(final View v) {
case R.id.overlay_buttons_layout:
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
break;
case R.id.overlay_play_queue_button:
NavigationHelper.openPlayQueue(getContext());
break;
case R.id.overlay_play_pause_button:
if (playerIsNotStopped()) {
player.playPause();
Expand Down Expand Up @@ -684,6 +687,7 @@ protected void initListeners() {
binding.overlayMetadataLayout.setOnClickListener(this);
binding.overlayMetadataLayout.setOnLongClickListener(this);
binding.overlayButtonsLayout.setOnClickListener(this);
binding.overlayPlayQueueButton.setOnClickListener(this);
binding.overlayCloseButton.setOnClickListener(this);
binding.overlayPlayPauseButton.setOnClickListener(this);

Expand Down Expand Up @@ -2426,6 +2430,7 @@ private void setOverlayElementsClickable(final boolean enable) {
binding.overlayMetadataLayout.setClickable(enable);
binding.overlayMetadataLayout.setLongClickable(enable);
binding.overlayButtonsLayout.setClickable(enable);
binding.overlayPlayQueueButton.setClickable(enable);
binding.overlayPlayPauseButton.setClickable(enable);
binding.overlayCloseButton.setClickable(enable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ public void onServiceConnected(final ComponentName name, final IBinder service)

if (player == null || player.getPlayQueue() == null || player.exoPlayerIsNull()) {
unbind();
finish();
} else {
onQueueUpdate(player.getPlayQueue());
buildComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,11 @@ public static Intent getPlayQueueActivityIntent(final Context context) {
return intent;
}

public static void openPlayQueue(final Context context) {
final Intent intent = new Intent(context, PlayQueueActivity.class);
context.startActivity(intent);
}

/*//////////////////////////////////////////////////////////////////////////
// Link handling
//////////////////////////////////////////////////////////////////////////*/
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout-large-land/fragment_video_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,16 @@
android:paddingRight="@dimen/video_item_search_padding"
tools:ignore="RtlHardcoded">

<ImageButton
android:id="@+id/overlay_play_queue_button"
android:layout_width="40dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:padding="10dp"
android:scaleType="center"
android:src="@drawable/ic_list"
tools:ignore="ContentDescription,RtlHardcoded" />

<ImageButton
android:id="@+id/overlay_play_pause_button"
android:layout_width="40dp"
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/fragment_video_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,16 @@
android:theme="@style/ContrastTintTheme"
tools:ignore="RtlHardcoded">

<ImageButton
android:id="@+id/overlay_play_queue_button"
android:layout_width="40dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:padding="10dp"
android:scaleType="center"
android:src="@drawable/ic_list"
tools:ignore="ContentDescription,RtlHardcoded" />

<ImageButton
android:id="@+id/overlay_play_pause_button"
android:layout_width="40dp"
Expand Down

0 comments on commit 9db0133

Please sign in to comment.