Consistency

pull/207/head
M66B 3 years ago
parent 2b5fc81e45
commit 874c1481cd

@ -291,11 +291,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private FloatingActionButton fabMore;
private TextView tvSelectedCount;
private CardView cardMore;
private ImageButton ibLowImportance;
private ImageButton ibHighImportance;
private ImageButton ibBatchSeen;
private ImageButton ibBatchFlag;
private ImageButton ibBatchSnooze;
private ImageButton ibBatchFlag;
private ImageButton ibLowImportance;
private ImageButton ibHighImportance;
private ImageButton ibInbox;
private ImageButton ibArchive;
private ImageButton ibJunk;
@ -567,11 +567,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
fabMore = view.findViewById(R.id.fabMore);
tvSelectedCount = view.findViewById(R.id.tvSelectedCount);
cardMore = view.findViewById(R.id.cardMore);
ibLowImportance = view.findViewById(R.id.ibLowImportance);
ibHighImportance = view.findViewById(R.id.ibHighImportance);
ibBatchSeen = view.findViewById(R.id.ibBatchSeen);
ibBatchFlag = view.findViewById(R.id.ibBatchFlag);
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);
ibArchive = view.findViewById(R.id.ibArchive);
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
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
public void onClick(View v) {
onActionSetImportanceSelection(EntityMessage.PRIORITIY_HIGH, true);
onActionSnoozeSelection();
}
});
ibBatchSeen.setOnClickListener(new View.OnClickListener() {
ibBatchFlag.setOnClickListener(new View.OnClickListener() {
@Override
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
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
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);
int count = 0;
boolean trash = (more_trash && count < MAX_QUICK_ACTIONS && result.canTrash());
if (trash)
count++;
boolean junk = (more_junk && count < MAX_QUICK_ACTIONS && result.canJunk());
if (junk)
count++;
boolean archive = (more_archive && count < MAX_QUICK_ACTIONS && result.canArchive());
if (archive)
count++;
boolean inbox = (more_inbox && count < MAX_QUICK_ACTIONS && result.canInbox());
if (inbox)
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++;
boolean flag = (more_flag && count < MAX_QUICK_ACTIONS && result.unflagged);
if (flag)
count++;
boolean snooze = (more_snooze && count < MAX_QUICK_ACTIONS);
if (snooze)
count++;
boolean seen = (more_seen && count < MAX_QUICK_ACTIONS && result.unseen);
if (seen)
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);
ibBatchFlag.setVisibility(flag ? 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);
ibArchive.setVisibility(archive ? 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 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 cbFlag = dview.findViewById(R.id.cbFlag);
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 cbArchive = dview.findViewById(R.id.cbArchive);
final CheckBox cbJunk = dview.findViewById(R.id.cbJunk);
final CheckBox cbTrash = dview.findViewById(R.id.cbTrash);
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));
cbFlag.setChecked(prefs.getBoolean("more_flag", false));
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));
cbArchive.setChecked(prefs.getBoolean("more_archive", true));
cbJunk.setChecked(prefs.getBoolean("more_junk", true));
@ -10209,11 +10220,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
public void onClick(DialogInterface dialog, int which) {
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_flag", cbFlag.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_archive", cbArchive.isChecked());
editor.putBoolean("more_junk", cbJunk.isChecked());

