From 88ffd9eb4bb7134bc44fb19f31dded9239b6469b Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Fri, 20 Dec 2019 18:07:24 +0100 Subject: [PATCH] Initialize default preferences at startup --- app/src/main/java/com/readrops/app/ReadropsApp.java | 2 ++ app/src/main/res/xml/preferences.xml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/readrops/app/ReadropsApp.java b/app/src/main/java/com/readrops/app/ReadropsApp.java index 86048ee0..ad173693 100644 --- a/app/src/main/java/com/readrops/app/ReadropsApp.java +++ b/app/src/main/java/com/readrops/app/ReadropsApp.java @@ -6,6 +6,7 @@ import android.app.NotificationManager; import android.os.Build; import androidx.appcompat.app.AppCompatDelegate; +import androidx.preference.PreferenceManager; import com.facebook.stetho.Stetho; import com.readrops.app.utils.SharedPreferencesManager; @@ -29,6 +30,7 @@ public class ReadropsApp extends Application { } createNotificationChannels(); + PreferenceManager.setDefaultValues(this, R.xml.preferences, false); if (Boolean.valueOf(SharedPreferencesManager.readString(this, SharedPreferencesManager.SharedPrefKey.DARK_THEME))) AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 402b61bd..0dae98bc 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -16,14 +16,14 @@ android:title="@string/reload_feeds_colors" />