Improve show launcher icon after click on Huawei button

This commit is contained in:
Oizaro 2021-03-16 00:35:07 +01:00
parent e015189785
commit 174006d60b
2 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,7 @@ import org.microg.gms.checkin.LastCheckinInfo;
import org.microg.gms.common.HttpFormClient;
import org.microg.gms.common.Utils;
import org.microg.gms.people.PeopleManager;
import org.microg.gms.ui.SettingsFragment;
import java.io.IOException;
import java.util.Locale;
@ -162,6 +163,7 @@ public class LoginActivity extends AssistantActivity {
super.onHuaweiButtonClicked();
state++;
if (state == 1) {
SettingsFragment.Companion.getHIDE_ICON_SWITCH().setChecked(false);
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true).apply();
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(LoginButtonPreference, true)) {
LastCheckinInfo.ClearCheckinInfo(this);

View File

@ -52,6 +52,7 @@ class SettingsFragment : ResourceSettingsFragment() {
true
}
HIDE_ICON_SWITCH = findPreference<SwitchPreferenceCompat>(PREF_CAST_HIDE_LAUNCHER_ICON);
findPreference<SwitchPreferenceCompat>(PREF_CAST_HIDE_LAUNCHER_ICON)?.apply {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
setOnPreferenceChangeListener { _, newValue ->
@ -93,6 +94,7 @@ class SettingsFragment : ResourceSettingsFragment() {
}
companion object {
var HIDE_ICON_SWITCH: SwitchPreferenceCompat? = null;
const val PREF_ABOUT = "pref_about"
const val PREF_GCM = "pref_gcm"
const val PREF_CHECKIN = "pref_checkin"