Show correct message

This commit is contained in:
topjohnwu 2017-09-03 00:17:42 +08:00
parent 0ec473195d
commit 04a4265ef3
2 changed files with 17 additions and 20 deletions

View File

@ -401,15 +401,6 @@ public class MagiskFragment extends Fragment
rootStatusIcon.setImageResource(image);
rootStatusIcon.setColorFilter(color);
if (!Shell.rootAccess()) {
installText.setText(R.string.install);
} 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));
@ -423,7 +414,6 @@ public class MagiskFragment extends Fragment
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
}
}
private void updateCheckUI() {
int image, color;
@ -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);

View File

@ -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" />