From: Damyan Ivanov Date: Sun, 22 Aug 2021 16:52:09 +0000 (+0300) Subject: MainActivity: always refresh shortcuts, even if the list is empty X-Git-Tag: v0.20.0~4 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=54efe16f2d4fd4647bf916e2ecbcbbc23339e296;p=mobile-ledger.git MainActivity: always refresh shortcuts, even if the list is empty --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index de91ca77..e686d96f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -345,7 +345,7 @@ public class MainActivity extends ProfileThemedActivity implements FabManager.Fa mainModel.scheduleTransactionListRetrieval(); } } - private void createShortcuts(List list) { + private void createShortcuts(@NotNull List list) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) return; @@ -377,8 +377,10 @@ public class MainActivity extends ProfileThemedActivity implements FabManager.Fa } sm.setDynamicShortcuts(shortcuts); } - private void onProfileListChanged(List newList) { - if ((newList == null) || newList.isEmpty()) { + private void onProfileListChanged(@NotNull List newList) { + createShortcuts(newList); + + if (newList.isEmpty()) { b.noProfilesLayout.setVisibility(View.VISIBLE); b.mainAppLayout.setVisibility(View.GONE); return; @@ -393,8 +395,6 @@ public class MainActivity extends ProfileThemedActivity implements FabManager.Fa Logger.debug("profiles", "profile list changed"); mProfileListAdapter.setProfileList(newList); - createShortcuts(newList); - final Profile currentProfile = Data.getProfile(); Profile replacementProfile = null; if (currentProfile != null) {