|
|
@ -662,7 +662,9 @@ 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_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_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_notify_batch_disable, 5, R.string.title_notify_batch_disable);
|
|
|
|
submenu.add(Menu.FIRST, R.string.title_synchronize_more, 6, R.string.title_synchronize_more);
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (folder.account != null && folder.accountProtocol == EntityAccount.TYPE_IMAP)
|
|
|
|
if (folder.account != null && folder.accountProtocol == EntityAccount.TYPE_IMAP)
|
|
|
@ -695,6 +697,12 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
} else if (itemId == R.string.title_notify_batch_disable) {
|
|
|
|
} else if (itemId == R.string.title_notify_batch_disable) {
|
|
|
|
onActionEnableNotify(false);
|
|
|
|
onActionEnableNotify(false);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} else if (itemId == R.string.title_navigation_folder) {
|
|
|
|
|
|
|
|
onActionEnableNavigationMenu(true);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} else if (itemId == R.string.title_navigation_folder_hide) {
|
|
|
|
|
|
|
|
onActionEnableNavigationMenu(false);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.string.title_synchronize_more) {
|
|
|
|
} else if (itemId == R.string.title_synchronize_more) {
|
|
|
|
onActionSyncMore(true);
|
|
|
|
onActionSyncMore(true);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -921,6 +929,42 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|
|
|
}.execute(context, owner, args, "enable");
|
|
|
|
}.execute(context, owner, args, "enable");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void onActionEnableNavigationMenu(boolean enabled) {
|
|
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
|
|
|
args.putLong("id", folder.id);
|
|
|
|
|
|
|
|
args.putBoolean("enabled", enabled);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected Void onExecute(Context context, Bundle args) throws Throwable {
|
|
|
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|
|
|
|
boolean enabled = args.getBoolean("enabled");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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().setFolderNavigation(child.id, enabled);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.setTransactionSuccessful();
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
db.endTransaction();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
|
|
|
Log.unexpectedError(parentFragment.getParentFragmentManager(), ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.execute(context, owner, args, "enable");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onActionSyncMore(boolean children) {
|
|
|
|
private void onActionSyncMore(boolean children) {
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
args.putLong("folder", folder.id);
|
|
|
|
args.putLong("folder", folder.id);
|
|
|
|