mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Better content descriptions for the contact list item
Signed-off-by: Peter Vágner <pvdeejay@gmail.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user