Clean up default preferences setter
This commit is contained in:
parent
c553312fd5
commit
a1335aecfb
@ -29,9 +29,8 @@ public class SettingsFragment extends PreferenceFragment implements SharedPrefer
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Load the preferences from an XML resource
|
||||
addPreferencesFromResource(R.xml.uisettings);
|
||||
PreferenceManager.setDefaultValues(getActivity(), R.xml.uisettings, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,27 +21,28 @@ public class SplashActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
SharedPreferences defaultPrefs = PreferenceManager.getDefaultSharedPreferences(getApplication());
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
SharedPreferences defaultPrefs = PreferenceManager.getDefaultSharedPreferences(getApplication());
|
||||
if (defaultPrefs.getString("theme","").equals("Dark")) {
|
||||
setTheme(R.style.AppTheme_dh);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//setups go here
|
||||
|
||||
// Set up default preferences,make sure we add "extra" blacklist entries.
|
||||
PreferenceManager.setDefaultValues(this, R.xml.defaultpref, false);
|
||||
|
||||
|
||||
|
||||
if (!defaultPrefs.contains("auto_blacklist")) {
|
||||
Logger.dh("AutoRootFragment: Setting default preferences for application");
|
||||
Logger.dh("SplashActivity: Setting default preferences for application");
|
||||
SharedPreferences.Editor editor = defaultPrefs.edit();
|
||||
Set<String> set = new HashSet<>();
|
||||
set.add("com.google.android.apps.walletnfcrel");
|
||||
set.add("com.google.android.gms");
|
||||
set.add("com.google.commerce.tapandpay");
|
||||
editor.putStringSet("auto_blacklist", set);
|
||||
editor.putBoolean("autoRootEnable",false);
|
||||
editor.putBoolean("root",Utils.rootEnabled());
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<Preference
|
||||
android:key="theme"
|
||||
android:defaultValue="Default"
|
||||
/>
|
||||
<Preference
|
||||
android:key="auto_blacklist"
|
||||
android:defaultValue="com.google.android.apps.walletnfcrel"
|
||||
/>
|
||||
<Preference
|
||||
android:key="auto_whitelist"
|
||||
android:defaultValue="com.keramidas.TitaniumBackupPro"
|
||||
/>
|
||||
</PreferenceScreen>
|
@ -8,6 +8,7 @@
|
||||
android:key="theme"
|
||||
android:title="Theme"
|
||||
android:summary="Select a theme"
|
||||
android:defaultValue="Default"
|
||||
android:entries="@array/themes"
|
||||
android:entryValues="@array/themes"/>
|
||||
</PreferenceCategory>
|
||||
@ -16,6 +17,7 @@
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="enable_quicktile"
|
||||
android:defaultValue="false"
|
||||
android:title="@string/settings_enable_quicktile_title"
|
||||
android:summary="@string/settings_enable_quicktile_summary" />
|
||||
|
||||
@ -24,6 +26,7 @@
|
||||
android:title="@string/settings_root_category">
|
||||
<CheckBoxPreference
|
||||
android:key="keep_root_off"
|
||||
android:defaultValue="false"
|
||||
android:title="@string/settings_keep_root_off_title"
|
||||
android:summary="@string/settings_keep_root_off_summary" />
|
||||
|
||||
@ -39,6 +42,7 @@
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="developer_logging"
|
||||
android:defaultValue="false"
|
||||
android:title="@string/settings_developer_logging_title"
|
||||
android:summary="@string/settings_developer_logging_summary" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user