Added setings menu item for account start screen

pull/215/head
M66B 7 months ago
parent 72d26f1752
commit df058782ba

@ -520,6 +520,9 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
popupMenu.getMenu().add(Menu.NONE, R.string.title_log, order++, R.string.title_log); popupMenu.getMenu().add(Menu.NONE, R.string.title_log, order++, R.string.title_log);
} }
if (!settings)
popupMenu.getMenu().add(Menu.NONE, R.string.menu_setup, order++, R.string.menu_setup);
if (debug || BuildConfig.DEBUG) { if (debug || BuildConfig.DEBUG) {
popupMenu.getMenu().add(Menu.NONE, R.string.title_reset, order++, R.string.title_reset); popupMenu.getMenu().add(Menu.NONE, R.string.title_reset, order++, R.string.title_reset);
popupMenu.getMenu().add(Menu.NONE, R.string.title_setup_oauth_authorize, order++, R.string.title_setup_oauth_authorize); popupMenu.getMenu().add(Menu.NONE, R.string.title_setup_oauth_authorize, order++, R.string.title_setup_oauth_authorize);
@ -565,6 +568,9 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
} else if (itemId == R.string.title_log) { } else if (itemId == R.string.title_log) {
onActionLog(); onActionLog();
return true; return true;
} else if (itemId == R.string.menu_setup) {
onActionSettings();
return true;
} else if (itemId == R.string.title_reset) { } else if (itemId == R.string.title_reset) {
onActionReset(); onActionReset();
return true; return true;
@ -813,6 +819,14 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
private void onActionSettings() {
context.startActivity(new Intent(context, ActivitySetup.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)
.putExtra("target", "accounts")
.putExtra("id", account.id)
.putExtra("protocol", account.protocol));
}
private void onActionReset() { private void onActionReset() {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong("id", account.id); args.putLong("id", account.id);

Loading…
Cancel
Save