From: Damyan Ivanov Date: Fri, 29 Mar 2019 11:55:04 +0000 (+0200) Subject: collapse profile list and close the drawer when switching profiles X-Git-Tag: v0.9~35 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=08d7c928644409544a44a41d21e00d92daec7c8e collapse profile list and close the drawer when switching profiles when the profiles use different themes this kind of worked as a side effect of activity restart, but when the profiles use the same theme the drawer remains open making it seem that something didn't work --- 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 80423bf8..e5139b23 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 @@ -183,6 +183,8 @@ public class MainActivity extends ProfileThemedActivity { } else mProfileListAdapter.notifyDataSetChanged(); + collapseProfileList(); + int newProfileTheme = profile.getThemeId(); if (newProfileTheme != Colors.profileThemeId) { Log.d("profiles", String.format("profile theme %d → %d", Colors.profileThemeId, @@ -190,6 +192,8 @@ public class MainActivity extends ProfileThemedActivity { profileThemeChanged(); Colors.profileThemeId = newProfileTheme; } + else + drawer.closeDrawers(); }); }); Data.profiles.addObserver((o, arg) -> {