Unnecessary use of fully qualified name

...'PreferenceManager.getDefaultSharedPreferences' due to existing static import 'androidx.preference.PreferenceManager.getDefaultSharedPreferences'

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2024-04-22 12:04:01 +02:00
parent 4a58f52de3
commit 71aa037430
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -37,7 +37,7 @@ public class NotesApplication extends Application {
public void onCreate() { public void onCreate() {
PREF_KEY_THEME = getString(R.string.pref_key_theme); PREF_KEY_THEME = getString(R.string.pref_key_theme);
setAppTheme(getAppTheme(getApplicationContext())); setAppTheme(getAppTheme(getApplicationContext()));
final var prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); final var prefs = getDefaultSharedPreferences(getApplicationContext());
lockedPreference = prefs.getBoolean(getString(R.string.pref_key_lock), false); lockedPreference = prefs.getBoolean(getString(R.string.pref_key_lock), false);
isGridViewEnabled = getDefaultSharedPreferences(this).getBoolean(getString(R.string.pref_key_gridview), false); isGridViewEnabled = getDefaultSharedPreferences(this).getBoolean(getString(R.string.pref_key_gridview), false);
super.onCreate(); super.onCreate();
@ -59,7 +59,7 @@ public class NotesApplication extends Application {
} }
public static DarkModeSetting getAppTheme(Context context) { public static DarkModeSetting getAppTheme(Context context) {
final var prefs = PreferenceManager.getDefaultSharedPreferences(context); final var prefs = getDefaultSharedPreferences(context);
String mode; String mode;
try { try {
mode = prefs.getString(PREF_KEY_THEME, DarkModeSetting.SYSTEM_DEFAULT.name()); mode = prefs.getString(PREF_KEY_THEME, DarkModeSetting.SYSTEM_DEFAULT.name());