mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 10:35:15 +01:00
Replaced resource ID switches by ifs
This commit is contained in:
@@ -328,26 +328,21 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
||||
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.string.title_enabled:
|
||||
onActionSync(!item.isChecked());
|
||||
return true;
|
||||
|
||||
case R.string.title_primary:
|
||||
onActionPrimary(!item.isChecked());
|
||||
return true;
|
||||
|
||||
case R.string.title_edit_channel:
|
||||
onActionEditChannel();
|
||||
return true;
|
||||
|
||||
case R.string.title_copy:
|
||||
onActionCopy();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.string.title_enabled) {
|
||||
onActionSync(!item.isChecked());
|
||||
return true;
|
||||
} else if (itemId == R.string.title_primary) {
|
||||
onActionPrimary(!item.isChecked());
|
||||
return true;
|
||||
} else if (itemId == R.string.title_edit_channel) {
|
||||
onActionEditChannel();
|
||||
return true;
|
||||
} else if (itemId == R.string.title_copy) {
|
||||
onActionCopy();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void onActionSync(boolean sync) {
|
||||
|
||||
Reference in New Issue
Block a user