From 1014dd563f2a2369c80a4326ff852ae6c187dcc1 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Fri, 17 Oct 2025 19:08:49 +0200
Subject: [PATCH 1/5] Correctly format player.xml
Otherwise it constantly switches the attributes which makes (re) viewing changes next to impossible
---
app/src/main/res/layout/player.xml | 34 +++++++++++++++---------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/app/src/main/res/layout/player.xml b/app/src/main/res/layout/player.xml
index 4e5cd8533..9c70732f2 100644
--- a/app/src/main/res/layout/player.xml
+++ b/app/src/main/res/layout/player.xml
@@ -109,13 +109,13 @@
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
+ android:contentDescription="@string/close"
android:focusable="true"
android:padding="@dimen/player_main_buttons_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_close"
android:visibility="gone"
app:tint="@color/white"
- android:contentDescription="@string/close"
tools:ignore="RtlHardcoded" />
+ tools:text="English (Original)"
+ tools:visibility="visible" />
@@ -371,11 +371,11 @@
android:layout_height="40dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
+ android:contentDescription="@string/toggle_fullscreen"
android:focusable="true"
android:padding="@dimen/player_main_buttons_padding"
android:scaleType="fitCenter"
android:src="@drawable/ic_fullscreen"
- android:contentDescription="@string/toggle_fullscreen"
android:visibility="gone"
app:tint="@color/white"
tools:ignore="RtlHardcoded"
@@ -495,13 +495,13 @@
android:layout_marginStart="4dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
+ android:contentDescription="@string/toggle_screen_orientation"
android:focusable="true"
android:nextFocusUp="@id/playbackSeekBar"
android:padding="@dimen/player_main_buttons_padding"
android:scaleType="fitCenter"
android:src="@drawable/ic_fullscreen"
android:visibility="gone"
- android:contentDescription="@string/toggle_screen_orientation"
app:tint="@color/white"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
@@ -523,10 +523,10 @@
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
+ android:contentDescription="@string/previous_stream"
android:focusable="true"
android:scaleType="fitCenter"
android:src="@drawable/ic_previous"
- android:contentDescription="@string/previous_stream"
app:tint="@color/white" />
@@ -536,9 +536,9 @@
android:layout_height="60dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
+ android:contentDescription="@string/pause"
android:scaleType="fitCenter"
android:src="@drawable/ic_pause"
- android:contentDescription="@string/pause"
app:tint="@color/white" />
@@ -599,12 +599,12 @@
android:layout_marginLeft="40dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
+ android:contentDescription="@string/notification_action_repeat"
android:focusable="true"
android:padding="10dp"
android:scaleType="fitXY"
android:src="@drawable/exo_controls_repeat_off"
android:tint="?attr/colorAccent"
- android:contentDescription="@string/notification_action_repeat"
tools:ignore="RtlHardcoded" />
Date: Fri, 17 Oct 2025 19:10:10 +0200
Subject: [PATCH 2/5] Correctly name the preview
---
app/src/main/res/layout/player.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/res/layout/player.xml b/app/src/main/res/layout/player.xml
index 9c70732f2..321d07d3c 100644
--- a/app/src/main/res/layout/player.xml
+++ b/app/src/main/res/layout/player.xml
@@ -174,7 +174,7 @@
android:textStyle="bold"
android:visibility="gone"
tools:ignore="HardcodedText,RtlHardcoded"
- tools:text="English (Original)"
+ tools:text="English (United States) original"
tools:visibility="visible" />
Date: Fri, 17 Oct 2025 19:28:52 +0200
Subject: [PATCH 3/5] Improve the alignment of `titleTextView` and
`audioTrackTextView`
This fulfills the following:
* both should never push content outside of the view
* there should be no wasted space
* `audioTrackTextView` is always aligned to the right
* both should grow equally but also respect their respective contents size first
Caveats:
* Currently the layout weight is distributed using "NestedWeights" which require a widget to be measured twice. According to Android Studio this might cause an exponential performane impact, however there is currently just a single nested component so the effect should be not noticeable
---
app/src/main/res/layout/player.xml | 117 ++++++++++++++++-------------
1 file changed, 66 insertions(+), 51 deletions(-)
diff --git a/app/src/main/res/layout/player.xml b/app/src/main/res/layout/player.xml
index 321d07d3c..4e69bd9fa 100644
--- a/app/src/main/res/layout/player.xml
+++ b/app/src/main/res/layout/player.xml
@@ -119,64 +119,79 @@
tools:ignore="RtlHardcoded" />
+ android:orientation="horizontal">
-
+ android:layout_marginTop="6dp"
+ android:layout_marginEnd="8dp"
+ android:layout_weight="1"
+ android:gravity="top"
+ android:orientation="vertical"
+ tools:ignore="NestedWeights,RtlHardcoded">
+
+
+
+
+
+
+
+
+
+
+
-
-
-
Date: Fri, 17 Oct 2025 20:15:24 +0200
Subject: [PATCH 4/5] Remove not needed viability control
This is done by the parent
---
.../main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java | 4 ----
1 file changed, 4 deletions(-)
diff --git a/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java b/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java
index b79ef9235..9d2126826 100644
--- a/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java
+++ b/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java
@@ -290,8 +290,6 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
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);
}
@Override
@@ -936,8 +934,6 @@ 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);
setupScreenRotationButton();
}
From 41981902ab0107b2c8c98334b6b800103ac53c9c Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Fri, 17 Oct 2025 20:33:08 +0200
Subject: [PATCH 5/5] Limit height of wrapper
---
app/src/main/res/layout/player.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/res/layout/player.xml b/app/src/main/res/layout/player.xml
index 4e69bd9fa..a6a0884c7 100644
--- a/app/src/main/res/layout/player.xml
+++ b/app/src/main/res/layout/player.xml
@@ -167,7 +167,7 @@