Small improvements

pull/156/head
M66B 5 years ago
parent c65a771209
commit 6ffc622f19

@ -102,18 +102,18 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, view); PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, view);
if (composable) if (composable)
popupMenu.getMenu().add(Menu.NONE, 1, 1, R.string.title_compose); popupMenu.getMenu().add(Menu.NONE, R.string.title_compose, 1, R.string.title_compose);
popupMenu.getMenu().add(Menu.NONE, 2, 2, R.string.title_answer_hide) popupMenu.getMenu().add(Menu.NONE, R.string.title_answer_hide, 2, R.string.title_answer_hide)
.setCheckable(true).setChecked(answer.hide); .setCheckable(true).setChecked(answer.hide);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case 1: case R.string.title_compose:
onActionCompose(); onActionCompose();
return true; return true;
case 2: case R.string.title_answer_hide:
onActionHide(!item.isChecked()); onActionHide(!item.isChecked());
return true; return true;
default: default:

@ -153,14 +153,14 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, view); PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, view);
popupMenu.getMenu().add(Menu.NONE, 1, 1, R.string.title_synchronize_enabled) popupMenu.getMenu().add(Menu.NONE, R.string.title_synchronize_enabled, 1, R.string.title_synchronize_enabled)
.setCheckable(true).setChecked(identity.synchronize); .setCheckable(true).setChecked(identity.synchronize);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case 1: case R.string.title_synchronize_enabled:
onActionSync(!item.isChecked()); onActionSync(!item.isChecked());
return true; return true;
default: default:

@ -157,14 +157,14 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, view); PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, view);
popupMenu.getMenu().add(Menu.NONE, 1, 1, R.string.title_rule_enabled) popupMenu.getMenu().add(Menu.NONE, R.string.title_rule_enabled, 1, R.string.title_rule_enabled)
.setCheckable(true).setChecked(rule.enabled); .setCheckable(true).setChecked(rule.enabled);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case 1: case R.string.title_rule_enabled:
onActionEnabled(!item.isChecked()); onActionEnabled(!item.isChecked());
return true; return true;
default: default:

Loading…
Cancel
Save