Commit bf86b603 by ibaker Committed by Rohit Singh

Ensure TalkBack announces the selected playback speed in the UI menu

Issue: google/ExoPlayer#10298
#minor-release
PiperOrigin-RevId: 457991028
parent 14f75c16
...@@ -1817,7 +1817,13 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1817,7 +1817,13 @@ public class StyledPlayerControlView extends FrameLayout {
if (position < playbackSpeedTexts.length) { if (position < playbackSpeedTexts.length) {
holder.textView.setText(playbackSpeedTexts[position]); holder.textView.setText(playbackSpeedTexts[position]);
} }
holder.checkView.setVisibility(position == selectedIndex ? VISIBLE : INVISIBLE); if (position == selectedIndex) {
holder.itemView.setSelected(true);
holder.checkView.setVisibility(VISIBLE);
} else {
holder.itemView.setSelected(false);
holder.checkView.setVisibility(INVISIBLE);
}
holder.itemView.setOnClickListener( holder.itemView.setOnClickListener(
v -> { v -> {
if (position != selectedIndex) { if (position != selectedIndex) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment