diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index a8dc0ab196..a352d3c0a3 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -382,69 +382,72 @@ public class AdapterFolder extends RecyclerView.Adapter= Build.VERSION_CODES.O) { - String channelId = EntityFolder.getNotificationChannelId(folder.id); - NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - NotificationChannel channel = nm.getNotificationChannel(channelId); - if (channel == null) - popupMenu.getMenu().add(Menu.NONE, R.string.title_create_channel, 13, R.string.title_create_channel); - else { - popupMenu.getMenu().add(Menu.NONE, R.string.title_edit_channel, 14, R.string.title_edit_channel); - popupMenu.getMenu().add(Menu.NONE, R.string.title_delete_channel, 15, R.string.title_delete_channel); + if (folder.account != null && !folder.accountPop) { + boolean subscriptions = prefs.getBoolean("subscriptions", false); + if (folder.subscribed != null && subscriptions) + popupMenu.getMenu().add(Menu.NONE, R.string.title_subscribe, 9, R.string.title_subscribe) + .setCheckable(true).setChecked(folder.subscribed); + + popupMenu.getMenu().add(Menu.NONE, R.string.title_synchronize_enabled, 10, R.string.title_synchronize_enabled) + .setCheckable(true).setChecked(folder.synchronize); + + if (!folder.read_only) + popupMenu.getMenu().add(Menu.NONE, R.string.title_edit_rules, 11, R.string.title_edit_rules); + popupMenu.getMenu().add(Menu.NONE, R.string.title_edit_properties, 12, R.string.title_edit_properties); + + if (folder.notify && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + String channelId = EntityFolder.getNotificationChannelId(folder.id); + NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + NotificationChannel channel = nm.getNotificationChannel(channelId); + if (channel == null) + popupMenu.getMenu().add(Menu.NONE, R.string.title_create_channel, 13, R.string.title_create_channel); + else { + popupMenu.getMenu().add(Menu.NONE, R.string.title_edit_channel, 14, R.string.title_edit_channel); + popupMenu.getMenu().add(Menu.NONE, R.string.title_delete_channel, 15, R.string.title_delete_channel); + } } } - - popupMenu.getMenu().add(Menu.NONE, R.string.title_create_sub_folder, 15, R.string.title_create_sub_folder); } + if (folder.account != null && !folder.accountPop) + popupMenu.getMenu().add(Menu.NONE, R.string.title_create_sub_folder, 16, R.string.title_create_sub_folder); + popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) {