X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Factivity%2FMainActivity.java;h=80423bf8cec97b06d63ce15a3b405316065722c3;hp=86463aac20c22bc34d7f50ec4cec5fc00ee74541;hb=bb5af0ec63f22f43957a9d79347b7ab03a20a3a3;hpb=b0a3715e2675b4b02deb8697f00e747ce95f002b 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 86463aac..80423bf8 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 @@ -169,6 +169,20 @@ public class MainActivity extends ProfileThemedActivity { fab.hide(); } + int old_index = -1; + int new_index = -1; + if (arg != null) { + MobileLedgerProfile old = (MobileLedgerProfile) arg; + old_index = Data.getProfileIndex(old); + new_index = Data.getProfileIndex(profile); + } + + if ((old_index != -1) && (new_index != -1)) { + mProfileListAdapter.notifyItemChanged(old_index); + mProfileListAdapter.notifyItemChanged(new_index); + } + else mProfileListAdapter.notifyDataSetChanged(); + int newProfileTheme = profile.getThemeId(); if (newProfileTheme != Colors.profileThemeId) { Log.d("profiles", String.format("profile theme %d → %d", Colors.profileThemeId, @@ -440,7 +454,8 @@ public class MainActivity extends ProfileThemedActivity { mBackMeansToAccountList = false; } else { - Log.d("fragments", String.format("manager stack: %d", fragmentManager.getBackStackEntryCount())); + Log.d("fragments", String.format("manager stack: %d", + fragmentManager.getBackStackEntryCount())); super.onBackPressed(); }