From 351a59c7afeee53d5a622823b64d968504252841 Mon Sep 17 00:00:00 2001 From: Sajal Raj Gautam Date: Fri, 26 May 2023 18:48:27 +0530 Subject: [PATCH] Enable auto rotate by default for TV Set auto-rotation ON by default for TV --- .../com/github/libretube/ui/activities/MainActivity.kt | 7 ++++++- app/src/main/res/values-television/config.xml | 3 +++ app/src/main/res/values/config.xml | 3 +++ app/src/main/res/xml/general_settings.xml | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/values-television/config.xml create mode 100644 app/src/main/res/values/config.xml diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 357879fbe..5b1e54611 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -54,7 +54,12 @@ class MainActivity : BaseActivity() { lateinit var navController: NavController private var startFragmentId = R.id.homeFragment - val autoRotationEnabled = PreferenceHelper.getBoolean(PreferenceKeys.AUTO_ROTATION, false) + val autoRotationEnabled: Boolean by lazy { + PreferenceHelper.getBoolean( + PreferenceKeys.AUTO_ROTATION, + resources.getBoolean(R.bool.config_default_auto_rotation_pref) + ) + } lateinit var searchView: SearchView private lateinit var searchItem: MenuItem diff --git a/app/src/main/res/values-television/config.xml b/app/src/main/res/values-television/config.xml new file mode 100644 index 000000000..861d394b3 --- /dev/null +++ b/app/src/main/res/values-television/config.xml @@ -0,0 +1,3 @@ + + true + diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml new file mode 100644 index 000000000..5dfa9b145 --- /dev/null +++ b/app/src/main/res/values/config.xml @@ -0,0 +1,3 @@ + + false + diff --git a/app/src/main/res/xml/general_settings.xml b/app/src/main/res/xml/general_settings.xml index e98d056ff..13110bd8a 100644 --- a/app/src/main/res/xml/general_settings.xml +++ b/app/src/main/res/xml/general_settings.xml @@ -31,7 +31,7 @@ app:key="audio_only_mode" />