diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
index f5c3ba100..a0b92a60d 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
@@ -746,7 +746,7 @@ public final class VideoDetailFragment
// If we are in fullscreen mode just exit from it via first back press
if (player != null && player.isFullscreen()) {
- if (!DeviceUtils.isTablet(activity, true)) {
+ if (!DeviceUtils.isTablet(activity)) {
player.pause();
}
restoreDefaultOrientation();
diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java
index f995d622e..3886b2f3d 100644
--- a/app/src/main/java/org/schabi/newpipe/player/Player.java
+++ b/app/src/main/java/org/schabi/newpipe/player/Player.java
@@ -3828,6 +3828,13 @@ public final class Player implements
final boolean videoInLandscapeButNotInFullscreen =
service.isLandscape() && !isFullscreen && videoPlayerSelected() && !isAudioOnly;
+ if (prefs.getBoolean(
+ context.getString(R.string.force_auto_fullscreen_key), false)
+ && videoInLandscapeButNotInFullscreen) {
+ toggleFullscreen();
+ return;
+ }
+
final boolean notPaused = currentState != STATE_COMPLETED && currentState != STATE_PAUSED;
if (parent != null
&& videoInLandscapeButNotInFullscreen
diff --git a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java
index 64d3e875c..1afedcaef 100644
--- a/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java
+++ b/app/src/main/java/org/schabi/newpipe/util/DeviceUtils.java
@@ -2,7 +2,6 @@ package org.schabi.newpipe.util;
import android.app.UiModeManager;
import android.content.Context;
-import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.BatteryManager;
@@ -11,10 +10,8 @@ import android.view.KeyEvent;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
-import androidx.preference.PreferenceManager;
import org.schabi.newpipe.App;
-import org.schabi.newpipe.R;
public final class DeviceUtils {
@@ -25,17 +22,6 @@ public final class DeviceUtils {
}
public static boolean isTv(final Context context) {
- return isTv(context, false);
- }
-
- public static boolean isTv(final Context context, final boolean forceCheck) {
- final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
-
- if (!forceCheck && prefs.getBoolean(context
- .getString(R.string.disable_tv_ui_key), false)) {
- return false;
- }
-
if (isTV != null) {
return isTV;
}
@@ -67,17 +53,6 @@ public final class DeviceUtils {
}
public static boolean isTablet(@NonNull final Context context) {
- return isTablet(context, false);
- }
-
- public static boolean isTablet(@NonNull final Context context, final boolean forceCheck) {
- final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
-
- if (!forceCheck && prefs.getBoolean(context
- .getString(R.string.disable_tablet_ui_key), false)) {
- return false;
- }
-
return (context
.getResources()
.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml
index 92a219f27..60a047a56 100644
--- a/app/src/main/res/values-so/strings.xml
+++ b/app/src/main/res/values-so/strings.xml
@@ -700,8 +700,4 @@
Dheeraad ah
Waxkabaddalada yaryar, macmilida, iyo fadhiyo dheeraad ah.
Fadhiga tijaabada ah
- Xidh qaabka tablet-ka
- Ha isticmaalin qaabka tablet-ka loogu talagalay. Tan waxaa loogu talagalay macmilo gaar ah kaliya. Waxaad u baahantahay inaad app-ka dib usoo kiciso si aad isbadalka u aragto.
- Xidh qaabka TV-ga
- Ha isticmaalin qaabka tablet-ka loogu talagalay. Tan waxaa loogu talagalay macmilo gaar ah kaliya. Waxaad u baahantahay inaad app-ka dib usoo kiciso si aad isbadalka u aragto.
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index 58030cb92..f84f8db2d 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -370,8 +370,7 @@
enable_local_player
- disable_tablet_ui
- disable_tv_ui
+ force_auto_fullscreen
disable_error_reports
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 6937d578f..79dff55d0 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -760,10 +760,8 @@
Experimental Settings
Enable Local Player (alpha)
Use a built-in player for local playback. This is still in early development so there will probably be a lot of issues, including conflicts with the existing player.
- Disable Tablet UI
- Ignore tablet layouts. This is intended for specific workarounds. You may need to restart the app to see the effects.
- Disable TV UI
- Ignore TV layouts. This is intended for specific workarounds. You may need to restart the app to see the effects.
+ Force Auto Fullscreen
+ If enabled, when the device is set to landscape, force fullscreen mode even if the device is a tablet or TV.
Disable Error Reporting
Prevent all error reporting screens from appearing. This may result in the app behaving unexpectedly. USE AT YOUR OWN RISK!
diff --git a/app/src/main/res/xml/extra_settings.xml b/app/src/main/res/xml/extra_settings.xml
index cf71da260..4a5188ba0 100644
--- a/app/src/main/res/xml/extra_settings.xml
+++ b/app/src/main/res/xml/extra_settings.xml
@@ -23,16 +23,9 @@
-
-
+ android:key="@string/force_auto_fullscreen_key"
+ android:summary="@string/force_auto_fullscreen_summary"
+ android:title="@string/force_auto_fullscreen_title"/>