mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-29 04:47:39 +00:00
Show correct message
This commit is contained in:
parent
0ec473195d
commit
04a4265ef3
@ -401,28 +401,18 @@ public class MagiskFragment extends Fragment
|
||||
rootStatusIcon.setImageResource(image);
|
||||
rootStatusIcon.setColorFilter(color);
|
||||
|
||||
if (!Shell.rootAccess()) {
|
||||
installText.setText(R.string.install);
|
||||
List<String> items = new ArrayList<>();
|
||||
if (magiskManager.bootBlock != null) {
|
||||
items.add(getString(R.string.auto_detect, magiskManager.bootBlock));
|
||||
spinner.setEnabled(false);
|
||||
} else {
|
||||
if (magiskManager.remoteMagiskVersionCode > magiskManager.magiskVersionCode) {
|
||||
installText.setText(R.string.update);
|
||||
} else {
|
||||
installText.setText(R.string.reinstall);
|
||||
}
|
||||
|
||||
List<String> items = new ArrayList<>();
|
||||
if (magiskManager.bootBlock != null) {
|
||||
items.add(getString(R.string.auto_detect, magiskManager.bootBlock));
|
||||
spinner.setEnabled(false);
|
||||
} else {
|
||||
items.add(getString(R.string.cannot_auto_detect));
|
||||
items.addAll(magiskManager.blockList);
|
||||
}
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(),
|
||||
android.R.layout.simple_spinner_item, items);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner.setAdapter(adapter);
|
||||
items.add(getString(R.string.cannot_auto_detect));
|
||||
items.addAll(magiskManager.blockList);
|
||||
}
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(),
|
||||
android.R.layout.simple_spinner_item, items);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner.setAdapter(adapter);
|
||||
}
|
||||
|
||||
private void updateCheckUI() {
|
||||
@ -438,6 +428,12 @@ public class MagiskFragment extends Fragment
|
||||
magiskUpdateText.setText(getString(R.string.install_magisk_title, "v" + magiskManager.remoteMagiskVersionString));
|
||||
}
|
||||
|
||||
if (magiskManager.remoteMagiskVersionCode > magiskManager.magiskVersionCode) {
|
||||
installText.setText(R.string.update);
|
||||
} else {
|
||||
installText.setText(R.string.install);
|
||||
}
|
||||
|
||||
magiskUpdateIcon.setImageResource(image);
|
||||
magiskUpdateIcon.setColorFilter(color);
|
||||
magiskUpdateIcon.setVisibility(View.VISIBLE);
|
||||
|
@ -411,6 +411,7 @@
|
||||
android:ems="10"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center"
|
||||
android:text="@string/install"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user