Skip to content

Commit e045251

Browse files
committed
Always do not rotate screen when Android TV
1 parent 18f1cf2 commit e045251

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,12 +1900,13 @@ public void onFullscreenStateChanged(final boolean fullscreen) {
19001900

19011901
@Override
19021902
public void onScreenRotationButtonClicked() {
1903+
// On Android TV screen rotation is not supported
19031904
// In tablet user experience will be better if screen will not be rotated
19041905
// from landscape to portrait every time.
19051906
// Just turn on fullscreen mode in landscape orientation
19061907
// or portrait & unlocked global orientation
19071908
final boolean isLandscape = DeviceUtils.isLandscape(requireContext());
1908-
if (DeviceUtils.isTablet(activity)
1909+
if (DeviceUtils.isTv(activity) || DeviceUtils.isTablet(activity)
19091910
&& (!globalScreenOrientationLocked(activity) || isLandscape)) {
19101911
player.UIs().get(MainPlayerUi.class).ifPresent(MainPlayerUi::toggleFullscreen);
19111912
return;

0 commit comments

Comments
 (0)