don't close sheet after logging out
This commit is contained in:
parent
6fdb81a01f
commit
d37e880993
|
@ -63,6 +63,7 @@ public class AccountSwitcherSheet extends BottomSheet{
|
||||||
private UsableRecyclerView list;
|
private UsableRecyclerView list;
|
||||||
private List<WrappedAccount> accounts;
|
private List<WrappedAccount> accounts;
|
||||||
private ListImageLoaderWrapper imgLoader;
|
private ListImageLoaderWrapper imgLoader;
|
||||||
|
private AccountsAdapter accountsAdapter;
|
||||||
|
|
||||||
public AccountSwitcherSheet(@NonNull Activity activity, @Nullable HomeFragment fragment){
|
public AccountSwitcherSheet(@NonNull Activity activity, @Nullable HomeFragment fragment){
|
||||||
this(activity, fragment, false, false, null);
|
this(activity, fragment, false, false, null);
|
||||||
|
@ -101,7 +102,7 @@ public class AccountSwitcherSheet extends BottomSheet{
|
||||||
setOnDismissListener((d) -> activity.finish());
|
setOnDismissListener((d) -> activity.finish());
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter.addAdapter(new AccountsAdapter());
|
adapter.addAdapter(accountsAdapter = new AccountsAdapter());
|
||||||
|
|
||||||
if (!externalShare) {
|
if (!externalShare) {
|
||||||
adapter.addAdapter(new ClickableSingleViewRecyclerAdapter(makeSimpleListItem(R.string.add_account, R.drawable.ic_fluent_add_24_regular), () -> {
|
adapter.addAdapter(new ClickableSingleViewRecyclerAdapter(makeSimpleListItem(R.string.add_account, R.drawable.ic_fluent_add_24_regular), () -> {
|
||||||
|
@ -201,7 +202,10 @@ public class AccountSwitcherSheet extends BottomSheet{
|
||||||
activity.finish();
|
activity.finish();
|
||||||
activity.startActivity(new Intent(activity, MainActivity.class));
|
activity.startActivity(new Intent(activity, MainActivity.class));
|
||||||
} else {
|
} else {
|
||||||
dismiss();
|
accounts.stream().filter(w -> accountID.equals(w.session.getID())).findAny().ifPresent(w -> {
|
||||||
|
accountsAdapter.notifyItemRemoved(accounts.indexOf(w));
|
||||||
|
accounts.remove(w);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue