mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-26 07:53:12 +00:00
Show importance with upward/downward arrow
This commit is contained in:
parent
83bbac256e
commit
d06c4c6fc0
6 changed files with 71 additions and 8 deletions
|
@ -304,6 +304,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
private ImageButton ibAuth;
|
||||
private ImageView ivPriorityHigh;
|
||||
private ImageView ivPriorityLow;
|
||||
private ImageView ivImportance;
|
||||
private ImageView ivSigned;
|
||||
private ImageView ivEncrypted;
|
||||
private TextView tvFrom;
|
||||
|
@ -437,6 +438,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibAuth = itemView.findViewById(R.id.ibAuth);
|
||||
ivPriorityHigh = itemView.findViewById(R.id.ivPriorityHigh);
|
||||
ivPriorityLow = itemView.findViewById(R.id.ivPriorityLow);
|
||||
ivImportance = itemView.findViewById(R.id.ivImportance);
|
||||
ivSigned = itemView.findViewById(R.id.ivSigned);
|
||||
ivEncrypted = itemView.findViewById(R.id.ivEncrypted);
|
||||
tvFrom = itemView.findViewById(subject_top ? R.id.tvSubject : R.id.tvFrom);
|
||||
|
@ -742,6 +744,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibAuth.setVisibility(View.GONE);
|
||||
ivPriorityHigh.setVisibility(View.GONE);
|
||||
ivPriorityLow.setVisibility(View.GONE);
|
||||
ivImportance.setVisibility(View.GONE);
|
||||
ivSigned.setVisibility(View.GONE);
|
||||
ivEncrypted.setVisibility(View.GONE);
|
||||
tvFrom.setText(null);
|
||||
|
@ -777,7 +780,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
Boolean.FALSE.equals(message.dmarc) ||
|
||||
Boolean.FALSE.equals(message.mx));
|
||||
boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id));
|
||||
Integer priority = (message.ui_importance == null ? message.ui_priority : message.ui_importance);
|
||||
|
||||
// Text size
|
||||
if (textSize != 0) {
|
||||
|
@ -814,6 +816,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibAuth.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
ivPriorityHigh.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
ivPriorityLow.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
ivImportance.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
ivSigned.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
ivEncrypted.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
tvFrom.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
|
||||
|
@ -880,8 +883,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
// Line 1
|
||||
ibAuth.setVisibility(authentication && !authenticated ? View.VISIBLE : View.GONE);
|
||||
ivPriorityHigh.setVisibility(EntityMessage.PRIORITIY_HIGH.equals(priority) ? View.VISIBLE : View.GONE);
|
||||
ivPriorityLow.setVisibility(EntityMessage.PRIORITIY_LOW.equals(priority) ? View.VISIBLE : View.GONE);
|
||||
ivPriorityHigh.setVisibility(
|
||||
EntityMessage.PRIORITIY_HIGH.equals(message.ui_priority)
|
||||
? View.VISIBLE : View.GONE);
|
||||
ivPriorityLow.setVisibility(
|
||||
EntityMessage.PRIORITIY_LOW.equals(message.ui_priority)
|
||||
? View.VISIBLE : View.GONE);
|
||||
ivImportance.setImageLevel(
|
||||
EntityMessage.PRIORITIY_HIGH.equals(message.ui_importance) ? 0 : 1);
|
||||
ivImportance.setVisibility(
|
||||
EntityMessage.PRIORITIY_LOW.equals(message.ui_importance) ||
|
||||
EntityMessage.PRIORITIY_HIGH.equals(message.ui_importance)
|
||||
? View.VISIBLE : View.GONE);
|
||||
ivSigned.setVisibility(message.signed > 0 ? View.VISIBLE : View.GONE);
|
||||
ivEncrypted.setVisibility(message.encrypted > 0 ? View.VISIBLE : View.GONE);
|
||||
tvFrom.setText(MessageHelper.formatAddresses(addresses, name_email, false));
|
||||
|
@ -3969,10 +3982,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
result.add(context.getString(R.string.title_accessibility_flagged));
|
||||
}
|
||||
|
||||
Integer priority = (message.ui_importance == null ? message.ui_priority : message.ui_importance);
|
||||
if (EntityMessage.PRIORITIY_HIGH.equals(priority))
|
||||
if (EntityMessage.PRIORITIY_HIGH.equals(message.ui_priority))
|
||||
result.add(context.getString(R.string.title_legend_priority));
|
||||
else if (EntityMessage.PRIORITIY_LOW.equals(priority))
|
||||
else if (EntityMessage.PRIORITIY_LOW.equals(message.ui_priority))
|
||||
result.add(context.getString(R.string.title_legend_priority_low));
|
||||
|
||||
if (message.attachments > 0)
|
||||
|
|
10
app/src/main/res/drawable/baseline_arrow_downward_24.xml
Normal file
10
app/src/main/res/drawable/baseline_arrow_downward_24.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,12l-1.41,-1.41L13,16.17V4h-2v12.17l-5.58,-5.59L4,12l8,8 8,-8z"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/baseline_arrow_upward_24.xml
Normal file
10
app/src/main/res/drawable/baseline_arrow_upward_24.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/importance.xml
Normal file
9
app/src/main/res/drawable/importance.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:drawable="@drawable/baseline_arrow_upward_24"
|
||||
android:maxLevel="0" />
|
||||
<item
|
||||
android:drawable="@drawable/baseline_arrow_downward_24"
|
||||
android:maxLevel="1" />
|
||||
</level-list>
|
|
@ -93,6 +93,17 @@
|
|||
app:layout_constraintTop_toTopOf="@+id/tvFrom"
|
||||
app:srcCompat="@drawable/baseline_low_priority_24" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivImportance"
|
||||
android:layout_width="21dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:contentDescription="@string/title_legend_priority_low"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPriorityLow"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvFrom"
|
||||
app:srcCompat="@drawable/importance" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSigned"
|
||||
android:layout_width="21dp"
|
||||
|
@ -100,7 +111,7 @@
|
|||
android:layout_marginStart="6dp"
|
||||
android:contentDescription="@string/title_legend_signed"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPriorityLow"
|
||||
app:layout_constraintStart_toEndOf="@id/ivImportance"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvFrom"
|
||||
app:srcCompat="@drawable/baseline_gesture_24" />
|
||||
|
||||
|
|
|
@ -92,6 +92,17 @@
|
|||
app:layout_constraintTop_toTopOf="@+id/tvFrom"
|
||||
app:srcCompat="@drawable/baseline_low_priority_24" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivImportance"
|
||||
android:layout_width="21dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:contentDescription="@string/title_legend_priority_low"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPriorityLow"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvFrom"
|
||||
app:srcCompat="@drawable/importance" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSigned"
|
||||
android:layout_width="21dp"
|
||||
|
@ -99,7 +110,7 @@
|
|||
android:layout_marginStart="6dp"
|
||||
android:contentDescription="@string/title_legend_signed"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
|
||||
app:layout_constraintStart_toEndOf="@id/ivPriorityLow"
|
||||
app:layout_constraintStart_toEndOf="@id/ivImportance"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvFrom"
|
||||
app:srcCompat="@drawable/baseline_gesture_24" />
|
||||
|
||||
|
|
Loading…
Reference in a new issue