Skip to content
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

Merged
merged 4 commits into from
May 17, 2021
Merged

[Android] Action.tooltip support #5800

merged 4 commits into from
May 17, 2021

Conversation

golddove
Copy link
Member

@golddove golddove commented May 7, 2021

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-online inlineAction. That is now fixed.

Sample Card

v1.5\Tests\TooltipTestCard.json

How Verified

Manual verification with Talkback

Microsoft Reviewers: Open in CodeFlow

@@ -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))
Copy link
Member

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contentDescription here too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

Comment on lines 232 to 242

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);
}
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored

@ghost ghost removed the Needs: Author Feedback label May 13, 2021
@golddove golddove changed the base branch from main to 1.0.0 May 13, 2021 16:38
@golddove golddove changed the base branch from 1.0.0 to main May 13, 2021 16:38
@golddove golddove requested a review from paulcam206 May 13, 2021 16:46
Copy link
Member

@paulcam206 paulcam206 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@golddove golddove merged commit 61aa500 into main May 17, 2021
@golddove golddove deleted the golddove/5469 branch May 17, 2021 16:54
michaelfarnsworth pushed a commit to michaelfarnsworth/AdaptiveCards that referenced this pull request Nov 10, 2022
* [Android] Action.tooltip support

* PR feedback
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
* [Android] Action.tooltip support

* PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Renderer support for tooltip property
2 participants