From 64d7a536163d013665193a6c2072c354572979f2 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 23 Jan 2024 05:35:42 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E5=A4=89?= =?UTF-8?q?=E6=9B=B4,=20=E4=B8=80=E9=83=A8=E3=83=95=E3=83=A9=E3=82=B0?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/one/nem/lacerta/LacertaApplication.java | 7 ++++++- .../src/main/java/one/nem/lacerta/utils/FeatureSwitch.java | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a5ae62e6..1680ef09 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" - android:icon="@mipmap/ic_launcher" + android:icon="@mipmap/ic_launcher_temp_round" android:name=".LacertaApplication" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" diff --git a/app/src/main/java/one/nem/lacerta/LacertaApplication.java b/app/src/main/java/one/nem/lacerta/LacertaApplication.java index 448349b5..78dae9ae 100644 --- a/app/src/main/java/one/nem/lacerta/LacertaApplication.java +++ b/app/src/main/java/one/nem/lacerta/LacertaApplication.java @@ -6,6 +6,7 @@ import android.util.Log; import com.google.android.material.color.DynamicColors; import dagger.hilt.android.HiltAndroidApp; +import one.nem.lacerta.utils.FeatureSwitch; @HiltAndroidApp public class LacertaApplication extends Application { @@ -15,7 +16,11 @@ public class LacertaApplication extends Application { if (DynamicColors.isDynamicColorAvailable()) { Log.d("DynamicColors", "DynamicColors is available. Applying to activities..."); - DynamicColors.applyToActivitiesIfAvailable(this); + if (FeatureSwitch.Meta.disableDynamicColor) { + Log.d("DynamicColors", "DynamicColors is disabled by FeatureSwitch."); + } else { + DynamicColors.applyToActivitiesIfAvailable(this); + } } else { Log.d("DynamicColors", "DynamicColors is not available."); } diff --git a/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java b/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java index 5c808841..aae02397 100644 --- a/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java +++ b/utils/src/main/java/one/nem/lacerta/utils/FeatureSwitch.java @@ -4,6 +4,8 @@ public class FeatureSwitch { public static class Meta { public static boolean canOverrideSwitch = false; + + public static boolean disableDynamicColor = false; } public static class RecyclerView {