Default star color multiple selection

pull/217/head
M66B 9 months ago
parent 3aafbcfd5c
commit 97f4c4acf1

@ -1702,7 +1702,8 @@ public class FragmentMessages extends FragmentBase
@Override @Override
public void onClick(View v) { public void onClick(View v) {
boolean more_clear = prefs.getBoolean("more_clear", true); boolean more_clear = prefs.getBoolean("more_clear", true);
onActionFlagColorSelection(more_clear); MoreResult result = (MoreResult) cardMore.getTag();
onActionFlagColorSelection(more_clear, result == null ? Color.TRANSPARENT : result.color);
} }
}); });
@ -4728,7 +4729,7 @@ public class FragmentMessages extends FragmentBase
onActionFlagSelection(false, Color.TRANSPARENT, null, false); onActionFlagSelection(false, Color.TRANSPARENT, null, false);
return true; return true;
} else if (itemId == R.string.title_flag_color) { } else if (itemId == R.string.title_flag_color) {
onActionFlagColorSelection(false); onActionFlagColorSelection(false, result == null ? Color.TRANSPARENT : result.color);
return true; return true;
} else if (itemId == R.string.title_importance_low) { } else if (itemId == R.string.title_importance_low) {
onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW, null, false); onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW, null, false);
@ -4981,9 +4982,9 @@ public class FragmentMessages extends FragmentBase
}.execute(this, args, "messages:flag"); }.execute(this, args, "messages:flag");
} }
private void onActionFlagColorSelection(boolean clear) { private void onActionFlagColorSelection(boolean clear, Integer color) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt("color", Color.TRANSPARENT); args.putInt("color", color);
args.putString("title", getString(R.string.title_flag_color)); args.putString("title", getString(R.string.title_flag_color));
args.putBoolean("reset", true); args.putBoolean("reset", true);
args.putBoolean("clear", clear); args.putBoolean("clear", clear);
@ -11585,6 +11586,7 @@ public class FragmentMessages extends FragmentBase
boolean visible; boolean visible;
boolean hidden; boolean hidden;
boolean flagged; boolean flagged;
Integer color;
boolean unflagged; boolean unflagged;
Integer importance; Integer importance;
Boolean hasInbox; Boolean hasInbox;
@ -11726,8 +11728,14 @@ public class FragmentMessages extends FragmentBase
if (!threaded.ui_seen) if (!threaded.ui_seen)
result.unseen = true; result.unseen = true;
if (threaded.ui_flagged) if (threaded.ui_flagged) {
result.flagged = true; result.flagged = true;
if (threaded.color != null)
if (result.color == null)
result.color = threaded.color;
else if (!result.color.equals(threaded.color))
result.color = Color.TRANSPARENT;
}
int i = (message.importance == null ? EntityMessage.PRIORITIY_NORMAL : message.importance); int i = (message.importance == null ? EntityMessage.PRIORITIY_NORMAL : message.importance);
if (result.importance == null) if (result.importance == null)

Loading…
Cancel
Save