Accessibility improvements

This commit is contained in:
M66B
2019-12-23 17:34:46 +01:00
parent f5177a8245
commit e1755c5fe0
3 changed files with 27 additions and 13 deletions

View File

@@ -263,6 +263,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageButton ibExpander;
private ImageView ibFlagged;
private ImageButton ibAvatar;
private View vwSeen;
private ImageButton ibAuth;
private ImageView ivPriorityHigh;
private ImageView ivPriorityLow;
@@ -386,6 +387,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibExpander = itemView.findViewById(R.id.ibExpander);
ibFlagged = itemView.findViewById(R.id.ibFlagged);
ibAvatar = itemView.findViewById(R.id.ibAvatar);
vwSeen = itemView.findViewById(R.id.vwSeen);
ibAuth = itemView.findViewById(R.id.ibAuth);
ivPriorityHigh = itemView.findViewById(R.id.ivPriorityHigh);
ivPriorityLow = itemView.findViewById(R.id.ivPriorityLow);
@@ -777,9 +779,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
vwColor.setBackgroundColor(colorBackground);
}
vwColor.setContentDescription(context.getString(
message.unseen > 0 ? R.string.title_accessibility_unseen : R.string.title_accessibility_seen));
// Expander
if (ibExpander.getTag() == null || (boolean) ibExpander.getTag() != expanded) {
ibExpander.setTag(expanded);
@@ -795,6 +794,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// Photo
ibAvatar.setVisibility(avatars ? View.INVISIBLE : View.GONE);
vwSeen.setContentDescription(context.getString(
message.unseen > 0 ? R.string.title_accessibility_unseen : R.string.title_accessibility_seen));
// Line 1
ibAuth.setVisibility(authentication && !authenticated ? View.VISIBLE : View.GONE);
ivPriorityHigh.setVisibility(EntityMessage.PRIORITIY_HIGH.equals(message.priority) ? View.VISIBLE : View.GONE);