Merge pull request #3838 from SajalRG/force-landscap-on-tv

Enable auto rotate by default in TV
This commit is contained in:
Bnyro 2023-05-27 08:17:45 +02:00 committed by GitHub
commit 4b7c3965d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1,3 @@
<resources>
<bool name="config_default_auto_rotation_pref">true</bool>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<bool name="config_default_auto_rotation_pref">false</bool>
</resources>

View File

@ -31,7 +31,7 @@
app:key="audio_only_mode" />
<SwitchPreferenceCompat
android:defaultValue="false"
android:defaultValue="@bool/config_default_auto_rotation_pref"
android:icon="@drawable/ic_screen_rotation"
app:key="auto_rotation"
app:title="@string/auto_rotation" />