|
|
|
@ -675,6 +675,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_synchronize_batch_disable, 3, R.string.title_synchronize_batch_disable);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_notify_batch_enable, 4, R.string.title_notify_batch_enable);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_notify_batch_disable, 5, R.string.title_notify_batch_disable);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_unified_inbox_add, 6, R.string.title_unified_inbox_add);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_unified_inbox_delete, 7, R.string.title_unified_inbox_delete);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_navigation_folder, 6, R.string.title_navigation_folder);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_navigation_folder_hide, 7, R.string.title_navigation_folder_hide);
|
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_synchronize_more, 8, R.string.title_synchronize_more);
|
|
|
|
@ -710,6 +712,12 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
|
} else if (itemId == R.string.title_notify_batch_disable) {
|
|
|
|
|
onActionEnableNotify(false);
|
|
|
|
|
return true;
|
|
|
|
|
} else if (itemId == R.string.title_unified_inbox_add) {
|
|
|
|
|
onActionUnifiedInbox(true);
|
|
|
|
|
return true;
|
|
|
|
|
} else if (itemId == R.string.title_unified_inbox_delete) {
|
|
|
|
|
onActionUnifiedInbox(false);
|
|
|
|
|
return true;
|
|
|
|
|
} else if (itemId == R.string.title_navigation_folder) {
|
|
|
|
|
onActionEnableNavigationMenu(true);
|
|
|
|
|
return true;
|
|
|
|
@ -945,6 +953,42 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
|
}.execute(context, owner, args, "enable");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void onActionUnifiedInbox(boolean add) {
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putLong("id", folder.id);
|
|
|
|
|
args.putBoolean("add", add);
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|
boolean add = args.getBoolean("add");
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
try {
|
|
|
|
|
db.beginTransaction();
|
|
|
|
|
List<EntityFolder> childs = db.folder().getChildFolders(id);
|
|
|
|
|
if (childs == null)
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
for (EntityFolder child : childs)
|
|
|
|
|
db.folder().setFolderUnified(child.id, add);
|
|
|
|
|
|
|
|
|
|
db.setTransactionSuccessful();
|
|
|
|
|
} finally {
|
|
|
|
|
db.endTransaction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
Log.unexpectedError(parentFragment.getParentFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
|
}.execute(context, owner, args, "unified");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void onActionEnableNavigationMenu(boolean enabled) {
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putLong("id", folder.id);
|
|
|
|
|