1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Merge pull request #8946 from HybridAU/add_play_queue_button_to_video_details_fragment

Add play queue button to video details fragment
This commit is contained in:
Tobi 2022-10-06 18:55:50 +02:00 committed by GitHub
commit 8bc8355b68
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"