|
|
@ -291,6 +291,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
private FloatingActionButton fabMore;
|
|
|
|
private FloatingActionButton fabMore;
|
|
|
|
private TextView tvSelectedCount;
|
|
|
|
private TextView tvSelectedCount;
|
|
|
|
private CardView cardMore;
|
|
|
|
private CardView cardMore;
|
|
|
|
|
|
|
|
private ImageButton ibLowImportance;
|
|
|
|
private ImageButton ibBatchSeen;
|
|
|
|
private ImageButton ibBatchSeen;
|
|
|
|
private ImageButton ibInbox;
|
|
|
|
private ImageButton ibInbox;
|
|
|
|
private ImageButton ibArchive;
|
|
|
|
private ImageButton ibArchive;
|
|
|
@ -560,6 +561,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
fabMore = view.findViewById(R.id.fabMore);
|
|
|
|
fabMore = view.findViewById(R.id.fabMore);
|
|
|
|
tvSelectedCount = view.findViewById(R.id.tvSelectedCount);
|
|
|
|
tvSelectedCount = view.findViewById(R.id.tvSelectedCount);
|
|
|
|
cardMore = view.findViewById(R.id.cardMore);
|
|
|
|
cardMore = view.findViewById(R.id.cardMore);
|
|
|
|
|
|
|
|
ibLowImportance = view.findViewById(R.id.ibLowImportance);
|
|
|
|
ibBatchSeen = view.findViewById(R.id.ibBatchSeen);
|
|
|
|
ibBatchSeen = view.findViewById(R.id.ibBatchSeen);
|
|
|
|
ibInbox = view.findViewById(R.id.ibInbox);
|
|
|
|
ibInbox = view.findViewById(R.id.ibInbox);
|
|
|
|
ibArchive = view.findViewById(R.id.ibArchive);
|
|
|
|
ibArchive = view.findViewById(R.id.ibArchive);
|
|
|
@ -1291,6 +1293,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ibLowImportance.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibBatchSeen.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibBatchSeen.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
@ -3393,13 +3402,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
onActionFlagColorSelection();
|
|
|
|
onActionFlagColorSelection();
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.string.title_importance_low) {
|
|
|
|
} else if (itemId == R.string.title_importance_low) {
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW);
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW, false);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.string.title_importance_normal) {
|
|
|
|
} else if (itemId == R.string.title_importance_normal) {
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_NORMAL);
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_NORMAL, false);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.string.title_importance_high) {
|
|
|
|
} else if (itemId == R.string.title_importance_high) {
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_HIGH);
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_HIGH, false);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.string.title_raw_send) {
|
|
|
|
} else if (itemId == R.string.title_raw_send) {
|
|
|
|
onActionRaw();
|
|
|
|
onActionRaw();
|
|
|
@ -3670,11 +3679,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
fragment.show(getParentFragmentManager(), "messages:color");
|
|
|
|
fragment.show(getParentFragmentManager(), "messages:color");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onActionSetImportanceSelection(int importance) {
|
|
|
|
private void onActionSetImportanceSelection(int importance, boolean clear) {
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
args.putLongArray("selected", getSelection());
|
|
|
|
args.putLongArray("selected", getSelection());
|
|
|
|
args.putInt("importance", importance);
|
|
|
|
args.putInt("importance", importance);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (clear && selectionTracker != null)
|
|
|
|
|
|
|
|
selectionTracker.clearSelection();
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
new SimpleTask<Void>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
|
protected Void onExecute(Context context, Bundle args) {
|
|
|
@ -5748,13 +5760,17 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, MoreResult result) {
|
|
|
|
protected void onExecuted(Bundle args, MoreResult result) {
|
|
|
|
|
|
|
|
boolean importance = (BuildConfig.DEBUG &&
|
|
|
|
|
|
|
|
!EntityMessage.PRIORITIY_LOW.equals(result.importance));
|
|
|
|
|
|
|
|
ibLowImportance.setVisibility(importance ? View.VISIBLE : View.GONE);
|
|
|
|
ibBatchSeen.setVisibility(result.unseen ? View.VISIBLE : View.GONE);
|
|
|
|
ibBatchSeen.setVisibility(result.unseen ? View.VISIBLE : View.GONE);
|
|
|
|
ibInbox.setVisibility(result.canInbox() ? View.VISIBLE : View.GONE);
|
|
|
|
ibInbox.setVisibility(result.canInbox() ? View.VISIBLE : View.GONE);
|
|
|
|
ibArchive.setVisibility(result.canArchive() ? View.VISIBLE : View.GONE);
|
|
|
|
ibArchive.setVisibility(result.canArchive() ? View.VISIBLE : View.GONE);
|
|
|
|
ibJunk.setVisibility(result.canJunk() ? View.VISIBLE : View.GONE);
|
|
|
|
ibJunk.setVisibility(result.canJunk() ? View.VISIBLE : View.GONE);
|
|
|
|
ibTrash.setVisibility(result.canTrash() ? View.VISIBLE : View.GONE);
|
|
|
|
ibTrash.setVisibility(result.canTrash() ? View.VISIBLE : View.GONE);
|
|
|
|
cardMore.setVisibility(fabMore.isOrWillBeShown() &&
|
|
|
|
cardMore.setVisibility(fabMore.isOrWillBeShown() &&
|
|
|
|
(result.unseen ||
|
|
|
|
(importance ||
|
|
|
|
|
|
|
|
result.unseen ||
|
|
|
|
result.canInbox() ||
|
|
|
|
result.canInbox() ||
|
|
|
|
result.canArchive() ||
|
|
|
|
result.canArchive() ||
|
|
|
|
result.canJunk() ||
|
|
|
|
result.canJunk() ||
|
|
|
|