Deletable folders

pull/194/merge
M66B 3 years ago
parent 000ac38524
commit 189255f8fe

@ -623,9 +623,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
if (Shortcuts.can(context)) if (Shortcuts.can(context))
popupMenu.getMenu().add(Menu.NONE, R.string.title_pin, order++, R.string.title_pin); popupMenu.getMenu().add(Menu.NONE, R.string.title_pin, order++, R.string.title_pin);
if (!folder.selectable && debug) if (!folder.read_only && EntityFolder.USER.equals(folder.type))
popupMenu.getMenu().add(Menu.NONE, R.string.title_delete, order++, R.string.title_delete) popupMenu.getMenu().add(Menu.NONE, R.string.title_delete, order++, R.string.title_delete);
.setEnabled(folder.inferiors);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override @Override

@ -353,7 +353,9 @@ public class FragmentFolder extends FragmentBase {
btnSave.setEnabled(true); btnSave.setEnabled(true);
tvInboxRootHint.setVisibility(folder == null && parent == null ? View.VISIBLE : View.GONE); tvInboxRootHint.setVisibility(folder == null && parent == null ? View.VISIBLE : View.GONE);
deletable = (folder != null && EntityFolder.USER.equals(folder.type)); deletable = (folder != null &&
!folder.read_only &&
EntityFolder.USER.equals(folder.type));
invalidateOptionsMenu(); invalidateOptionsMenu();
} }

Loading…
Cancel
Save