Skip to content

Commit 753a3e6

Browse files
committed
player.xml: Rename fullscreen buttons
Their names must have come from a very old version of the app, they both toggle the fullscreen mode and rotate the screen depending on circumstances. So `fullscreenButton` -> `fullscreenToggleButtonSecondaryMenu` because it is only visible in the secondary video menu on some configurations. and `screenRotationButton` -> `fullscreenToggleButton` because it is the main fullscreen button next to the video progress bar.
1 parent b2d89a4 commit 753a3e6

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ BasePlayerGestureListener buildGestureListener() {
154154
protected void initListeners() {
155155
super.initListeners();
156156

157-
binding.screenRotationButton.setOnClickListener(makeOnClickListener(() -> {
157+
binding.fullscreenToggleButton.setOnClickListener(makeOnClickListener(() -> {
158158
// Only if it's not a vertical video or vertical video but in landscape with locked
159159
// orientation a screen orientation can be changed automatically
160160
if (!isVerticalVideo || (isLandscape() && globalScreenOrientationLocked(context))) {
@@ -270,7 +270,7 @@ protected void setupElementsVisibility() {
270270

271271
closeItemsList();
272272
showHideKodiButton();
273-
binding.fullScreenButton.setVisibility(View.GONE);
273+
binding.fullscreenToggleButtonSecondaryMenu.setVisibility(View.GONE);
274274
setupScreenRotationButton();
275275
binding.resizeTextView.setVisibility(View.VISIBLE);
276276
binding.getRoot().findViewById(R.id.metadataView).setVisibility(View.VISIBLE);
@@ -885,10 +885,10 @@ public boolean onKeyDown(final int keyCode) {
885885
//region Video size, orientation, fullscreen
886886

887887
private void setupScreenRotationButton() {
888-
binding.screenRotationButton.setVisibility(globalScreenOrientationLocked(context)
888+
binding.fullscreenToggleButton.setVisibility(globalScreenOrientationLocked(context)
889889
|| isVerticalVideo || DeviceUtils.isTablet(context)
890890
? View.VISIBLE : View.GONE);
891-
binding.screenRotationButton.setImageDrawable(AppCompatResources.getDrawable(context,
891+
binding.fullscreenToggleButton.setImageDrawable(AppCompatResources.getDrawable(context,
892892
isFullscreen ? R.drawable.ic_fullscreen_exit
893893
: R.drawable.ic_fullscreen));
894894
}

app/src/main/java/org/schabi/newpipe/player/ui/PopupPlayerUi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ private void initPopupCloseOverlay() {
153153

154154
@Override
155155
protected void setupElementsVisibility() {
156-
binding.fullScreenButton.setVisibility(View.VISIBLE);
157-
binding.screenRotationButton.setVisibility(View.GONE);
156+
binding.fullscreenToggleButtonSecondaryMenu.setVisibility(View.VISIBLE);
157+
binding.fullscreenToggleButton.setVisibility(View.GONE);
158158
binding.resizeTextView.setVisibility(View.GONE);
159159
binding.getRoot().findViewById(R.id.metadataView).setVisibility(View.GONE);
160160
binding.queueButton.setVisibility(View.GONE);

app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected void initListeners() {
234234
ShareUtils.copyToClipboard(context, player.getVideoUrlAtCurrentTime());
235235
return true;
236236
});
237-
binding.fullScreenButton.setOnClickListener(makeOnClickListener(() -> {
237+
binding.fullscreenToggleButtonSecondaryMenu.setOnClickListener(makeOnClickListener(() -> {
238238
player.setRecovery();
239239
NavigationHelper.playOnMainPlayer(context,
240240
Objects.requireNonNull(player.getPlayQueue()), true);
@@ -301,8 +301,8 @@ protected void deinitListeners() {
301301
binding.moreOptionsButton.setOnLongClickListener(null);
302302
binding.share.setOnClickListener(null);
303303
binding.share.setOnLongClickListener(null);
304-
binding.fullScreenButton.setOnClickListener(null);
305-
binding.screenRotationButton.setOnClickListener(null);
304+
binding.fullscreenToggleButtonSecondaryMenu.setOnClickListener(null);
305+
binding.fullscreenToggleButton.setOnClickListener(null);
306306
binding.playWithKodi.setOnClickListener(null);
307307
binding.openInBrowser.setOnClickListener(null);
308308
binding.playerCloseButton.setOnClickListener(null);
@@ -1455,7 +1455,7 @@ protected View.OnClickListener makeOnClickListener(@NonNull final Runnable runna
14551455
if (player.getCurrentState() == STATE_PLAYING && !isSomePopupMenuVisible) {
14561456
if (v == binding.playPauseButton
14571457
// Hide controls in fullscreen immediately
1458-
|| (v == binding.screenRotationButton && isFullscreen())) {
1458+
|| (v == binding.fullscreenToggleButton && isFullscreen())) {
14591459
hideControls(0, 0);
14601460
} else {
14611461
hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME);

app/src/main/res/layout/player.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
tools:ignore="RtlHardcoded" />
364364

365365
<androidx.appcompat.widget.AppCompatImageButton
366-
android:id="@+id/fullScreenButton"
366+
android:id="@+id/fullscreenToggleButtonSecondaryMenu"
367367
android:layout_width="40dp"
368368
android:layout_height="40dp"
369369
android:background="?attr/selectableItemBackgroundBorderless"
@@ -457,7 +457,7 @@
457457
android:layout_gravity="center"
458458
android:layout_marginTop="2dp"
459459
android:layout_weight="1"
460-
android:nextFocusDown="@id/screenRotationButton"
460+
android:nextFocusDown="@id/fullscreenToggleButton"
461461
tools:progress="25"
462462
tools:secondaryProgress="50" />
463463

@@ -486,7 +486,7 @@
486486
tools:ignore="HardcodedText,RtlHardcoded,RtlSymmetry" />
487487

488488
<androidx.appcompat.widget.AppCompatImageButton
489-
android:id="@+id/screenRotationButton"
489+
android:id="@+id/fullscreenToggleButton"
490490
android:layout_width="40dp"
491491
android:layout_height="40dp"
492492
android:layout_marginStart="4dp"

0 commit comments

Comments
 (0)