work around the renderer

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

@ -27,9 +27,6 @@ import java.util.Objects;
public class SetupActivity extends FoxActivity implements LanguageActivity { public class SetupActivity extends FoxActivity implements LanguageActivity {
private ActivitySetupBinding binding;
private boolean mSupportsDarkText;
@SuppressLint({"ApplySharedPref", "RestrictedApi"}) @SuppressLint({"ApplySharedPref", "RestrictedApi"})
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -56,7 +53,7 @@ public class SetupActivity extends FoxActivity implements LanguageActivity {
break; break;
} }
binding = ActivitySetupBinding.inflate(getLayoutInflater()); com.fox2code.mmm.databinding.ActivitySetupBinding binding = ActivitySetupBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
// Show setup box. Put the setup_box in the main activity layout // Show setup box. Put the setup_box in the main activity layout
View view = binding.setupBox; View view = binding.setupBox;
@ -142,6 +139,10 @@ public class SetupActivity extends FoxActivity implements LanguageActivity {
break; break;
case "transparent_light": case "transparent_light":
setTheme(R.style.Theme_MagiskModuleManager_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; break;
} }
}, 100); }, 100);

@ -190,13 +190,10 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity {
findPreference("pref_enable_blur").setSummary(R.string.blur_disabled_summary); findPreference("pref_enable_blur").setSummary(R.string.blur_disabled_summary);
} }
themePreference.setSummaryProvider(p -> themePreference.getEntry()); 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 // You need to reboot your device at least once to be able to access dev-mode
if (devModeStepFirstBootIgnore || !MainApplication.isFirstBoot()) if (devModeStepFirstBootIgnore || !MainApplication.isFirstBoot())
devModeStep = 1; devModeStep = 1;
return false;
});
themePreference.setOnPreferenceChangeListener((preference, newValue) -> {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
Log.d(TAG, "Theme changed, refreshing activity. New value: " + newValue); Log.d(TAG, "Theme changed, refreshing activity. New value: " + newValue);
} }
@ -226,6 +223,9 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity {
MainApplication.getINSTANCE().updateTheme(); MainApplication.getINSTANCE().updateTheme();
FoxActivity.getFoxActivity(this).setThemeRecreate(MainApplication.getINSTANCE().getManagerThemeResId()); FoxActivity.getFoxActivity(this).setThemeRecreate(MainApplication.getINSTANCE().getManagerThemeResId());
}, 1); }, 1);
Intent intent = new Intent(requireContext(), SettingsActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}).setNegativeButton(R.string.cancel, (dialog, which) -> { }).setNegativeButton(R.string.cancel, (dialog, which) -> {
// Revert to system theme // Revert to system theme
((ListPreference) findPreference("pref_theme")).setValue("system"); ((ListPreference) findPreference("pref_theme")).setValue("system");

Loading…
Cancel
Save