Add play queue button to video details fragment

* 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
This commit is contained in:
HybridAU 2022-09-14 21:00:44 +08:00 committed by GitHub
parent ebce4c5b7e
commit 9db0133a5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 1 deletions

View File

@ -526,6 +526,9 @@ public final class VideoDetailFragment
case R.id.overlay_buttons_layout: case R.id.overlay_buttons_layout:
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
break; break;
case R.id.overlay_play_queue_button:
NavigationHelper.openPlayQueue(getContext());
break;
case R.id.overlay_play_pause_button: case R.id.overlay_play_pause_button:
if (playerIsNotStopped()) { if (playerIsNotStopped()) {
player.playPause(); player.playPause();
@ -684,6 +687,7 @@ public final class VideoDetailFragment
binding.overlayMetadataLayout.setOnClickListener(this); binding.overlayMetadataLayout.setOnClickListener(this);
binding.overlayMetadataLayout.setOnLongClickListener(this); binding.overlayMetadataLayout.setOnLongClickListener(this);
binding.overlayButtonsLayout.setOnClickListener(this); binding.overlayButtonsLayout.setOnClickListener(this);
binding.overlayPlayQueueButton.setOnClickListener(this);
binding.overlayCloseButton.setOnClickListener(this); binding.overlayCloseButton.setOnClickListener(this);
binding.overlayPlayPauseButton.setOnClickListener(this); binding.overlayPlayPauseButton.setOnClickListener(this);
@ -2426,6 +2430,7 @@ public final class VideoDetailFragment
binding.overlayMetadataLayout.setClickable(enable); binding.overlayMetadataLayout.setClickable(enable);
binding.overlayMetadataLayout.setLongClickable(enable); binding.overlayMetadataLayout.setLongClickable(enable);
binding.overlayButtonsLayout.setClickable(enable); binding.overlayButtonsLayout.setClickable(enable);
binding.overlayPlayQueueButton.setClickable(enable);
binding.overlayPlayPauseButton.setClickable(enable); binding.overlayPlayPauseButton.setClickable(enable);
binding.overlayCloseButton.setClickable(enable); binding.overlayCloseButton.setClickable(enable);
} }

View File

@ -212,7 +212,6 @@ public final class PlayQueueActivity extends AppCompatActivity
if (player == null || player.getPlayQueue() == null || player.exoPlayerIsNull()) { if (player == null || player.getPlayQueue() == null || player.exoPlayerIsNull()) {
unbind(); unbind();
finish();
} else { } else {
onQueueUpdate(player.getPlayQueue()); onQueueUpdate(player.getPlayQueue());
buildComponents(); buildComponents();

View File

@ -639,6 +639,11 @@ public final class NavigationHelper {
return intent; return intent;
} }
public static void openPlayQueue(final Context context) {
final Intent intent = new Intent(context, PlayQueueActivity.class);
context.startActivity(intent);
}
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// Link handling // Link handling
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/

View File

@ -698,6 +698,16 @@
android:paddingRight="@dimen/video_item_search_padding" android:paddingRight="@dimen/video_item_search_padding"
tools:ignore="RtlHardcoded"> 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 <ImageButton
android:id="@+id/overlay_play_pause_button" android:id="@+id/overlay_play_pause_button"
android:layout_width="40dp" android:layout_width="40dp"

View File

@ -673,6 +673,16 @@
android:theme="@style/ContrastTintTheme" android:theme="@style/ContrastTintTheme"
tools:ignore="RtlHardcoded"> 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 <ImageButton
android:id="@+id/overlay_play_pause_button" android:id="@+id/overlay_play_pause_button"
android:layout_width="40dp" android:layout_width="40dp"