From eed85a2c7dd0451c5880e17f7d3aafb1fb685e26 Mon Sep 17 00:00:00 2001 From: Gabriel Machado <97042217+GabrielBRDeveloper@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:29:17 -0400 Subject: [PATCH] Revert "Add Dynamic colors option for Android 12 or above (#8)" (#9) This reverts commit 6ee1a39fb4e5913e4f7f75004b51ff06c25c1fd0. --- .../pandroid/app/PandroidApplication.java | 7 ------ .../preferences/AppearancePreferences.java | 22 +------------------ .../pandroid/data/config/GlobalConfig.java | 1 - .../app/src/main/res/values/strings.xml | 5 +---- .../main/res/xml/appearance_preference.xml | 18 ++------------- 5 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/PandroidApplication.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/PandroidApplication.java index 9d440865..b0cdc935 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/PandroidApplication.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/PandroidApplication.java @@ -5,8 +5,6 @@ import android.content.Context; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; -import com.google.android.material.color.DynamicColors; -import com.google.android.material.color.DynamicColorsOptions; import com.panda3ds.pandroid.AlberDriver; import com.panda3ds.pandroid.R; @@ -32,11 +30,6 @@ public class PandroidApplication extends Application { if (GlobalConfig.get(GlobalConfig.KEY_LOGGER_SERVICE)) { startService(new Intent(this, LoggerService.class)); } - if (GlobalConfig.get(GlobalConfig.KEY_DYNAMIC_COLORS)) { - DynamicColorsOptions dynamicColorsOptions = new DynamicColorsOptions.Builder() - .build(); - DynamicColors.applyToActivitiesIfAvailable(this, dynamicColorsOptions); - } } public static int getThemeId() { diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AppearancePreferences.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AppearancePreferences.java index 3e499aab..04c89d9a 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AppearancePreferences.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/app/preferences/AppearancePreferences.java @@ -3,8 +3,6 @@ package com.panda3ds.pandroid.app.preferences; import android.os.Bundle; import androidx.annotation.Nullable; -import androidx.preference.SwitchPreference; -import com.google.android.material.color.DynamicColors; import com.panda3ds.pandroid.R; import com.panda3ds.pandroid.app.BaseActivity; @@ -25,23 +23,5 @@ public class AppearancePreferences extends BasePreferenceFragment { GlobalConfig.set(GlobalConfig.KEY_APP_THEME, (int) value); return false; }); - setItemClick("dynamic_colors", pref -> GlobalConfig.set(GlobalConfig.KEY_DYNAMIC_COLORS, ((SwitchPreference) pref).isChecked())); - - refresh(); - } - - @Override - public void onResume() { - super.onResume(); - refresh(); - } - - private void refresh() { - ((SwitchPreference) findPreference("dynamic_colors")).setChecked(GlobalConfig.get(GlobalConfig.KEY_DYNAMIC_COLORS)); - if (!DynamicColors.isDynamicColorAvailable()) { - ((SwitchPreference) findPreference("dynamic_colors")).setEnabled(false); - } - } - - } +} diff --git a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java index f2f5d9b5..bff1f9e0 100644 --- a/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java +++ b/src/pandroid/app/src/main/java/com/panda3ds/pandroid/data/config/GlobalConfig.java @@ -20,7 +20,6 @@ public class GlobalConfig { public static final Key KEY_SHADER_JIT = new Key<>("emu.shader_jit", false); public static final Key KEY_SHOW_PERFORMANCE_OVERLAY = new Key<>("dev.performanceOverlay", false); - public static final Key KEY_DYNAMIC_COLORS = new Key<>("app.dynamic_colors", false); public static final Key KEY_LOGGER_SERVICE = new Key<>("dev.loggerService", false); public static final Key KEY_APP_THEME = new Key<>("app.theme", THEME_ANDROID); public static final Key KEY_SCREEN_GAMEPAD_VISIBLE = new Key<>("app.screen_gamepad.visible", true); diff --git a/src/pandroid/app/src/main/res/values/strings.xml b/src/pandroid/app/src/main/res/values/strings.xml index a902816f..20e6c5c8 100644 --- a/src/pandroid/app/src/main/res/values/strings.xml +++ b/src/pandroid/app/src/main/res/values/strings.xml @@ -34,9 +34,6 @@ Light Dark Black - Colors - Use Dynamic Colors - Dynamic colors will be used. Actions Exit @@ -59,8 +56,8 @@ Show overlay with fps, memory, etc. Logger Store application logs to file. - Graphics Shader JIT Use shader recompiler. + Graphics Loading diff --git a/src/pandroid/app/src/main/res/xml/appearance_preference.xml b/src/pandroid/app/src/main/res/xml/appearance_preference.xml index 2210e71a..dd1ed483 100644 --- a/src/pandroid/app/src/main/res/xml/appearance_preference.xml +++ b/src/pandroid/app/src/main/res/xml/appearance_preference.xml @@ -1,7 +1,5 @@ - + - - - - - - - + \ No newline at end of file