]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
collapse profile list and close the drawer when switching profiles
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index f61ebb0ed30124b3daeffd2410e47f1d4f9b8865..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) -> {
@@ -454,7 +458,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();
             }