remember the status of showing accounts

This commit is contained in:
luvletter2333 2021-09-20 21:41:25 +08:00
parent 5ca6f284e4
commit b3e16dca87
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,7 @@ public class DrawerLayoutAdapter extends RecyclerListView.SelectionAdapter imple
public DrawerLayoutAdapter(Context context, SideMenultItemAnimator animator) { public DrawerLayoutAdapter(Context context, SideMenultItemAnimator animator) {
mContext = context; mContext = context;
itemAnimator = animator; itemAnimator = animator;
accountsShown = UserConfig.getActivatedAccountsCount() > 1 && MessagesController.getGlobalMainSettings().getBoolean("accountsShown", true); accountsShown = MessagesController.getGlobalMainSettings().getBoolean("accountsShown", true);
Theme.createCommonDialogResources(context); Theme.createCommonDialogResources(context);
resetItems(); resetItems();
try { try {
@ -85,6 +85,7 @@ public class DrawerLayoutAdapter extends RecyclerListView.SelectionAdapter imple
return; return;
} }
accountsShown = value; accountsShown = value;
MessagesController.getGlobalMainSettings().edit().putBoolean("accountsShown", accountsShown).apply();
if (profileCell != null) { if (profileCell != null) {
profileCell.setAccountsShown(accountsShown, animated); profileCell.setAccountsShown(accountsShown, animated);
} }