1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-01-21 02:19:50 +00:00

Always do not rotate screen when Android TV

This commit is contained in:
shaozheng
2025-11-28 10:42:04 +08:00
parent 18f1cf2075
commit e045251b58

View File

@@ -1900,12 +1900,13 @@ public final class VideoDetailFragment
@Override
public void onScreenRotationButtonClicked() {
// On Android TV screen rotation is not supported
// In tablet user experience will be better if screen will not be rotated
// from landscape to portrait every time.
// Just turn on fullscreen mode in landscape orientation
// or portrait & unlocked global orientation
final boolean isLandscape = DeviceUtils.isLandscape(requireContext());
if (DeviceUtils.isTablet(activity)
if (DeviceUtils.isTv(activity) || DeviceUtils.isTablet(activity)
&& (!globalScreenOrientationLocked(activity) || isLandscape)) {
player.UIs().get(MainPlayerUi.class).ifPresent(MainPlayerUi::toggleFullscreen);
return;