|
|
@ -291,11 +291,11 @@ 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 ibHighImportance;
|
|
|
|
|
|
|
|
private ImageButton ibBatchSeen;
|
|
|
|
private ImageButton ibBatchSeen;
|
|
|
|
private ImageButton ibBatchFlag;
|
|
|
|
|
|
|
|
private ImageButton ibBatchSnooze;
|
|
|
|
private ImageButton ibBatchSnooze;
|
|
|
|
|
|
|
|
private ImageButton ibBatchFlag;
|
|
|
|
|
|
|
|
private ImageButton ibLowImportance;
|
|
|
|
|
|
|
|
private ImageButton ibHighImportance;
|
|
|
|
private ImageButton ibInbox;
|
|
|
|
private ImageButton ibInbox;
|
|
|
|
private ImageButton ibArchive;
|
|
|
|
private ImageButton ibArchive;
|
|
|
|
private ImageButton ibJunk;
|
|
|
|
private ImageButton ibJunk;
|
|
|
@ -567,11 +567,11 @@ 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);
|
|
|
|
|
|
|
|
ibHighImportance = view.findViewById(R.id.ibHighImportance);
|
|
|
|
|
|
|
|
ibBatchSeen = view.findViewById(R.id.ibBatchSeen);
|
|
|
|
ibBatchSeen = view.findViewById(R.id.ibBatchSeen);
|
|
|
|
ibBatchFlag = view.findViewById(R.id.ibBatchFlag);
|
|
|
|
|
|
|
|
ibBatchSnooze = view.findViewById(R.id.ibBatchSnooze);
|
|
|
|
ibBatchSnooze = view.findViewById(R.id.ibBatchSnooze);
|
|
|
|
|
|
|
|
ibBatchFlag = view.findViewById(R.id.ibBatchFlag);
|
|
|
|
|
|
|
|
ibLowImportance = view.findViewById(R.id.ibLowImportance);
|
|
|
|
|
|
|
|
ibHighImportance = view.findViewById(R.id.ibHighImportance);
|
|
|
|
ibInbox = view.findViewById(R.id.ibInbox);
|
|
|
|
ibInbox = view.findViewById(R.id.ibInbox);
|
|
|
|
ibArchive = view.findViewById(R.id.ibArchive);
|
|
|
|
ibArchive = view.findViewById(R.id.ibArchive);
|
|
|
|
ibJunk = view.findViewById(R.id.ibJunk);
|
|
|
|
ibJunk = view.findViewById(R.id.ibJunk);
|
|
|
@ -1303,38 +1303,38 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibLowImportance.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibBatchSeen.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW, true);
|
|
|
|
onActionSeenSelection(true, null, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibHighImportance.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibBatchSnooze.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_HIGH, true);
|
|
|
|
onActionSnoozeSelection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibBatchSeen.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibBatchFlag.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
onActionSeenSelection(true, null, true);
|
|
|
|
onActionFlagSelection(true, Color.TRANSPARENT, null, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibBatchFlag.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibLowImportance.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
onActionFlagSelection(true, Color.TRANSPARENT, null, true);
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_LOW, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ibBatchSnooze.setOnClickListener(new View.OnClickListener() {
|
|
|
|
ibHighImportance.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
onActionSnoozeSelection();
|
|
|
|
onActionSetImportanceSelection(EntityMessage.PRIORITIY_HIGH, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -5812,39 +5812,50 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
boolean more_importance_low = prefs.getBoolean("more_importance_low", true);
|
|
|
|
boolean more_importance_low = prefs.getBoolean("more_importance_low", true);
|
|
|
|
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
boolean trash = (more_trash && count < MAX_QUICK_ACTIONS && result.canTrash());
|
|
|
|
boolean trash = (more_trash && count < MAX_QUICK_ACTIONS && result.canTrash());
|
|
|
|
if (trash)
|
|
|
|
if (trash)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
boolean junk = (more_junk && count < MAX_QUICK_ACTIONS && result.canJunk());
|
|
|
|
boolean junk = (more_junk && count < MAX_QUICK_ACTIONS && result.canJunk());
|
|
|
|
if (junk)
|
|
|
|
if (junk)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
boolean archive = (more_archive && count < MAX_QUICK_ACTIONS && result.canArchive());
|
|
|
|
boolean archive = (more_archive && count < MAX_QUICK_ACTIONS && result.canArchive());
|
|
|
|
if (archive)
|
|
|
|
if (archive)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
boolean inbox = (more_inbox && count < MAX_QUICK_ACTIONS && result.canInbox());
|
|
|
|
boolean inbox = (more_inbox && count < MAX_QUICK_ACTIONS && result.canInbox());
|
|
|
|
if (inbox)
|
|
|
|
if (inbox)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
boolean snooze = (more_snooze && count < MAX_QUICK_ACTIONS);
|
|
|
|
|
|
|
|
if (snooze)
|
|
|
|
boolean importance_high = (more_importance_high && count < MAX_QUICK_ACTIONS &&
|
|
|
|
|
|
|
|
!EntityMessage.PRIORITIY_HIGH.equals(result.importance));
|
|
|
|
|
|
|
|
if (importance_high)
|
|
|
|
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean importance_low = (more_importance_low && count < MAX_QUICK_ACTIONS &&
|
|
|
|
|
|
|
|
!EntityMessage.PRIORITIY_LOW.equals(result.importance));
|
|
|
|
|
|
|
|
if (importance_low)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
boolean flag = (more_flag && count < MAX_QUICK_ACTIONS && result.unflagged);
|
|
|
|
boolean flag = (more_flag && count < MAX_QUICK_ACTIONS && result.unflagged);
|
|
|
|
if (flag)
|
|
|
|
if (flag)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean snooze = (more_snooze && count < MAX_QUICK_ACTIONS);
|
|
|
|
|
|
|
|
if (snooze)
|
|
|
|
|
|
|
|
count++;
|
|
|
|
|
|
|
|
|
|
|
|
boolean seen = (more_seen && count < MAX_QUICK_ACTIONS && result.unseen);
|
|
|
|
boolean seen = (more_seen && count < MAX_QUICK_ACTIONS && result.unseen);
|
|
|
|
if (seen)
|
|
|
|
if (seen)
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
boolean importance_high = (more_importance_high && count < MAX_QUICK_ACTIONS &&
|
|
|
|
|
|
|
|
!EntityMessage.PRIORITIY_HIGH.equals(result.importance));
|
|
|
|
|
|
|
|
if (importance_high)
|
|
|
|
|
|
|
|
count++;
|
|
|
|
|
|
|
|
boolean importance_low = (more_importance_low && count < MAX_QUICK_ACTIONS &&
|
|
|
|
|
|
|
|
!EntityMessage.PRIORITIY_LOW.equals(result.importance));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ibLowImportance.setVisibility(importance_low ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibHighImportance.setVisibility(importance_high ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibBatchSeen.setVisibility(seen ? View.VISIBLE : View.GONE);
|
|
|
|
ibBatchSeen.setVisibility(seen ? View.VISIBLE : View.GONE);
|
|
|
|
ibBatchFlag.setVisibility(flag ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibBatchSnooze.setVisibility(snooze ? View.VISIBLE : View.GONE);
|
|
|
|
ibBatchSnooze.setVisibility(snooze ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibBatchFlag.setVisibility(flag ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibLowImportance.setVisibility(importance_low ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibHighImportance.setVisibility(importance_high ? View.VISIBLE : View.GONE);
|
|
|
|
ibInbox.setVisibility(inbox ? View.VISIBLE : View.GONE);
|
|
|
|
ibInbox.setVisibility(inbox ? View.VISIBLE : View.GONE);
|
|
|
|
ibArchive.setVisibility(archive ? View.VISIBLE : View.GONE);
|
|
|
|
ibArchive.setVisibility(archive ? View.VISIBLE : View.GONE);
|
|
|
|
ibJunk.setVisibility(junk ? View.VISIBLE : View.GONE);
|
|
|
|
ibJunk.setVisibility(junk ? View.VISIBLE : View.GONE);
|
|
|
@ -10182,22 +10193,22 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
|
|
|
|
|
|
|
final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_quick_actions, null);
|
|
|
|
final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_quick_actions, null);
|
|
|
|
final TextView tvHint = dview.findViewById(R.id.tvHint);
|
|
|
|
final TextView tvHint = dview.findViewById(R.id.tvHint);
|
|
|
|
final CheckBox cbImportanceLow = dview.findViewById(R.id.cbImportanceLow);
|
|
|
|
|
|
|
|
final CheckBox cbImportanceHigh = dview.findViewById(R.id.cbImportanceHigh);
|
|
|
|
|
|
|
|
final CheckBox cbSeen = dview.findViewById(R.id.cbSeen);
|
|
|
|
final CheckBox cbSeen = dview.findViewById(R.id.cbSeen);
|
|
|
|
final CheckBox cbFlag = dview.findViewById(R.id.cbFlag);
|
|
|
|
|
|
|
|
final CheckBox cbSnooze = dview.findViewById(R.id.cbSnooze);
|
|
|
|
final CheckBox cbSnooze = dview.findViewById(R.id.cbSnooze);
|
|
|
|
|
|
|
|
final CheckBox cbFlag = dview.findViewById(R.id.cbFlag);
|
|
|
|
|
|
|
|
final CheckBox cbImportanceLow = dview.findViewById(R.id.cbImportanceLow);
|
|
|
|
|
|
|
|
final CheckBox cbImportanceHigh = dview.findViewById(R.id.cbImportanceHigh);
|
|
|
|
final CheckBox cbInbox = dview.findViewById(R.id.cbInbox);
|
|
|
|
final CheckBox cbInbox = dview.findViewById(R.id.cbInbox);
|
|
|
|
final CheckBox cbArchive = dview.findViewById(R.id.cbArchive);
|
|
|
|
final CheckBox cbArchive = dview.findViewById(R.id.cbArchive);
|
|
|
|
final CheckBox cbJunk = dview.findViewById(R.id.cbJunk);
|
|
|
|
final CheckBox cbJunk = dview.findViewById(R.id.cbJunk);
|
|
|
|
final CheckBox cbTrash = dview.findViewById(R.id.cbTrash);
|
|
|
|
final CheckBox cbTrash = dview.findViewById(R.id.cbTrash);
|
|
|
|
|
|
|
|
|
|
|
|
tvHint.setText(getString(R.string.title_quick_actions_hint, MAX_QUICK_ACTIONS));
|
|
|
|
tvHint.setText(getString(R.string.title_quick_actions_hint, MAX_QUICK_ACTIONS));
|
|
|
|
cbImportanceLow.setChecked(prefs.getBoolean("more_importance_low", false));
|
|
|
|
|
|
|
|
cbImportanceHigh.setChecked(prefs.getBoolean("more_importance_high", false));
|
|
|
|
|
|
|
|
cbSeen.setChecked(prefs.getBoolean("more_seen", false));
|
|
|
|
cbSeen.setChecked(prefs.getBoolean("more_seen", false));
|
|
|
|
cbFlag.setChecked(prefs.getBoolean("more_flag", false));
|
|
|
|
|
|
|
|
cbSnooze.setChecked(prefs.getBoolean("more_snooze", true));
|
|
|
|
cbSnooze.setChecked(prefs.getBoolean("more_snooze", true));
|
|
|
|
|
|
|
|
cbFlag.setChecked(prefs.getBoolean("more_flag", false));
|
|
|
|
|
|
|
|
cbImportanceLow.setChecked(prefs.getBoolean("more_importance_low", false));
|
|
|
|
|
|
|
|
cbImportanceHigh.setChecked(prefs.getBoolean("more_importance_high", false));
|
|
|
|
cbInbox.setChecked(prefs.getBoolean("more_inbox", true));
|
|
|
|
cbInbox.setChecked(prefs.getBoolean("more_inbox", true));
|
|
|
|
cbArchive.setChecked(prefs.getBoolean("more_archive", true));
|
|
|
|
cbArchive.setChecked(prefs.getBoolean("more_archive", true));
|
|
|
|
cbJunk.setChecked(prefs.getBoolean("more_junk", true));
|
|
|
|
cbJunk.setChecked(prefs.getBoolean("more_junk", true));
|
|
|
@ -10209,11 +10220,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
SharedPreferences.Editor editor = prefs.edit();
|
|
|
|
SharedPreferences.Editor editor = prefs.edit();
|
|
|
|
editor.putBoolean("more_importance_low", cbImportanceLow.isChecked());
|
|
|
|
|
|
|
|
editor.putBoolean("more_importance_high", cbImportanceHigh.isChecked());
|
|
|
|
|
|
|
|
editor.putBoolean("more_seen", cbSeen.isChecked());
|
|
|
|
editor.putBoolean("more_seen", cbSeen.isChecked());
|
|
|
|
editor.putBoolean("more_flag", cbFlag.isChecked());
|
|
|
|
|
|
|
|
editor.putBoolean("more_snooze", cbSnooze.isChecked());
|
|
|
|
editor.putBoolean("more_snooze", cbSnooze.isChecked());
|
|
|
|
|
|
|
|
editor.putBoolean("more_flag", cbFlag.isChecked());
|
|
|
|
|
|
|
|
editor.putBoolean("more_importance_low", cbImportanceLow.isChecked());
|
|
|
|
|
|
|
|
editor.putBoolean("more_importance_high", cbImportanceHigh.isChecked());
|
|
|
|
editor.putBoolean("more_inbox", cbInbox.isChecked());
|
|
|
|
editor.putBoolean("more_inbox", cbInbox.isChecked());
|
|
|
|
editor.putBoolean("more_archive", cbArchive.isChecked());
|
|
|
|
editor.putBoolean("more_archive", cbArchive.isChecked());
|
|
|
|
editor.putBoolean("more_junk", cbJunk.isChecked());
|
|
|
|
editor.putBoolean("more_junk", cbJunk.isChecked());
|
|
|
|