mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 22:26:06 +02:00
Edit batch set folder color
This commit is contained in:
@@ -1706,13 +1706,27 @@ public class FragmentFolders extends FragmentBase {
|
||||
@Override
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
boolean children = args.getBoolean("children");
|
||||
Integer color = args.getInt("color");
|
||||
|
||||
if (color == Color.TRANSPARENT)
|
||||
color = null;
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
db.folder().setFolderColor(id, color);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
if (children)
|
||||
for (EntityFolder folder : EntityFolder.getChildFolders(context, id))
|
||||
db.folder().setFolderColor(folder.id, color);
|
||||
else
|
||||
db.folder().setFolderColor(id, color);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user