mirror of https://github.com/YTVanced/VancedMicroG
Improve show launcher icon after click on Huawei button
This commit is contained in:
parent
e015189785
commit
174006d60b
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue