From 5ab3076f91dcbafb5e9177d6c58364501da9d94a Mon Sep 17 00:00:00 2001 From: Michael W Date: Sat, 11 Jan 2025 16:36:45 +0100 Subject: [PATCH] Updater: Show "no items" view after deleting last update Currently after removing the last update from the list, you end up with a completely empty list. It should look like when you open the app again with no updates Change-Id: I77f025baf2e20385d31b5e897b92ddf24680be99 --- .../main/java/org/lineageos/updater/UpdatesActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/lineageos/updater/UpdatesActivity.java b/app/src/main/java/org/lineageos/updater/UpdatesActivity.java index c800e084..e75ec9d9 100644 --- a/app/src/main/java/org/lineageos/updater/UpdatesActivity.java +++ b/app/src/main/java/org/lineageos/updater/UpdatesActivity.java @@ -145,6 +145,12 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport } else if (UpdaterController.ACTION_UPDATE_REMOVED.equals(intent.getAction())) { String downloadId = intent.getStringExtra(UpdaterController.EXTRA_DOWNLOAD_ID); mAdapter.removeItem(downloadId); + List sortedUpdates = + mUpdaterService.getUpdaterController().getUpdates(); + if (sortedUpdates.isEmpty()) { + findViewById(R.id.no_new_updates_view).setVisibility(View.VISIBLE); + findViewById(R.id.recycler_view).setVisibility(View.GONE); + } } } };