Merge pull request #12840 from scola/rotate_on_androidtv_issue

Always do not rotate screen when Android TV
This commit is contained in:
Tobi
2025-11-28 02:22:56 -08:00
committed by GitHub

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;