From 0ae73a4ba942c0e86727b8e7e125e1ff1abbb84a Mon Sep 17 00:00:00 2001 From: Rohit Date: Thu, 4 Nov 2021 18:37:28 +0000 Subject: [PATCH] [r] Updater: Improve UX for users taking version upgrades Conflicts: res/values/strings.xml src/org/lineageos/updater/UpdatesDbHelper.java src/org/lineageos/updater/UpdatesListAdapter.java src/org/lineageos/updater/misc/Utils.java --- res/layout/update_item_view.xml | 12 ++++ res/values/strings.xml | 8 ++- .../lineageos/updater/UpdatesListAdapter.java | 60 +++++++++++++++---- .../lineageos/updater/model/UpdateBase.java | 1 + 4 files changed, 68 insertions(+), 13 deletions(-) diff --git a/res/layout/update_item_view.xml b/res/layout/update_item_view.xml index c778334f..4928b800 100644 --- a/res/layout/update_item_view.xml +++ b/res/layout/update_item_view.xml @@ -36,6 +36,18 @@ android:textSize="16sp" tools:text="LineageOS 15.1" /> + + Delete the selected update file? Apply update - You are about to install %1$s.\n\nIf you press %2$s, the device will restart itself in recovery mode to install the update.\n\nNote: This feature requires a compatible Recovery or updates will need to be installed manually. - You are about to install %1$s.\n\nIf you press %2$s, the device will begin installing in the background.\n\nOnce completed, you will be prompted to reboot. + You are about to update to %1$s.\n\nIf you press %2$s, the device will restart itself in recovery mode to install the update. + You are about to update to %1$s.\n\nIf you press %2$s, the device will begin installing in the background.\n\nOnce completed, you will be prompted to reboot. + + Version Upgrade! + You are about to upgrade to %1$s, based on Android %2$s\n\nRemember: it is always recommended to backup your data before upgrades.\n\nIf you press %3$s, the device will restart itself into recovery mode to install the update. + You are about to upgrade to %1$s, based on Android %2$s.\n\nRemember: it is always recommended to backup your data before upgrades.\n\nIf you press %3$s, the device will begin installing in the background.\n\nOnce completed, you will be prompted to reboot. Cancel the installation? diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index dd1a503c..fc95c0cf 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -23,6 +23,7 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.net.Uri; import android.os.BatteryManager; +import android.os.Build; import android.os.PowerManager; import android.preference.PreferenceManager; import android.text.SpannableString; @@ -102,6 +103,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter { Utils.triggerUpdate(mActivity, downloadId); diff --git a/src/org/lineageos/updater/model/UpdateBase.java b/src/org/lineageos/updater/model/UpdateBase.java index f1689bce..167e3629 100644 --- a/src/org/lineageos/updater/model/UpdateBase.java +++ b/src/org/lineageos/updater/model/UpdateBase.java @@ -38,6 +38,7 @@ public class UpdateBase implements UpdateBaseInfo { mType = update.getType(); mVersion = update.getVersion(); mDisplayVersion = update.getDisplayVersion(); + mAndroidVersion = update.getAndroidVersion(); mFileSize = update.getFileSize(); } -- GitLab