@ -32,69 +32,69 @@
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
<CheckBox
android:id="@+id/cbImportanceLow"
android:id="@+id/cbSeen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/baseline_arrow_downward_24"
android:drawableEnd="@drawable/twotone_drafts_24"
android:drawablePadding="6dp"
android:text="@string/title_quick_actions_low"
android:text="@string/title_seen"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHint" />
<CheckBox
android:id="@+id/cbImportanceHigh"
android:id="@+id/cbSnooze"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/baseline_arrow_upward_24"
android:drawableEnd="@drawable/twotone_timelapse_24"
android:drawablePadding="6dp"
android:text="@string/title_quick_actions_high"
android:text="@string/title_quick_actions_snooze"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbImportanceLow" />
app:layout_constraintTop_toBottomOf="@id/cbSeen" />
<CheckBox
android:id="@+id/cbSeen"
android:id="@+id/cbFlag"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_drafts_24"
android:drawableEnd="@drawable/twotone_star_24"
android:drawablePadding="6dp"
android:text="@string/title_seen"
android:text="@string/title_flag"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbImportanceHigh" />
app:layout_constraintTop_toBottomOf="@id/cbSnooze" />
<CheckBox
android:id="@+id/cbFlag"
android:id="@+id/cbImportanceLow"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_star_24"
android:drawableEnd="@drawable/baseline_arrow_downward_24"
android:drawablePadding="6dp"
android:text="@string/title_flag"
android:text="@string/title_quick_actions_low"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbSeen" />
app:layout_constraintTop_toBottomOf="@id/cbFlag" />
<CheckBox
android:id="@+id/cbSnooze"
android:id="@+id/cbImportanceHigh"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_timelapse_24"
android:drawableEnd="@drawable/baseline_arrow_upward_24"
android:drawablePadding="6dp"
android:text="@string/title_quick_actions_snooze"
android:text="@string/title_quick_actions_high"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbFlag" />
app:layout_constraintTop_toBottomOf="@id/cbImportanceLow" />
<CheckBox
android:id="@+id/cbInbox"
@ -107,7 +107,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbSnooze" />
app:layout_constraintTop_toBottomOf="@id/cbImportanceHigh" />
<CheckBox
android:id="@+id/cbArchive"

@ -517,78 +517,79 @@
android:paddingEnd="6dp">
<eu.faircode.email.FixedImageButton
android:id="@+id/ibLowImportance"
android:id="@+id/ibBatchSeen"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_importance_low"
android:contentDescription="@string/title_toggle_seen"
android:padding="6dp"
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_importance_low"
android:tooltipText="@string/title_toggle_seen"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/baseline_arrow_downward_24" />
app:srcCompat="@drawable/twotone_drafts_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibHighImportance"
android:id="@+id/ibBatchSnooze"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_importance_high"
android:contentDescription="@string/title_snooze_now"
android:padding="6dp"
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_importance_high"
android:tooltipText="@string/title_snooze_now"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/ibLowImportance"
app:layout_constraintEnd_toStartOf="@+id/ibBatchSeen"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/baseline_arrow_upward_24" />
app:srcCompat="@drawable/twotone_timelapse_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibBatchSeen"
android:id="@+id/ibBatchFlag"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_toggle_seen"
android:contentDescription="@string/title_flag"
android:padding="6dp"
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_toggle_seen"
android:tooltipText="@string/title_flag"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/ibHighImportance"
app:layout_constraintEnd_toStartOf="@+id/ibBatchSnooze"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_drafts_24" />
app:srcCompat="@drawable/twotone_star_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibBatchFlag"
android:id="@+id/ibLowImportance"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_flag"
android:contentDescription="@string/title_importance_low"
android:padding="6dp"
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_flag"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/ibBatchSeen"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_importance_low"
app:layout_constraintEnd_toStartOf="@id/ibBatchFlag"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_star_24" />
app:srcCompat="@drawable/baseline_arrow_downward_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibBatchSnooze"
android:id="@+id/ibHighImportance"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_snooze_now"
android:contentDescription="@string/title_importance_high"
android:padding="6dp"
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_snooze_now"
android:tooltipText="@string/title_importance_high"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/ibBatchFlag"
app:layout_constraintEnd_toStartOf="@+id/ibLowImportance"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_timelapse_24" />
app:srcCompat="@drawable/baseline_arrow_upward_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibInbox"
@ -600,7 +601,7 @@
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_folder_inbox"
app:layout_constraintEnd_toStartOf="@id/ibBatchSnooze"
app:layout_constraintEnd_toStartOf="@id/ibHighImportance"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_inbox_24" />

Loading…
Cancel
Save