diff --git a/app/src/main/java/com/fox2code/mmm/SetupActivity.java b/app/src/main/java/com/fox2code/mmm/SetupActivity.java index 21b32fa..884d782 100644 --- a/app/src/main/java/com/fox2code/mmm/SetupActivity.java +++ b/app/src/main/java/com/fox2code/mmm/SetupActivity.java @@ -27,9 +27,6 @@ import java.util.Objects; public class SetupActivity extends FoxActivity implements LanguageActivity { - private ActivitySetupBinding binding; - private boolean mSupportsDarkText; - @SuppressLint({"ApplySharedPref", "RestrictedApi"}) @Override protected void onCreate(Bundle savedInstanceState) { @@ -56,7 +53,7 @@ public class SetupActivity extends FoxActivity implements LanguageActivity { break; } - binding = ActivitySetupBinding.inflate(getLayoutInflater()); + com.fox2code.mmm.databinding.ActivitySetupBinding binding = ActivitySetupBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); // Show setup box. Put the setup_box in the main activity layout View view = binding.setupBox; @@ -142,6 +139,10 @@ public class SetupActivity extends FoxActivity implements LanguageActivity { break; case "transparent_light": setTheme(R.style.Theme_MagiskModuleManager_Transparent_Light); + // restart the activity because switching to transparent pisses the rendering engine off + Intent intent = getIntent(); + finish(); + startActivity(intent); break; } }, 100); diff --git a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java index ae931fe..532ef5d 100644 --- a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java +++ b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java @@ -190,13 +190,10 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { findPreference("pref_enable_blur").setSummary(R.string.blur_disabled_summary); } themePreference.setSummaryProvider(p -> themePreference.getEntry()); - themePreference.setOnPreferenceClickListener(p -> { + themePreference.setOnPreferenceChangeListener((preference, newValue) -> { // You need to reboot your device at least once to be able to access dev-mode if (devModeStepFirstBootIgnore || !MainApplication.isFirstBoot()) devModeStep = 1; - return false; - }); - themePreference.setOnPreferenceChangeListener((preference, newValue) -> { if (BuildConfig.DEBUG) { Log.d(TAG, "Theme changed, refreshing activity. New value: " + newValue); } @@ -226,6 +223,9 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { MainApplication.getINSTANCE().updateTheme(); FoxActivity.getFoxActivity(this).setThemeRecreate(MainApplication.getINSTANCE().getManagerThemeResId()); }, 1); + Intent intent = new Intent(requireContext(), SettingsActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); }).setNegativeButton(R.string.cancel, (dialog, which) -> { // Revert to system theme ((ListPreference) findPreference("pref_theme")).setValue("system");