Added forwarded indication

pull/178/head
M66B 4 years ago
parent fa5f343c59
commit 877221cd40

@ -325,6 +325,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageView ivFound;
private ImageButton ibSnoozed;
private ImageView ivAnswered;
private ImageView ivForwarded;
private ImageView ivAttachments;
private TextView tvSubject;
private TextView tvKeywords;
@ -472,6 +473,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivFound = itemView.findViewById(R.id.ivFound);
ibSnoozed = itemView.findViewById(R.id.ibSnoozed);
ivAnswered = itemView.findViewById(R.id.ivAnswered);
ivForwarded = itemView.findViewById(R.id.ivForwarded);
ivAttachments = itemView.findViewById(R.id.ivAttachments);
tvSubject = itemView.findViewById(subject_top ? R.id.tvFrom : R.id.tvSubject);
tvKeywords = itemView.findViewById(R.id.tvKeywords);
@ -804,6 +806,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivFound.setVisibility(View.GONE);
ibSnoozed.setVisibility(View.GONE);
ivAnswered.setVisibility(View.GONE);
ivForwarded.setVisibility(View.GONE);
ivAttachments.setVisibility(View.GONE);
tvSubject.setText(null);
tvKeywords.setVisibility(View.GONE);
@ -877,6 +880,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivFound.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ibSnoozed.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivAnswered.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivForwarded.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivAttachments.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
tvSubject.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
tvKeywords.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
@ -996,6 +1000,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSnoozed.setVisibility(message.ui_snoozed == null ? View.GONE : View.VISIBLE);
ivAnswered.setVisibility(message.ui_answered ? View.VISIBLE : View.GONE);
ivForwarded.setVisibility(message.isForwarded() ? View.VISIBLE : View.GONE);
ivAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE);
if (viewType == ViewType.FOLDER)

@ -218,6 +218,14 @@ public class EntityMessage implements Serializable {
return addresses.toArray(new Address[0]);
}
boolean isForwarded() {
if (keywords != null)
for (String keyword : keywords)
if ("$Forwarded".equalsIgnoreCase(keyword))
return true;
return false;
}
String getNotificationChannelId() {
if (from == null || from.length == 0)
return null;

@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<group
android:pivotX="12"
android:scaleX="-1">
<path
android:fillColor="@android:color/white"
android:pathData="M10,9V5l-7,7 7,7v-4.1c5,0 8.5,1.6 11,5.1 -1,-5 -4,-10 -11,-11z" />
</group>
</vector>

@ -212,6 +212,17 @@
app:layout_constraintTop_toTopOf="@+id/tvSubject"
app:srcCompat="@drawable/baseline_reply_24" />
<ImageView
android:id="@+id/ivForwarded"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_answered"
app:layout_constraintBottom_toBottomOf="@+id/tvSubject"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toTopOf="@+id/tvSubject"
app:srcCompat="@drawable/baseline_forwarded_24" />
<ImageView
android:id="@+id/ivAttachments"
android:layout_width="21dp"
@ -219,7 +230,7 @@
android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_attachment"
app:layout_constraintBottom_toBottomOf="@+id/tvSubject"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintStart_toEndOf="@id/ivForwarded"
app:layout_constraintTop_toTopOf="@+id/tvSubject"
app:srcCompat="@drawable/baseline_attachment_24" />

@ -251,6 +251,17 @@
app:layout_constraintTop_toTopOf="@+id/tvFolder"
app:srcCompat="@drawable/baseline_reply_24" />
<ImageView
android:id="@+id/ivForwarded"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_answered"
app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintTop_toTopOf="@+id/tvFolder"
app:srcCompat="@drawable/baseline_forwarded_24" />
<ImageView
android:id="@+id/ivAttachments"
android:layout_width="21dp"
@ -258,7 +269,7 @@
android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_attachment"
app:layout_constraintBottom_toBottomOf="@+id/tvFolder"
app:layout_constraintStart_toEndOf="@id/ivAnswered"
app:layout_constraintStart_toEndOf="@id/ivForwarded"
app:layout_constraintTop_toTopOf="@+id/tvFolder"
app:srcCompat="@drawable/baseline_attachment_24" />

Loading…
Cancel
Save