Show keywords in message header

pull/172/head
M66B 5 years ago
parent 5669acad9e
commit 2ae3b07169

@ -284,6 +284,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageView ivAnswered;
private ImageView ivAttachments;
private TextView tvSubject;
private TextView tvKeywords;
private TextView tvFolder;
private TextView tvCount;
private ImageView ivThread;
@ -326,7 +327,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private TextView tvSubjectEx;
private TextView tvFlags;
private TextView tvKeywords;
private TextView tvKeywordsEx;
private TextView tvHeaders;
private ContentLoadingProgressBar pbHeaders;
@ -410,6 +411,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivAnswered = itemView.findViewById(R.id.ivAnswered);
ivAttachments = itemView.findViewById(R.id.ivAttachments);
tvSubject = itemView.findViewById(subject_top ? R.id.tvFrom : R.id.tvSubject);
tvKeywords = itemView.findViewById(R.id.tvKeywords);
tvExpand = itemView.findViewById(R.id.tvExpand);
tvPreview = itemView.findViewById(R.id.tvPreview);
tvFolder = itemView.findViewById(R.id.tvFolder);
@ -481,7 +483,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSubjectEx = vsBody.findViewById(R.id.tvSubjectEx);
tvFlags = vsBody.findViewById(R.id.tvFlags);
tvKeywords = vsBody.findViewById(R.id.tvKeywords);
tvKeywordsEx = vsBody.findViewById(R.id.tvKeywordsEx);
tvHeaders = vsBody.findViewById(R.id.tvHeaders);
pbHeaders = vsBody.findViewById(R.id.pbHeaders);
@ -710,6 +712,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivAnswered.setVisibility(View.GONE);
ivAttachments.setVisibility(View.GONE);
tvSubject.setText(null);
tvKeywords.setVisibility(View.GONE);
tvFolder.setText(null);
tvCount.setText(null);
ivThread.setVisibility(View.GONE);
@ -740,6 +743,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
float fz_subject = (font_size_subject == null ? textSize : font_size_subject) * 0.9f;
tvFrom.setTextSize(TypedValue.COMPLEX_UNIT_PX, fz_sender);
tvSubject.setTextSize(TypedValue.COMPLEX_UNIT_PX, fz_subject);
tvKeywords.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
tvFolder.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
tvPreview.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * 0.9f);
@ -779,6 +783,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivAnswered.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);
tvFolder.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
tvCount.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
ivThread.setAlpha(dim ? Helper.LOW_LIGHT : 1.0f);
@ -848,6 +853,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// Line 2
tvSubject.setText(message.subject);
tvKeywords.setVisibility(message.keywords.length > 0 ? View.VISIBLE : View.GONE);
tvKeywords.setText(TextUtils.join(" ", message.keywords));
// Line 3
int icon = (message.drafts > 0
? R.drawable.baseline_edit_24
@ -1040,7 +1048,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSizeEx.setVisibility(View.GONE);
tvSubjectEx.setVisibility(View.GONE);
tvFlags.setVisibility(View.GONE);
tvKeywords.setVisibility(View.GONE);
tvKeywordsEx.setVisibility(View.GONE);
pbHeaders.setVisibility(View.GONE);
tvNoInternetHeaders.setVisibility(View.GONE);
@ -1254,8 +1262,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvFlags.setText(message.flags);
// Keywords
tvKeywords.setVisibility(show_addresses && message.keywords.length > 0 ? View.VISIBLE : View.GONE);
tvKeywords.setText(TextUtils.join(" ", message.keywords));
tvKeywordsEx.setVisibility(show_addresses && message.keywords.length > 0 ? View.VISIBLE : View.GONE);
tvKeywordsEx.setText(TextUtils.join(" ", message.keywords));
// Headers
if (show_headers && message.headers != null)

@ -359,7 +359,7 @@
app:layout_constraintTop_toBottomOf="@id/tvSubjectEx" />
<TextView
android:id="@+id/tvKeywords"
android:id="@+id/tvKeywordsEx"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"

@ -265,6 +265,20 @@
app:layout_constraintTop_toBottomOf="@id/paddingTop"
app:srcCompat="@drawable/baseline_star_24" />
<TextView
android:id="@+id/tvKeywords"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:ellipsize="end"
android:singleLine="true"
android:text="tag1, tag2, tag3"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibFlagged"
app:layout_constraintStart_toEndOf="@id/ibAvatar"
app:layout_constraintTop_toBottomOf="@id/tvSubject" />
<TextView
android:id="@+id/tvFolder"
android:layout_width="0dp"
@ -278,7 +292,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibFlagged"
app:layout_constraintStart_toEndOf="@id/ibAvatar"
app:layout_constraintTop_toBottomOf="@id/tvSubject" />
app:layout_constraintTop_toBottomOf="@id/tvKeywords" />
<TextView
android:id="@+id/tvExpand"

@ -169,6 +169,21 @@
app:layout_constraintStart_toEndOf="@id/ibAvatar"
app:layout_constraintTop_toBottomOf="@id/tvFrom" />
<TextView
android:id="@+id/tvKeywords"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="6dp"
android:gravity="center_vertical"
android:minHeight="24dp"
android:text="tag1, tag2, tag3"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toStartOf="@+id/ibFlagged"
app:layout_constraintStart_toEndOf="@id/ibAvatar"
app:layout_constraintTop_toBottomOf="@id/tvSubject" />
<ImageButton
android:id="@+id/ibFlagged"
android:layout_width="42dp"
@ -249,7 +264,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/tvCount"
app:layout_constraintStart_toEndOf="@id/ivAttachments"
app:layout_constraintTop_toBottomOf="@id/tvSubject" />
app:layout_constraintTop_toBottomOf="@id/tvKeywords" />
<TextView
android:id="@+id/tvCount"

Loading…
Cancel
Save