mirror of https://github.com/M66B/FairEmail.git
Better content descriptions for the contact list item
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
This commit is contained in:
parent
e7fd1bac7a
commit
c5475bab39
|
@ -104,12 +104,16 @@ public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHold
|
|||
private void bindTo(TupleContactEx contact) {
|
||||
view.setAlpha(contact.state == EntityContact.STATE_IGNORE ? Helper.LOW_LIGHT : 1.0f);
|
||||
|
||||
if (contact.type == EntityContact.TYPE_FROM)
|
||||
if (contact.type == EntityContact.TYPE_FROM) {
|
||||
ivType.setImageResource(R.drawable.baseline_call_received_24);
|
||||
else if (contact.type == EntityContact.TYPE_TO)
|
||||
ivType.setContentDescription(context.getString(R.string.title_accessibility_from));
|
||||
} else if (contact.type == EntityContact.TYPE_TO) {
|
||||
ivType.setImageResource(R.drawable.baseline_call_made_24);
|
||||
else
|
||||
ivType.setContentDescription(context.getString(R.string.title_accessibility_to));
|
||||
} else {
|
||||
ivType.setImageDrawable(null);
|
||||
ivType.setContentDescription(null);
|
||||
}
|
||||
|
||||
if (contact.avatar == null || !contacts)
|
||||
ivAvatar.setImageDrawable(null);
|
||||
|
@ -154,6 +158,8 @@ public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHold
|
|||
? R.drawable.baseline_star_24 : R.drawable.baseline_star_border_24);
|
||||
ivFavorite.setImageTintList(ColorStateList.valueOf(
|
||||
contact.state == EntityContact.STATE_FAVORITE ? colorAccent : textColorSecondary));
|
||||
ivFavorite.setContentDescription(context.getString(contact.state == EntityContact.STATE_FAVORITE
|
||||
? R.string.title_accessibility_flagged : null));
|
||||
|
||||
view.requestLayout();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:id="@+id/ivType"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/title_legend_avatar"
|
||||
android:contentDescription="@string/title_accessibility_from"
|
||||
app:srcCompat="@drawable/baseline_call_received_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -24,7 +24,6 @@
|
|||
android:layout_width="42dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:contentDescription="@string/title_legend_avatar"
|
||||
android:padding="3dp"
|
||||
app:srcCompat="@drawable/baseline_person_24"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
|
@ -86,11 +85,11 @@
|
|||
android:id="@+id/ivFavorite"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/title_legend_flagged"
|
||||
android:contentDescription="@string/title_accessibility_flagged"
|
||||
app:srcCompat="@drawable/baseline_star_24"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivAvatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivAvatar" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -1080,6 +1080,8 @@
|
|||
<string name="title_accessibility_show_addresses">Show addresses</string>
|
||||
<string name="title_accessibility_hide_addresses">Hide addresses</string>
|
||||
<string name="title_accessibility_attachment">Attachment</string>
|
||||
<string name="title_accessibility_from">Sender</string>
|
||||
<string name="title_accessibility_to">Recipient</string>
|
||||
|
||||
<string-array name="pollIntervalNames">
|
||||
<item>Always</item>
|
||||
|
|
Loading…
Reference in New Issue