Fix 'played' state on TalkBack when cover is hidden (#6796)

This commit is contained in:
ByteHamster 2023-12-06 21:26:49 +01:00 committed by GitHub
parent ae4205c6d3
commit 3852d50f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -100,15 +100,13 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder {
this.item = item;
placeholder.setText(item.getFeed().getTitle());
title.setText(item.getTitle());
leftPadding.setContentDescription(item.getTitle());
if (item.isPlayed()) {
leftPadding.setContentDescription(item.getTitle() + ". " + activity.getString(R.string.is_played));
} else {
leftPadding.setContentDescription(item.getTitle());
}
pubDate.setText(DateFormatter.formatAbbrev(activity, item.getPubDate()));
pubDate.setContentDescription(DateFormatter.formatForAccessibility(item.getPubDate()));
if (item.isPlayed()) {
cover.setContentDescription(activity.getString(R.string.is_played));
cover.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
} else {
cover.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
}
isInbox.setVisibility(item.isNew() ? View.VISIBLE : View.GONE);
isFavorite.setVisibility(item.isTagged(FeedItem.TAG_FAVORITE) ? View.VISIBLE : View.GONE);
isInQueue.setVisibility(item.isTagged(FeedItem.TAG_QUEUE) ? View.VISIBLE : View.GONE);