Re-enable monet for transparent theme

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/27/head
androidacy-user 3 years ago
parent c30bc44698
commit 12f764a4a3

@ -235,10 +235,8 @@ public class MainApplication extends FoxApplication implements androidx.work.Con
themeResId = monet ? R.style.Theme_MagiskModuleManager_Monet_Light : R.style.Theme_MagiskModuleManager_Light;
break;
case "transparent_light":
if (monet) {
Log.w("MainApplication", "Monet is not supported for transparent theme");
}
themeResId = R.style.Theme_MagiskModuleManager_Transparent_Light;
themeResId = monet ? R.style.Theme_MagiskModuleManager_Transparent_Monet_Light :
R.style.Theme_MagiskModuleManager_Transparent_Light;
break;
}
this.setManagerThemeResId(themeResId);

@ -126,19 +126,12 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity {
// If transparent theme(s) are set, disable monet
if (themePreference.getValue().equals("transparent_light")) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "Transparent theme is set, disabling monet");
Log.d(TAG, "Transparent theme is set, disabling blur");
}
findPreference("pref_enable_monet").setEnabled(false);
// Toggle monet off
((TwoStatePreference) findPreference("pref_enable_monet")).setChecked(false);
SharedPreferences.Editor editor =
getPreferenceManager().getSharedPreferences().edit();
editor.putBoolean("pref_enable_monet", false).apply();
// Set summary
findPreference("pref_enable_monet").setSummary(R.string.monet_disabled_summary);
// Same for blur
findPreference("pref_enable_blur").setEnabled(false);
((TwoStatePreference) findPreference("pref_enable_blur")).setChecked(false);
SharedPreferences.Editor editor = getPreferenceManager().getSharedPreferences().edit();
editor.putBoolean("pref_enable_blur", false).apply();
findPreference("pref_enable_blur").setSummary(R.string.blur_disabled_summary);
}
@ -159,12 +152,8 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity {
// If theme contains "transparent" then disable monet
if (newValue.toString().contains("transparent")) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "Transparent theme is being set, disabling monet");
Log.d(TAG, "Transparent theme is being set, disabling blur");
}
findPreference("pref_enable_monet").setEnabled(false);
((TwoStatePreference) findPreference("pref_enable_monet")).setChecked(false);
editor.putBoolean("pref_enable_monet", false).apply();
findPreference("pref_enable_monet").setSummary(R.string.monet_disabled_summary);
// Same for blur
findPreference("pref_enable_blur").setEnabled(false);
((TwoStatePreference) findPreference("pref_enable_blur")).setChecked(false);

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MagiskModuleManager.Transparent.Light" parent="Theme.MagiskModuleManager.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<!-- Make as much as sanely possible of the window transparent -->
<item name="android:background">@android:color/transparent</item>
<item name="android:colorBackground">@android:color/transparent</item>
<item name="android:primaryContentAlpha">0.0</item>
<item name="android:secondaryContentAlpha">0.0</item>
</style>
</resources>

@ -1,4 +1,4 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<style name="Theme.MagiskModuleManager.Monet.Light" parent="Theme.Material3.DynamicColors.Light">
<item name="android:statusBarColor">@color/status_bar_color</item>
@ -13,7 +13,20 @@
<item name="chipIconTint">?attr/colorControlNormal</item>
</style>
<style name="Theme.MagiskModuleManager.Transparent.Light" parent="Theme.MagiskModuleManager.Light" />
<style name="Theme.MagiskModuleManager.Transparent.Monet.Light"
parent="Theme.MagiskModuleManager.Monet.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.MagiskModuleManager.Monet.Dark" parent="Theme.Material3.DynamicColors.Dark">
<item name="android:statusBarColor">@color/status_bar_color</item>

@ -199,6 +199,5 @@
<string name="download_full_app">Download full version</string>
<string name="repo_update_failed">Some repos have failed to update</string>
<string name="repo_update_failed_extended">Update of %1$s failed. Please try again later.</string>
<string name="monet_disabled_summary">Monet has been disabled because it causes issues with transparent themes. Please choose another theme to enable monet.</string>
<string name="blur_disabled_summary">Blur is not compatible with transparent theme. Please select another theme to enable this.</string>
<string name="blur_disabled_summary">Blur is not compatible with the transparent theme.</string>
</resources>

Loading…
Cancel
Save