mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-28 04:25:27 +00:00
Fix theme changing glitch
This commit is contained in:
parent
31cc008249
commit
67c139a04b
@ -47,7 +47,8 @@ import butterknife.ButterKnife;
|
|||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import butterknife.Unbinder;
|
import butterknife.Unbinder;
|
||||||
|
|
||||||
public class MagiskFragment extends Fragment implements CallbackEvent.Listener<Void> {
|
public class MagiskFragment extends Fragment
|
||||||
|
implements CallbackEvent.Listener<Void>, SwipeRefreshLayout.OnRefreshListener {
|
||||||
|
|
||||||
private static boolean noDialog = false;
|
private static boolean noDialog = false;
|
||||||
private static int expandHeight = 0;
|
private static int expandHeight = 0;
|
||||||
@ -226,29 +227,7 @@ public class MagiskFragment extends Fragment implements CallbackEvent.Listener<V
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mSwipeRefreshLayout.setOnRefreshListener(() -> {
|
mSwipeRefreshLayout.setOnRefreshListener(this);
|
||||||
updateUI();
|
|
||||||
|
|
||||||
magiskUpdateText.setText(R.string.checking_for_updates);
|
|
||||||
magiskUpdateProgress.setVisibility(View.VISIBLE);
|
|
||||||
magiskUpdateIcon.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
safetyNetStatusText.setText(R.string.safetyNet_check_text);
|
|
||||||
|
|
||||||
magiskManager.safetyNetDone.isTriggered = false;
|
|
||||||
magiskManager.updateCheckDone.isTriggered = false;
|
|
||||||
magiskManager.remoteMagiskVersionString = null;
|
|
||||||
magiskManager.remoteMagiskVersionCode = -1;
|
|
||||||
collapse();
|
|
||||||
noDialog = false;
|
|
||||||
|
|
||||||
// Trigger state check
|
|
||||||
if (Utils.checkNetworkStatus(magiskManager)) {
|
|
||||||
new CheckUpdates(getActivity()).exec();
|
|
||||||
} else {
|
|
||||||
mSwipeRefreshLayout.setRefreshing(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (magiskManager.magiskVersionCode < 0 && Shell.rootAccess() && !noDialog) {
|
if (magiskManager.magiskVersionCode < 0 && Shell.rootAccess() && !noDialog) {
|
||||||
noDialog = true;
|
noDialog = true;
|
||||||
@ -266,6 +245,31 @@ public class MagiskFragment extends Fragment implements CallbackEvent.Listener<V
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
updateUI();
|
||||||
|
|
||||||
|
magiskUpdateText.setText(R.string.checking_for_updates);
|
||||||
|
magiskUpdateProgress.setVisibility(View.VISIBLE);
|
||||||
|
magiskUpdateIcon.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
safetyNetStatusText.setText(R.string.safetyNet_check_text);
|
||||||
|
|
||||||
|
magiskManager.safetyNetDone.isTriggered = false;
|
||||||
|
magiskManager.updateCheckDone.isTriggered = false;
|
||||||
|
magiskManager.remoteMagiskVersionString = null;
|
||||||
|
magiskManager.remoteMagiskVersionCode = -1;
|
||||||
|
collapse();
|
||||||
|
noDialog = false;
|
||||||
|
|
||||||
|
// Trigger state check
|
||||||
|
if (Utils.checkNetworkStatus(magiskManager)) {
|
||||||
|
new CheckUpdates(getActivity()).exec();
|
||||||
|
} else {
|
||||||
|
mSwipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTrigger(CallbackEvent<Void> event) {
|
public void onTrigger(CallbackEvent<Void> event) {
|
||||||
if (event == magiskManager.updateCheckDone) {
|
if (event == magiskManager.updateCheckDone) {
|
||||||
|
@ -91,18 +91,6 @@ public class MainActivity extends Activity
|
|||||||
checkHideSection();
|
checkHideSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
|
||||||
super.onRestoreInstanceState(savedInstanceState);
|
|
||||||
navigate(savedInstanceState.getInt(MagiskManager.INTENT_SECTION, R.id.magisk));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
|
||||||
super.onSaveInstanceState(outState);
|
|
||||||
outState.putInt(MagiskManager.INTENT_SECTION, mDrawerItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
getApplicationContext().reloadMainActivity.unRegister(this);
|
getApplicationContext().reloadMainActivity.unRegister(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user