feat(UI): Reorganize Settings (#1137)

- Accounts Section & Remove "account" from title.
- Security Section for Biometric that is hidden on TV.
- Move "send logs" to "Action" section.
This commit is contained in:
KingLucius 2024-06-17 04:01:14 +03:00 committed by GitHub
parent 4c061edd7c
commit 30d223cfe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 53 additions and 36 deletions

View File

@ -299,6 +299,9 @@ class SettingsAccount : PreferenceFragmentCompat(), BiometricAuthenticator.Biome
hideKeyboard()
setPreferencesFromResource(R.xml.settings_account, rootKey)
//Hides the security category on TV as it's only Biometric for now
getPref(R.string.pref_category_security_key)?.hideOn(TV or EMULATOR)
getPref(R.string.biometric_key)?.hideOn(TV or EMULATOR)?.setOnPreferenceClickListener {
val ctx = context ?: return@setOnPreferenceClickListener false
@ -328,8 +331,7 @@ class SettingsAccount : PreferenceFragmentCompat(), BiometricAuthenticator.Biome
for ((key, api) in syncApis) {
getPref(key)?.apply {
title =
getString(R.string.login_format).format(api.name, getString(R.string.account))
title = api.name
setOnPreferenceClickListener {
val info = api.loginInfo()
if (info != null) {

View File

@ -441,6 +441,9 @@
<string name="pref_category_android_tv_key" translatable="false" >pref_category_android_tv_key</string>
<string name="pref_category_gestures">Gestures</string>
<string name="pref_category_gestures_key" translatable="false">pref_category_gestures_key</string>
<string name="pref_category_security">Security</string>
<string name="pref_category_security_key" translatable="false">pref_category_security_key</string>
<string name="pref_category_accounts">Accounts</string>
<string name="pref_category_player_features">Player features</string>
<string name="pref_category_subtitles">Subtitles</string>
<string name="pref_category_player_layout">Layout</string>

View File

@ -1,37 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Preference
android:icon="@drawable/mal_logo"
android:key="@string/mal_key" />
<PreferenceCategory
android:title="@string/pref_category_accounts">
<Preference
android:icon="@drawable/ic_anilist_icon"
android:key="@string/anilist_key" />
<Preference
android:icon="@drawable/mal_logo"
android:key="@string/mal_key" />
<Preference
android:icon="@drawable/simkl_logo"
android:key="@string/simkl_key" />
<Preference
android:icon="@drawable/ic_anilist_icon"
android:key="@string/anilist_key" />
<Preference
android:icon="@drawable/open_subtitles_icon"
android:key="@string/opensubtitles_key" />
<Preference
android:icon="@drawable/simkl_logo"
android:key="@string/simkl_key" />
<Preference
android:icon="@drawable/subdl_logo_big"
android:key="@string/subdl_key" />
<Preference
android:icon="@drawable/open_subtitles_icon"
android:key="@string/opensubtitles_key" />
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_outline_account_circle_24"
android:key="@string/skip_startup_account_select_key"
android:title="@string/skip_startup_account_select_pref" />
<Preference
android:icon="@drawable/subdl_logo_big"
android:key="@string/subdl_key" />
<SwitchPreferenceCompat
android:key="@string/biometric_key"
android:defaultValue="false"
android:summary="@string/biometric_setting_summary"
android:icon="@drawable/ic_fingerprint"
android:title="@string/biometric_setting" />
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_outline_account_circle_24"
android:key="@string/skip_startup_account_select_key"
android:title="@string/skip_startup_account_select_pref" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_category_security"
app:key="@string/pref_category_security_key">
<SwitchPreferenceCompat
android:key="@string/biometric_key"
android:defaultValue="false"
android:summary="@string/biometric_setting_summary"
android:icon="@drawable/ic_fingerprint"
android:title="@string/biometric_setting" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_baseline_bug_report_24"
android:key="acra.disable"
android:summaryOff="@string/bug_report_settings_off"
android:summaryOn="@string/bug_report_settings_on"
android:title="@string/pref_disable_acra" />
<PreferenceCategory
android:title="@string/pref_category_app_updates">
@ -80,5 +73,12 @@
android:icon="@drawable/ic_baseline_construction_24"
android:title="@string/redo_setup_process"
app:key="@string/redo_setup_key" />
<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_baseline_bug_report_24"
android:key="acra.disable"
android:summaryOff="@string/bug_report_settings_off"
android:summaryOn="@string/bug_report_settings_on"
android:title="@string/pref_disable_acra" />
</PreferenceCategory>
</PreferenceScreen>