]> git.ktnx.net Git - mobile-ledger.git/commitdiff
collapse profile list and close the drawer when switching profiles
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 29 Mar 2019 11:55:04 +0000 (13:55 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 29 Mar 2019 11:56:05 +0000 (13:56 +0200)
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

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 80423bf8cec97b06d63ce15a3b405316065722c3..e5139b236168f57136cd59d05f72d04a238c1713 100644 (file)
@@ -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) -> {