From 08d7c928644409544a44a41d21e00d92daec7c8e Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 29 Mar 2019 13:55:04 +0200 Subject: [PATCH] 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 --- .../java/net/ktnx/mobileledger/ui/activity/MainActivity.java | 4 ++++ 1 file changed, 4 insertions(+) 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) -> { -- 2.39.5