mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
account switcher: make switching accounts smoother
This commit is contained in:
@@ -573,6 +573,13 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
startActivity(Intent.createChooser(intent, getString(R.string.chat_share_with_title)));
|
||||
}
|
||||
|
||||
public void onProfileSwitched(int profileId) {
|
||||
refreshAvatar();
|
||||
refreshUnreadIndicator();
|
||||
refreshTitle();
|
||||
conversationListFragment.loadChatlist();
|
||||
}
|
||||
|
||||
public void onDeleteProfile(int profileId) {
|
||||
deleteProfileId = profileId;
|
||||
boolean result = ScreenLockUtil.applyScreenLock(this, getString(R.string.delete_account), getString(R.string.enter_system_secret_to_continue), REQUEST_CODE_CONFIRM_CREDENTIALS_DELETE_PROFILE);
|
||||
|
||||
@@ -260,7 +260,7 @@ public class ConversationListFragment extends BaseConversationListFragment
|
||||
});
|
||||
}
|
||||
|
||||
private void loadChatlist() {
|
||||
public void loadChatlist() {
|
||||
int listflags = 0;
|
||||
if (archive) {
|
||||
listflags |= DcContext.DC_GCL_ARCHIVED_ONLY;
|
||||
|
||||
@@ -247,13 +247,13 @@ public class AccountSelectionListFragment extends DialogFragment implements DcEv
|
||||
|
||||
@Override
|
||||
public void onItemClick(AccountSelectionListItem contact) {
|
||||
Activity activity = requireActivity();
|
||||
AccountSelectionListFragment.this.dismiss();
|
||||
int accountId = contact.getAccountId();
|
||||
if (accountId == DC_CONTACT_ID_ADD_ACCOUNT) {
|
||||
AccountManager.getInstance().switchAccountAndStartActivity(activity, 0);
|
||||
} else if (accountId != DcHelper.getAccounts(activity).getSelectedAccount().getAccountId()) {
|
||||
AccountManager.getInstance().switchAccountAndStartActivity(activity, accountId);
|
||||
AccountManager.getInstance().switchAccount(activity, accountId);
|
||||
activity.onProfileSwitched(accountId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user