mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-22 03:19:23 +00:00
3.7.5
- Bugs fixed.
This commit is contained in:
parent
0b7c0ab8bc
commit
e83ca4e6f5
6 changed files with 90 additions and 92 deletions
|
|
@ -12,8 +12,8 @@ android {
|
|||
applicationId "com.vectras.vm"
|
||||
minSdk minApi
|
||||
targetSdk targetApi
|
||||
versionCode 77
|
||||
versionName "3.7.3"
|
||||
versionCode 78
|
||||
versionName "3.7.4"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
public boolean addromnowdone = false;
|
||||
private boolean created = false;
|
||||
boolean modify;
|
||||
private boolean isImportingCVBI = false;
|
||||
private boolean isProcessingFile = false;
|
||||
public static DataMainRoms current;
|
||||
private String thumbnailPath = "";
|
||||
private String vmID = VMManager.idGenerator();
|
||||
|
|
@ -348,7 +348,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void onBack() {
|
||||
if (isImportingCVBI) return;
|
||||
if (isProcessingFile) return;
|
||||
|
||||
if (!created && !modify) {
|
||||
new Thread(() -> FileUtils.delete(new File (AppConfig.vmFolder + vmID))).start();
|
||||
|
|
@ -359,7 +359,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
|
||||
public void onDestroy() {
|
||||
if (!created && !modify) {
|
||||
new Thread(() -> FileUtils.deleteDirectory(AppConfig.vmFolder + vmID)).start();
|
||||
new Thread(() -> FileUtils.delete(new File(AppConfig.vmFolder + vmID))).start();
|
||||
}
|
||||
modify = false;
|
||||
super.onDestroy();
|
||||
|
|
@ -394,6 +394,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
|
||||
executor.execute(() -> {
|
||||
try {
|
||||
isProcessingFile = true;
|
||||
String _filename = FileUtils.getFileNameFromUri(this, uri);
|
||||
if (_filename == null || _filename.isEmpty()) {
|
||||
_filename = String.valueOf(System.currentTimeMillis());
|
||||
|
|
@ -420,11 +421,8 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
null));
|
||||
Log.e(TAG, "isoPicker: " + e.getMessage());
|
||||
} finally {
|
||||
runOnUiThread(() -> {
|
||||
if (!isFinishing() && !isDestroyed()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
});
|
||||
isProcessingFile = false;
|
||||
runOnUiThread(() -> DialogUtils.safeDismiss(this, progressDialog));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
@ -492,6 +490,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
|
||||
executor.execute(() -> {
|
||||
try {
|
||||
isProcessingFile = true;
|
||||
String _filename = FileUtils.getFileNameFromUri(this, uri);
|
||||
if (_filename == null || _filename.isEmpty()) {
|
||||
_filename = String.valueOf(System.currentTimeMillis());
|
||||
|
|
@ -524,11 +523,8 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
null));
|
||||
Log.e(TAG, "filePicker: " + e.getMessage());
|
||||
} finally {
|
||||
runOnUiThread(() -> {
|
||||
if (!isFinishing() && !isDestroyed()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
});
|
||||
isProcessingFile = false;
|
||||
runOnUiThread(() -> DialogUtils.safeDismiss(this, progressDialog));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -727,6 +723,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
|
||||
executor.execute(() -> {
|
||||
try {
|
||||
isProcessingFile = true;
|
||||
ImageUtils.convertToPng(this, uri, AppConfig.vmFolder + vmID + "/thumbnail.png");
|
||||
|
||||
thumbnailPath = AppConfig.vmFolder + vmID + "/thumbnail.png";
|
||||
|
|
@ -742,10 +739,8 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
null,
|
||||
null));
|
||||
} finally {
|
||||
runOnUiThread(() -> {
|
||||
if (!isImportingCVBI && progressDialog.isShowing() && !isFinishing() && !isDestroyed())
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
isProcessingFile = false;
|
||||
runOnUiThread(() -> DialogUtils.safeDismiss(this, progressDialog));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -917,7 +912,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
return;
|
||||
}
|
||||
|
||||
isImportingCVBI = true;
|
||||
isProcessingFile = true;
|
||||
|
||||
View progressView = LayoutInflater.from(this).inflate(R.layout.dialog_progress_style, null);
|
||||
TextView progressText = progressView.findViewById(R.id.progress_text);
|
||||
|
|
@ -948,11 +943,10 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
);
|
||||
|
||||
runOnUiThread(() -> {
|
||||
if (progressDialog.isShowing() && !isFinishing() && !isDestroyed())
|
||||
progressDialog.dismiss();
|
||||
DialogUtils.safeDismiss(this, progressDialog);
|
||||
|
||||
if (isFinishing() || isDestroyed()) {
|
||||
new Thread(() -> FileUtils.deleteDirectory(AppConfig.vmFolder + vmID)).start();
|
||||
new Thread(() -> FileUtils.delete(new File(AppConfig.vmFolder + vmID))).start();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -975,7 +969,7 @@ public class VMCreatorActivity extends AppCompatActivity {
|
|||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void afterExtractCVBIFile(String _filename) {
|
||||
isImportingCVBI = false;
|
||||
isProcessingFile = false;
|
||||
binding.ivIcon.setEnabled(true);
|
||||
try {
|
||||
if (!FileUtils.isFileExists(AppConfig.vmFolder + vmID + "/rom-data.json")) {
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ public class SetupWizard2Activity extends AppCompatActivity {
|
|||
HashMap<String, Object> mmap;
|
||||
mmap = new Gson().fromJson(response, new TypeToken<HashMap<String, Object>>() {
|
||||
}.getType());
|
||||
if (mmap.containsKey("aarch64") && mmap.containsKey("armhf") && mmap.containsKey("amd64") && mmap.containsKey("x86")) {
|
||||
if (mmap != null && mmap.containsKey("aarch64") && mmap.containsKey("armhf") && mmap.containsKey("amd64") && mmap.containsKey("x86")) {
|
||||
if (DeviceUtils.isArm()) {
|
||||
bootstrapFileLink = Objects.requireNonNull(mmap.get(DeviceUtils.is64bit() ? "aarch64" : "armhf")).toString();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.vectras.vm.utils;
|
|||
import static android.content.Intent.ACTION_VIEW;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
|
@ -23,7 +23,6 @@ import android.widget.TextView;
|
|||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
import com.vectras.vm.AppConfig;
|
||||
import com.vectras.vm.R;
|
||||
|
||||
public class DialogUtils {
|
||||
|
|
@ -247,6 +246,12 @@ public class DialogUtils {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static void safeDismiss(Activity activity, AlertDialog dialog) {
|
||||
if (activity.isFinishing() || activity.isDestroyed()) return;
|
||||
if (dialog == null || !dialog.isShowing() || dialog.getWindow() == null) return;
|
||||
if (dialog.getWindow().getDecorView().getWindowToken() != null) dialog.dismiss();
|
||||
}
|
||||
|
||||
public static void joinTelegram(Context _context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(_context);
|
||||
if (!prefs.getBoolean("tgDialog", false)) {
|
||||
|
|
|
|||
|
|
@ -1,73 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainer">
|
||||
<LinearLayout
|
||||
android:background="?attr/colorSurfaceContainer"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/add_24px" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/add_24px"/>
|
||||
android:gravity="center"
|
||||
android:paddingVertical="16dp"
|
||||
android:text="@string/oops"
|
||||
android:textColor="?attr/colorControlNormal"
|
||||
android:textSize="22sp" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/oops"
|
||||
android:textSize="22sp"
|
||||
android:textColor="?attr/colorControlNormal"
|
||||
android:paddingVertical="16dp"/>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_weight="1">
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/oops"
|
||||
android:textColor="?attr/colorControlNormal"
|
||||
android:textColorLink="?attr/colorControlNormal"
|
||||
android:textSize="14sp"/>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<TextView
|
||||
android:id="@+id/positiveButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/dialog_shape_top_button"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:gravity="center"
|
||||
android:textColor="?attr/colorControlNormal"/>
|
||||
android:textColorLink="?attr/colorControlNormal"
|
||||
android:textSize="14sp" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/negativeButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/dialog_shape_middle_button"
|
||||
android:layout_marginVertical="1dp"
|
||||
android:gravity="center"
|
||||
android:textColor="?attr/colorControlNormal"/>
|
||||
<TextView
|
||||
android:id="@+id/positiveButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:background="@drawable/dialog_shape_top_button"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:textColor="?attr/colorControlNormal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/neutralButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/dialog_shape_bottom_button"
|
||||
android:layout_marginTop="1dp"
|
||||
android:gravity="center"
|
||||
android:textColor="?attr/colorControlNormal"/>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<TextView
|
||||
android:id="@+id/negativeButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="1dp"
|
||||
android:background="@drawable/dialog_shape_middle_button"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:textColor="?attr/colorControlNormal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/neutralButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/dialog_shape_bottom_button"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:textColor="?attr/colorControlNormal" />
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"url": "https://github.com/xoureldeen/Vectras-VM-Android/releases",
|
||||
"Message": "<h2>3.7.0</h2>\nBugs fixed.",
|
||||
"cancellable": true,
|
||||
"versionCodeBeta":"77",
|
||||
"versionNameBeta":"3.7.3",
|
||||
"versionNameBetas":"3.0.0,3.1.0,3.2.1,3.2.2,3.2.3,3.2.4,3.2.5,3.2.6,3.2.7,3.2.8,3.2.9,3.2.10,3.3.1,3.3.2,3.3.3,3.3.4,3.3.5,3.3.6,3.3.7,3.3.8,3.3.9,3.4.1,3.4.2,3.4.3,3.4.4,3.4.5,3.4.6,3.4.7,3.4.8,3.4.9,3.5.1,3.5.2,3.5.3,3.5.4,3.5.5,3.5.6,3.5.7,3.5.8,3.5.9,3.6.1,3.6.2,3.6.3,3.6.4,3.6.5,3.6.6,3.6.7,3.6.8,3.6.9,3.7.0,3.7.1,3.7.2,3.7.3",
|
||||
"versionCodeBeta":"78",
|
||||
"versionNameBeta":"3.7.4",
|
||||
"versionNameBetas":"3.0.0,3.1.0,3.2.1,3.2.2,3.2.3,3.2.4,3.2.5,3.2.6,3.2.7,3.2.8,3.2.9,3.2.10,3.3.1,3.3.2,3.3.3,3.3.4,3.3.5,3.3.6,3.3.7,3.3.8,3.3.9,3.4.1,3.4.2,3.4.3,3.4.4,3.4.5,3.4.6,3.4.7,3.4.8,3.4.9,3.5.1,3.5.2,3.5.3,3.5.4,3.5.5,3.5.6,3.5.7,3.5.8,3.5.9,3.6.1,3.6.2,3.6.3,3.6.4,3.6.5,3.6.6,3.6.7,3.6.8,3.6.9,3.7.0,3.7.1,3.7.2,3.7.3,3.7.4",
|
||||
"sizeBeta": "45 MB",
|
||||
"urlBeta": "https://github.com/AnBui2004/Vectras-VM-Emu-Android/releases",
|
||||
"MessageBeta": "<h2>3.7.3</h2>Bugs fixed.",
|
||||
"MessageBeta": "<h2>3.7.4</h2>Bugs fixed.",
|
||||
"cancellableBeta": true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue