mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
android: Remove ThemeUtil
This commit is contained in:
parent
b8eb8bd2b5
commit
8a4eb062e8
1 changed files with 0 additions and 34 deletions
|
@ -1,34 +0,0 @@
|
|||
package org.yuzu.yuzu_emu.utils;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
import org.yuzu.yuzu_emu.YuzuApplication;
|
||||
import org.yuzu.yuzu_emu.features.settings.utils.SettingsFile;
|
||||
|
||||
public class ThemeUtil {
|
||||
private static SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.getAppContext());
|
||||
|
||||
private static void applyTheme(int designValue) {
|
||||
switch (designValue) {
|
||||
case 0:
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
break;
|
||||
case 1:
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
break;
|
||||
case 2:
|
||||
AppCompatDelegate.setDefaultNightMode(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ?
|
||||
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM :
|
||||
AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyTheme() {
|
||||
applyTheme(mPreferences.getInt(SettingsFile.KEY_DESIGN, 0));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue