Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add play queue button to video details fragment #8946

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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