mirror of https://github.com/readrops/Readrops.git
Initialize default preferences at startup
This commit is contained in:
parent
6274540352
commit
88ffd9eb4b
|
@ -6,6 +6,7 @@ import android.app.NotificationManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.facebook.stetho.Stetho;
|
import com.facebook.stetho.Stetho;
|
||||||
import com.readrops.app.utils.SharedPreferencesManager;
|
import com.readrops.app.utils.SharedPreferencesManager;
|
||||||
|
@ -29,6 +30,7 @@ public class ReadropsApp extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
createNotificationChannels();
|
createNotificationChannels();
|
||||||
|
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
|
||||||
|
|
||||||
if (Boolean.valueOf(SharedPreferencesManager.readString(this, SharedPreferencesManager.SharedPrefKey.DARK_THEME)))
|
if (Boolean.valueOf(SharedPreferencesManager.readString(this, SharedPreferencesManager.SharedPrefKey.DARK_THEME)))
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
android:title="@string/reload_feeds_colors" />
|
android:title="@string/reload_feeds_colors" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="1"
|
android:defaultValue="0"
|
||||||
android:entries="@array/open_items_in"
|
android:entries="@array/open_items_in"
|
||||||
android:entryValues="@array/open_item_in_values"
|
android:entryValues="@array/open_item_in_values"
|
||||||
android:key="open_items_in"
|
android:key="open_items_in"
|
||||||
android:title="@string/open_items_in" />
|
android:title="@string/open_items_in" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="1"
|
android:defaultValue="false"
|
||||||
android:entries="@array/themes"
|
android:entries="@array/themes"
|
||||||
android:entryValues="@array/themes_values"
|
android:entryValues="@array/themes_values"
|
||||||
android:key="dark_theme"
|
android:key="dark_theme"
|
||||||
|
|
Loading…
Reference in New Issue