Merge pull request #417 from Bnyro/master

material dialogs in settings
This commit is contained in:
Bnyro 2022-06-07 13:42:41 +02:00 committed by GitHub
commit 0590bf1025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 23 deletions

View File

@ -18,6 +18,8 @@ class SettingsActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
DynamicColors.applyToActivityIfAvailable(this)
ThemeHelper().updateTheme(this)
// makes the preference dialogs use material dialogs
setTheme(R.style.MaterialAlertDialog)
super.onCreate(savedInstanceState)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {

View File

@ -15,4 +15,12 @@
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
<style name="MaterialAlertDialog">
<item name="alertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
<item name="dialogCornerRadius">28dp</item>
</style>
</resources>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.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">
<PreferenceCategory app:title="@string/appearance">
<androidx.preference.ListPreference
<ListPreference
app:title="@string/app_theme"
app:key="theme_togglee"
app:entries="@array/themes"
@ -12,7 +12,7 @@
app:defaultValue="A"
android:icon="@drawable/ic_theme" />
<androidx.preference.ListPreference
<ListPreference
app:title="@string/color_accent"
app:key="accent_color"
app:entries="@array/accents"
@ -20,7 +20,7 @@
app:defaultValue="red"
android:icon="@drawable/ic_color" />
<androidx.preference.ListPreference
<ListPreference
app:title="@string/app_icon"
app:key="icon_change"
app:entries="@array/icons"
@ -32,7 +32,7 @@
<PreferenceCategory app:title="@string/app_behavior">
<androidx.preference.ListPreference
<ListPreference
app:title="@string/defaultTab"
app:key="default_tab"
app:entries="@array/tabs"
@ -40,7 +40,7 @@
app:defaultValue="home"
android:icon="@drawable/ic_home_outlined" />
<androidx.preference.ListPreference
<ListPreference
app:title="@string/defres"
app:key="default_res"
app:entries="@array/defres"
@ -49,7 +49,7 @@
android:icon="@drawable/ic_hd"
app:useSimpleSummaryProvider="true" />
<androidx.preference.ListPreference
<ListPreference
app:title="@string/grid"
app:key="grid"
app:entries="@array/grid"
@ -60,4 +60,4 @@
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
</PreferenceScreen>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/downloads">
@ -22,4 +22,4 @@
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
</PreferenceScreen>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.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">
<PreferenceCategory app:title="@string/search_history">
@ -17,4 +17,4 @@
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
</PreferenceScreen>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.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">
<PreferenceCategory app:title="@string/location">
@ -35,18 +35,18 @@
app:defaultValue="https://pipedapi.kavin.rocks/"
android:icon="@drawable/ic_server" />
<androidx.preference.EditTextPreference
<EditTextPreference
app:key="customInstance"
app:title="@string/customInstance"
app:isPreferenceVisible="false" />
<androidx.preference.Preference
<Preference
app:key="login_register"
app:title="@string/login_register"
android:icon="@drawable/ic_login"
android:summary="@string/notgmail" />
<androidx.preference.Preference
<Preference
app:key="import_from_yt"
app:title="@string/import_from_yt"
android:summary="@string/import_from_yt_summary"
@ -56,23 +56,23 @@
<PreferenceCategory app:title="@string/customization">
<androidx.preference.Preference
<Preference
app:key="appearance"
app:title="@string/appearance"
android:icon="@drawable/ic_color" />
<androidx.preference.Preference
<Preference
app:title="@string/sponsorblock"
app:key="sponsorblock"
app:summary="@string/sponsorblock_summary"
android:icon="@drawable/ic_block" />
<androidx.preference.Preference
<Preference
app:title="@string/downloads"
app:key="downloads"
android:icon="@drawable/ic_file_download" />
<androidx.preference.Preference
<Preference
app:key="history"
app:title="@string/history"
android:icon="@drawable/ic_history" />
@ -93,4 +93,4 @@
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
</PreferenceScreen>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.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">
<SwitchPreferenceCompat
@ -43,4 +43,4 @@
</PreferenceCategory>
</androidx.preference.PreferenceScreen>
</PreferenceScreen>