set checked on basis of fragment's account id

closes sk22#538
This commit is contained in:
sk 2023-05-31 09:42:29 +02:00
parent bb8027c7ef
commit 357104efa9
1 changed files with 6 additions and 1 deletions

View File

@ -279,10 +279,15 @@ public class AccountSwitcherSheet extends BottomSheet{
public void onBind(AccountSession item){
name.setText(item.self.displayName);
username.setText(item.getFullUsername());
view.setChecked(AccountSessionManager.getInstance().getLastActiveAccountID().equals(item.getID()));
radioButton.setVisibility(externalShare ? View.GONE : View.VISIBLE);
extraBtnWrap.setVisibility(externalShare && openInApp ? View.VISIBLE : View.GONE);
if (externalShare) view.setCheckable(false);
else {
String accountId = fragment != null
? fragment.getAccountID()
: AccountSessionManager.getInstance().getLastActiveAccountID();
view.setChecked(accountId.equals(item.getID()));
}
}
@Override