[app] Use androidx PreferenceCategory (#1291)
This commit is contained in:
parent
12ec6d85cb
commit
47e5bb21c4
|
|
@ -170,13 +170,13 @@ dependencies {
|
||||||
implementation("androidx.fragment:fragment:1.3.6")
|
implementation("androidx.fragment:fragment:1.3.6")
|
||||||
implementation("androidx.navigation:navigation-fragment:$navVersion")
|
implementation("androidx.navigation:navigation-fragment:$navVersion")
|
||||||
implementation("androidx.navigation:navigation-ui:$navVersion")
|
implementation("androidx.navigation:navigation-ui:$navVersion")
|
||||||
|
implementation("androidx.preference:preference:1.1.1")
|
||||||
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
||||||
implementation("androidx.slidingpanelayout:slidingpanelayout:1.2.0-beta01")
|
implementation("androidx.slidingpanelayout:slidingpanelayout:1.2.0-beta01")
|
||||||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
||||||
implementation("com.github.bumptech.glide:glide:$glideVersion")
|
implementation("com.github.bumptech.glide:glide:$glideVersion")
|
||||||
implementation("com.google.android.material:material:1.5.0-alpha04")
|
implementation("com.google.android.material:material:1.5.0-alpha04")
|
||||||
implementation("com.google.code.gson:gson:2.8.8")
|
implementation("com.google.code.gson:gson:2.8.8")
|
||||||
implementation("com.takisoft.preferencex:preferencex:1.1.0")
|
|
||||||
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.2"))
|
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.2"))
|
||||||
implementation("com.squareup.okhttp3:okhttp")
|
implementation("com.squareup.okhttp3:okhttp")
|
||||||
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps")
|
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps")
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,12 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.text.HtmlCompat;
|
import androidx.core.text.HtmlCompat;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
import androidx.preference.SwitchPreference;
|
import androidx.preference.SwitchPreference;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.google.android.material.color.DynamicColors;
|
import com.google.android.material.color.DynamicColors;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.takisoft.preferencex.PreferenceFragmentCompat;
|
|
||||||
|
|
||||||
import org.lsposed.manager.App;
|
import org.lsposed.manager.App;
|
||||||
import org.lsposed.manager.BuildConfig;
|
import org.lsposed.manager.BuildConfig;
|
||||||
|
|
@ -138,7 +138,7 @@ public class SettingsFragment extends BaseFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferencesFix(Bundle savedInstanceState, String rootKey) {
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
final String SYSTEM = "SYSTEM";
|
final String SYSTEM = "SYSTEM";
|
||||||
|
|
||||||
addPreferencesFromResource(R.xml.prefs);
|
addPreferencesFromResource(R.xml.prefs);
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
<string name="never_show">Never show</string>
|
<string name="never_show">Never show</string>
|
||||||
<string name="failed_to_create_shortcut">Failed to create shortcut: %1$s</string>
|
<string name="failed_to_create_shortcut">Failed to create shortcut: %1$s</string>
|
||||||
<string name="update_lsposed">Update LSPosed</string>
|
<string name="update_lsposed">Update LSPosed</string>
|
||||||
<string name="update_lsposed_msg">Confirm to update LSPosed?This device will reboot after update completion</string>
|
<string name="update_lsposed_msg">Confirm to update LSPosed? This device will reboot after update completion</string>
|
||||||
|
|
||||||
<!-- LogsActivity -->
|
<!-- LogsActivity -->
|
||||||
<string name="menuSaveToSd">Save</string>
|
<string name="menuSaveToSd">Save</string>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<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">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/group_network">
|
<androidx.preference.PreferenceCategory android:title="@string/group_network">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
|
@ -27,9 +27,9 @@
|
||||||
android:key="doh"
|
android:key="doh"
|
||||||
android:summary="@string/dns_over_http_summary"
|
android:summary="@string/dns_over_http_summary"
|
||||||
android:title="@string/dns_over_http" />
|
android:title="@string/dns_over_http" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/settings_language">
|
<androidx.preference.PreferenceCategory android:title="@string/settings_language">
|
||||||
|
|
||||||
<rikka.preference.SimpleMenuPreference
|
<rikka.preference.SimpleMenuPreference
|
||||||
android:defaultValue="SYSTEM"
|
android:defaultValue="SYSTEM"
|
||||||
|
|
@ -47,9 +47,9 @@
|
||||||
<Preference
|
<Preference
|
||||||
android:key="translation"
|
android:key="translation"
|
||||||
android:title="@string/settings_translation" />
|
android:title="@string/settings_translation" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/settings_group_theme">
|
<androidx.preference.PreferenceCategory android:title="@string/settings_group_theme">
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="follow_system_accent"
|
android:key="follow_system_accent"
|
||||||
|
|
@ -75,9 +75,9 @@
|
||||||
android:key="black_dark_theme"
|
android:key="black_dark_theme"
|
||||||
android:summary="@string/pure_black_dark_theme_summary"
|
android:summary="@string/pure_black_dark_theme_summary"
|
||||||
android:title="@string/pure_black_dark_theme" />
|
android:title="@string/pure_black_dark_theme" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/settings_group_framework">
|
<androidx.preference.PreferenceCategory android:title="@string/settings_group_framework">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
|
@ -99,9 +99,9 @@
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:summary="@string/settings_enable_auto_add_shortcut_summary"
|
android:summary="@string/settings_enable_auto_add_shortcut_summary"
|
||||||
android:title="@string/pref_title_enable_auto_add_shortcut" />
|
android:title="@string/pref_title_enable_auto_add_shortcut" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory
|
<androidx.preference.PreferenceCategory
|
||||||
android:icon="@drawable/ic_baseline_settings_backup_restore_24"
|
android:icon="@drawable/ic_baseline_settings_backup_restore_24"
|
||||||
android:summary="@string/settings_backup_and_restore_summery"
|
android:summary="@string/settings_backup_and_restore_summery"
|
||||||
android:title="@string/settings_backup_and_restore">
|
android:title="@string/settings_backup_and_restore">
|
||||||
|
|
@ -111,9 +111,9 @@
|
||||||
<Preference
|
<Preference
|
||||||
android:key="restore"
|
android:key="restore"
|
||||||
android:title="@string/settings_restore" />
|
android:title="@string/settings_restore" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory
|
<androidx.preference.PreferenceCategory
|
||||||
android:key="settings_group_system"
|
android:key="settings_group_system"
|
||||||
android:title="@string/settings_group_system">
|
android:title="@string/settings_group_system">
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
|
|
@ -123,5 +123,5 @@
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:summary="@string/settings_show_hidden_icon_apps_enabled_summary"
|
android:summary="@string/settings_show_hidden_icon_apps_enabled_summary"
|
||||||
android:title="@string/settings_show_hidden_icon_apps_enabled" />
|
android:title="@string/settings_show_hidden_icon_apps_enabled" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
<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">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/group_network">
|
<androidx.preference.PreferenceCategory android:title="@string/group_network">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
|
@ -28,9 +28,9 @@
|
||||||
android:key="doh"
|
android:key="doh"
|
||||||
android:summary="@string/dns_over_http_summary"
|
android:summary="@string/dns_over_http_summary"
|
||||||
android:title="@string/dns_over_http" />
|
android:title="@string/dns_over_http" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/settings_language">
|
<androidx.preference.PreferenceCategory android:title="@string/settings_language">
|
||||||
|
|
||||||
<rikka.preference.SimpleMenuPreference
|
<rikka.preference.SimpleMenuPreference
|
||||||
android:defaultValue="SYSTEM"
|
android:defaultValue="SYSTEM"
|
||||||
|
|
@ -48,9 +48,9 @@
|
||||||
<Preference
|
<Preference
|
||||||
android:key="translation"
|
android:key="translation"
|
||||||
android:title="@string/settings_translation" />
|
android:title="@string/settings_translation" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/settings_group_theme">
|
<androidx.preference.PreferenceCategory android:title="@string/settings_group_theme">
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="follow_system_accent"
|
android:key="follow_system_accent"
|
||||||
|
|
@ -76,9 +76,9 @@
|
||||||
android:key="black_dark_theme"
|
android:key="black_dark_theme"
|
||||||
android:summary="@string/pure_black_dark_theme_summary"
|
android:summary="@string/pure_black_dark_theme_summary"
|
||||||
android:title="@string/pure_black_dark_theme" />
|
android:title="@string/pure_black_dark_theme" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory android:title="@string/settings_group_framework">
|
<androidx.preference.PreferenceCategory android:title="@string/settings_group_framework">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
|
@ -100,9 +100,9 @@
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:summary="@string/settings_enable_auto_add_shortcut_summary"
|
android:summary="@string/settings_enable_auto_add_shortcut_summary"
|
||||||
android:title="@string/pref_title_enable_auto_add_shortcut" />
|
android:title="@string/pref_title_enable_auto_add_shortcut" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<com.takisoft.preferencex.PreferenceCategory
|
<androidx.preference.PreferenceCategory
|
||||||
android:icon="@drawable/ic_baseline_settings_backup_restore_24"
|
android:icon="@drawable/ic_baseline_settings_backup_restore_24"
|
||||||
android:summary="@string/settings_backup_and_restore_summery"
|
android:summary="@string/settings_backup_and_restore_summery"
|
||||||
android:title="@string/settings_backup_and_restore">
|
android:title="@string/settings_backup_and_restore">
|
||||||
|
|
@ -112,5 +112,5 @@
|
||||||
<Preference
|
<Preference
|
||||||
android:key="restore"
|
android:key="restore"
|
||||||
android:title="@string/settings_restore" />
|
android:title="@string/settings_restore" />
|
||||||
</com.takisoft.preferencex.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue