-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Action.tooltip support #5800
Conversation
@@ -282,6 +282,17 @@ public void afterTextChanged(Editable s) | |||
inlineButton.setPadding(16, 0, 0, 8); | |||
} | |||
|
|||
String contentDescription = !TextUtils.isEmpty(action.GetTitle()) ? action.GetTitle() : action.GetTooltip(); | |||
String tooltip = !TextUtils.isEmpty(action.GetTooltip()) ? action.GetTooltip() : action.GetTitle(); | |||
if (!TextUtils.isEmpty(tooltip)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contentDescription
?
|
||
String contentDescription = !TextUtils.isEmpty(selectAction.GetTitle()) ? selectAction.GetTitle() : selectAction.GetTooltip(); | ||
String tooltip = !TextUtils.isEmpty(selectAction.GetTooltip()) ? selectAction.GetTooltip() : selectAction.GetTitle(); | ||
if (!TextUtils.isEmpty(tooltip)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contentDescription
here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
|
||
String contentDescription = !TextUtils.isEmpty(selectAction.GetTitle()) ? selectAction.GetTitle() : selectAction.GetTooltip(); | ||
String tooltip = !TextUtils.isEmpty(selectAction.GetTooltip()) ? selectAction.GetTooltip() : selectAction.GetTitle(); | ||
if (!TextUtils.isEmpty(tooltip)) | ||
{ | ||
view.setContentDescription(contentDescription); | ||
} | ||
if (!TextUtils.isEmpty(tooltip)) | ||
{ | ||
TooltipCompat.setTooltipText(view, tooltip); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like this should probably be pulled out into a helper function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* [Android] Action.tooltip support * PR feedback
* [Android] Action.tooltip support * PR feedback
Related Issue
Fixes #5469
Description
Implement support for Action.tooltip. Additionally, previous implementation was not setting Action.title as accessible name when applied to a
selectAction
or an icon-onlineinlineAction
. That is now fixed.Sample Card
v1.5\Tests\TooltipTestCard.json
How Verified
Manual verification with Talkback
Microsoft Reviewers: Open in CodeFlow