1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-10-22 02:47:38 +00:00

[player] Prevent long audio track label from pushing controls off-screen

- audioTrackTextView: layout_width=0dp + layout_weight=1
- Make it singleLine with ellipsize="end"
- When not fullscreen, hide metadataView so an empty weighted container doesn’t reserve space
- Result: controls stay visible on small screens; longer labels can use space on larger screens
This commit is contained in:
jianing liu
2025-10-12 02:03:38 +08:00
parent 2dd4509b75
commit fbc664d0da
2 changed files with 6 additions and 1 deletions

View File

@@ -289,6 +289,7 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
binding.topControls.setClickable(true);
binding.topControls.setFocusable(true);
binding.metadataView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
binding.titleTextView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
binding.channelTextView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
}
@@ -934,6 +935,7 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
}
fragmentListener.onFullscreenStateChanged(isFullscreen);
binding.metadataView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
binding.titleTextView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
binding.channelTextView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
binding.playerCloseButton.setVisibility(isFullscreen ? View.GONE : View.VISIBLE);

View File

@@ -160,12 +160,15 @@
<org.schabi.newpipe.views.NewPipeTextView
android:id="@+id/audioTrackTextView"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:minWidth="0dp"
android:singleLine="true"
android:ellipsize="end"
android:padding="@dimen/player_main_buttons_padding"
android:textColor="@android:color/white"
android:textStyle="bold"