mirror of https://github.com/M66B/FairEmail.git
Edit filters nav menu shortcut
This commit is contained in:
parent
3cef6d058e
commit
bf74c49353
|
@ -1785,10 +1785,38 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onMenuRulesAccount() {
|
private void onMenuRulesAccount() {
|
||||||
|
new SimpleTask<EntityAccount>() {
|
||||||
|
@Override
|
||||||
|
protected EntityAccount onExecute(Context context, Bundle args) {
|
||||||
|
DB db = DB.getInstance(context);
|
||||||
|
|
||||||
|
List<EntityAccount> accounts = db.account().getSynchronizingAccounts(EntityAccount.TYPE_IMAP);
|
||||||
|
if (accounts != null && accounts.size() == 1)
|
||||||
|
return accounts.get(0);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onExecuted(Bundle args, EntityAccount account) {
|
||||||
|
if (account == null) {
|
||||||
FragmentDialogSelectAccount fragment = new FragmentDialogSelectAccount();
|
FragmentDialogSelectAccount fragment = new FragmentDialogSelectAccount();
|
||||||
fragment.setArguments(new Bundle());
|
fragment.setArguments(new Bundle());
|
||||||
fragment.setTargetActivity(this, REQUEST_RULES_ACCOUNT);
|
fragment.setTargetActivity(ActivityView.this, REQUEST_RULES_ACCOUNT);
|
||||||
fragment.show(getSupportFragmentManager(), "rules:account");
|
fragment.show(getSupportFragmentManager(), "rules:account");
|
||||||
|
} else {
|
||||||
|
args.putLong("account", account.id);
|
||||||
|
args.putInt("protocol", account.protocol);
|
||||||
|
args.putString("name", account.name);
|
||||||
|
onMenuRulesFolder(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onException(Bundle args, Throwable ex) {
|
||||||
|
Log.unexpectedError(getSupportFragmentManager(), ex);
|
||||||
|
}
|
||||||
|
}.execute(this, new Bundle(), "rules:account");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onMenuRulesFolder(Bundle args) {
|
private void onMenuRulesFolder(Bundle args) {
|
||||||
|
|
Loading…
Reference in New Issue