diff --git a/app/build.gradle b/app/build.gradle index 70bb924..c8eb406 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { minSdk minApi targetSdk targetApi versionCode 21 - versionName "v2.9.5-3dfx-neapolitanicecream" + versionName "v2.9.5-3dfx-orangecake" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true } diff --git a/app/src/main/java/com/vectras/vm/CustomRomActivity.java b/app/src/main/java/com/vectras/vm/CustomRomActivity.java index a2c610d..554f42c 100644 --- a/app/src/main/java/com/vectras/vm/CustomRomActivity.java +++ b/app/src/main/java/com/vectras/vm/CustomRomActivity.java @@ -575,6 +575,7 @@ public class CustomRomActivity extends AppCompatActivity { previousName = current.itemName; } else { + checkVMID(); if (getIntent().hasExtra("addromnow")) { title.setText(getIntent().getStringExtra("romname")); if (Objects.requireNonNull(getIntent().getStringExtra("romextra")).isEmpty()) { @@ -685,7 +686,6 @@ public class CustomRomActivity extends AppCompatActivity { protected void onActivityResult(int requestCode, int resultCode, Intent ReturnedIntent) { super.onActivityResult(requestCode, resultCode, ReturnedIntent); - checkVMID(); File romDir = new File(AppConfig.vmFolder + vmID); romDir.mkdirs(); @@ -1089,7 +1089,6 @@ public class CustomRomActivity extends AppCompatActivity { } private void importCVBI(String _filepath, String _filename) { - checkVMID(); LinearLayout custom = findViewById(R.id.custom); ImageView ivIcon = findViewById(R.id.ivIcon); if (_filepath.endsWith(".cvbi") || _filepath.endsWith(".cvbi.zip")) { diff --git a/app/src/main/java/com/vectras/vm/MainActivity.java b/app/src/main/java/com/vectras/vm/MainActivity.java index 74c1a9f..fa16d5c 100644 --- a/app/src/main/java/com/vectras/vm/MainActivity.java +++ b/app/src/main/java/com/vectras/vm/MainActivity.java @@ -141,6 +141,7 @@ public class MainActivity extends AppCompatActivity { private boolean doneonstart = false; public static boolean isActivate = false; public boolean skipIDEwithARM64DialogInStartVM = false; + BottomAppBar bottomAppBar; @Override protected void onCreate(Bundle bundle) { @@ -155,9 +156,6 @@ public class MainActivity extends AppCompatActivity { NotificationManager notificationManager = (NotificationManager) activity.getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); - if (MainSettingsManager.getPromptUpdateVersion(activity)) - updateApp(false); - new LibraryChecker(activity).checkMissingLibraries(activity); romsLayout = findViewById(R.id.romsLayout); @@ -705,6 +703,9 @@ public class MainActivity extends AppCompatActivity { setupBottomAppBar(); + if (MainSettingsManager.getPromptUpdateVersion(activity)) + updateApp(false); + String command = "qemu-system-x86_64 --version"; new Terminal(activity).extractQemuVersion(command, false, activity, (output, errors) -> { if (errors.isEmpty()) { @@ -775,6 +776,7 @@ public class MainActivity extends AppCompatActivity { versionNameonUpdate = obj.getString("versionNameBeta"); if (versionCode < obj.getInt("versionCode") || !versionNameonUpdate.equals(versionName)) { + if (showDialog) { AlertDialog.Builder alert = new AlertDialog.Builder(activity, R.style.MainDialogTheme); alert.setTitle("Install the latest version") .setMessage(Html.fromHtml(obj.getString("MessageBeta") + "

Update size:
" + obj.getString("sizeBeta"))) @@ -788,12 +790,16 @@ public class MainActivity extends AppCompatActivity { } } }).show(); - + } else { + View _update = findViewById(R.id.update); + _update.setVisibility(View.VISIBLE); + } } } else { versionNameonUpdate = obj.getString("versionName"); if (versionCode < obj.getInt("versionCode") || !versionNameonUpdate.contains(versionName)) { + if (showDialog) { AlertDialog.Builder alert = new AlertDialog.Builder(activity, R.style.MainDialogTheme); alert.setTitle("Install the latest version") .setMessage(Html.fromHtml(obj.getString("Message") + "

Update size:
" + obj.getString("size"))) @@ -807,7 +813,10 @@ public class MainActivity extends AppCompatActivity { } } }).show(); - + } else { + View _update = findViewById(R.id.update); + _update.setVisibility(View.VISIBLE); + } } } } else if (result.contains("Error on getting data") && showDialog) { @@ -1496,11 +1505,13 @@ public class MainActivity extends AppCompatActivity { } private void setupBottomAppBar() { - BottomAppBar bottomAppBar = findViewById(R.id.bottomAppBar); + bottomAppBar = findViewById(R.id.bottomAppBar); bottomAppBar.setOnMenuItemClickListener(new BottomAppBar.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { - if (item.getItemId() == R.id.shutdown) { + if (item.getItemId() == R.id.update) { + updateApp(true); + } else if (item.getItemId() == R.id.shutdown) { alertDialog = new AlertDialog.Builder(activity, R.style.MainDialogTheme).create(); alertDialog.setTitle(getResources().getString(R.string.do_you_want_to_kill_all_qemu_processes)); alertDialog.setMessage(getResources().getString(R.string.all_running_vms_will_be_forcibly_shut_down)); @@ -1528,6 +1539,8 @@ public class MainActivity extends AppCompatActivity { return false; } }); + View _update = findViewById(R.id.update); + _update.setVisibility(View.GONE); } } diff --git a/app/src/main/res/drawable-xhdpi/update48.png b/app/src/main/res/drawable-xhdpi/update48.png new file mode 100644 index 0000000..9bfc99a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/update48.png differ diff --git a/app/src/main/res/menu/home_bottom_app_bar.xml b/app/src/main/res/menu/home_bottom_app_bar.xml index 01a7097..e951ef4 100644 --- a/app/src/main/res/menu/home_bottom_app_bar.xml +++ b/app/src/main/res/menu/home_bottom_app_bar.xml @@ -1,22 +1,28 @@ + + app:showAsAction="always"/> + app:showAsAction="always"/> + app:showAsAction="always"/> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9aa3842..6a2f61b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -3,7 +3,7 @@ Vectras VM - v2.9.5 (3dfx - Neapolitan ice cream) + v2.9.5 (3dfx - Orange cake) Stable Home Logger diff --git a/web/data/UpdateConfig.json b/web/data/UpdateConfig.json index 6b8f824..52cf0cf 100644 --- a/web/data/UpdateConfig.json +++ b/web/data/UpdateConfig.json @@ -1,15 +1,15 @@ { "versionCode":"21", - "versionName":"v2.9.5-3dfx,v2.9.5-3dfx-almondcake,v2.9.5-3dfx-bread,v2.9.5-3dfx-churro,v2.9.5-3dfx-doughnut,v2.9.5-3dfx-empanada,v2.9.5-3dfx-flan,v2.9.5-3dfx-gugelhupf,v2.9.5-3dfx-hamentaschen,v2.9.5-3dfx-italianice,v2.9.5-3dfx-ladyfingers,v2.9.5-3dfx-madeleine", + "versionName":"v2.9.5-3dfx,v2.9.5-3dfx-almondcake,v2.9.5-3dfx-bread,v2.9.5-3dfx-churro,v2.9.5-3dfx-doughnut,v2.9.5-3dfx-empanada,v2.9.5-3dfx-flan,v2.9.5-3dfx-gugelhupf,v2.9.5-3dfx-hamentaschen,v2.9.5-3dfx-italianice,v2.9.5-3dfx-ladyfingers,v2.9.5-3dfx-madeleine,v2.9.5-3dfx-neapolitanicecream,v2.9.5-3dfx-orangecake", "size": "46 MB", "url": "https://github.com/xoureldeen/Vectras-VM-Android/releases/v2.9.5", "Message": "

v2.9.5-3dfx



New updates are live!", "cancellable": true, "versionCodeBeta":"21", - "versionNameBeta":"v2.9.5-3dfx-neapolitanicecream", - "versionNameBetas":"v2.9.5-3dfx-madeleine,v2.9.5-3dfx-neapolitanicecream", + "versionNameBeta":"v2.9.5-3dfx-orangecake", + "versionNameBetas":"v2.9.5-3dfx-madeleine,v2.9.5-3dfx-neapolitanicecream,v2.9.5-3dfx-orangecake", "sizeBeta": "48 MB", "urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases", - "MessageBeta": "

Neapolitan ice cream

Bugs fixed.", + "MessageBeta": "

Orange cake

Bugs fixed.", "cancellableBeta": true }