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
This commit is contained in:
@@ -145,6 +145,12 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport
|
|||||||
} else if (UpdaterController.ACTION_UPDATE_REMOVED.equals(intent.getAction())) {
|
} else if (UpdaterController.ACTION_UPDATE_REMOVED.equals(intent.getAction())) {
|
||||||
String downloadId = intent.getStringExtra(UpdaterController.EXTRA_DOWNLOAD_ID);
|
String downloadId = intent.getStringExtra(UpdaterController.EXTRA_DOWNLOAD_ID);
|
||||||
mAdapter.removeItem(downloadId);
|
mAdapter.removeItem(downloadId);
|
||||||
|
List<UpdateInfo> 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user