mirror of
https://github.com/Nezumi-2711/PRM392.git
synced 2026-09-22 20:00:53 +00:00
Fix error Update
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:theme="@style/Theme.Foodify"
|
||||
tools:replace="android:theme"
|
||||
tools:targetApi="31">
|
||||
|
||||
@@ -182,6 +182,8 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
|
||||
if(Double.parseDouble(versionNameApp) < Double.parseDouble(Common.versionAppNewest)){
|
||||
alertDialogUpdate();
|
||||
} else {
|
||||
alertDialogNewest();
|
||||
}
|
||||
|
||||
|
||||
@@ -271,6 +273,15 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
private void alertDialogNewest() {
|
||||
AlertDialog alertDialog = new AlertDialog.Builder(Home.this)
|
||||
.setTitle("Thông báo!")
|
||||
.setMessage("Hiện tại đã có phiên bản mới hơn! Vui lòng cập nhật ứng dụng để mang đến những trải nghiệm tốt nhất!")
|
||||
.setPositiveButton("Tôi biết rồi", null)
|
||||
.create();
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
private void checkWriteExternalStoragePermission() {
|
||||
|
||||
if (ActivityCompat.checkSelfPermission(Home.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
|
||||
@@ -306,7 +317,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
|
||||
String url = "https://github.com/Nezumi2711/PRM392/raw/main/app-debug.apk";
|
||||
DownloadApk downloadApk = new DownloadApk(Home.this);
|
||||
downloadApk.startDownloadingApk(url);
|
||||
downloadApk.startDownloadingApk(url, "Update 2.0");
|
||||
}
|
||||
|
||||
private void showNotificationAlertDialog(String msg) {
|
||||
@@ -469,6 +480,12 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
showSettingDialog();
|
||||
} else if (id == R.id.nav_favorites) {
|
||||
startActivity(new Intent(Home.this, FavoritesActivity.class));
|
||||
} else if (id == R.id.nav_update) {
|
||||
if(Double.parseDouble(versionNameApp) < Double.parseDouble(Common.versionAppNewest)){
|
||||
alertDialogUpdate();
|
||||
} else {
|
||||
alertDialogNewest();
|
||||
}
|
||||
} else if (id == R.id.nav_log_out) {
|
||||
|
||||
//Delete Remember user & password
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M5,20h14v-2H5V20zM19,9h-4V3H9v6H5l7,7L19,9z"/>
|
||||
</vector>
|
||||
@@ -37,6 +37,12 @@
|
||||
android:title="Cài đặt"
|
||||
android:iconTint="@color/white"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/nav_update"
|
||||
android:icon="@drawable/ic_baseline_download_24"
|
||||
android:title="Kiểm tra cập nhật"
|
||||
android:iconTint="@color/white"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/nav_log_out"
|
||||
android:icon="@drawable/ic_baseline_exit_to_app_24"
|
||||
|
||||
Reference in New Issue
Block a user