Commit 1a3111e2 authored by Sinan Sahin's avatar Sinan Sahin Committed by Commit Bot

Fix TalkBack announcement for disabled Offer to translate list item

Bug: 802284
Change-Id: I674255c3d1aa577206f677f13ad5bd30efc085ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1572901Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#652656}
parent 18daee42
......@@ -193,6 +193,12 @@ public class ListMenuButton
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
// The view needs to have an OnClickListener for TalkBack to announce the disabled
// state. In this case, we need to let the ListView handle the click.
view.setOnClickListener(
(View v) -> ((ListView) parent).performItemClick(v, position, 0));
view.setEnabled(isEnabled(position));
// Set the compound drawable at the end for items with a valid endIconId,
......
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 to comment