Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Android] Fix Label size when using Hint text #4433

Merged
merged 3 commits into from
Nov 21, 2018
Merged

[Android] Fix Label size when using Hint text #4433

merged 3 commits into from
Nov 21, 2018

Conversation

rmarinho
Copy link
Member

@rmarinho rmarinho commented Nov 15, 2018

Description of Change

When setting the HelpText for accessibility on a Label it causes to set the Hint text on a TextView .
Later when we are Measuring it Android will take the Hint text size in account and return wrong sizes that won't fit just the text but hint also.
We need to clear the Hint before measure.

Trying to move the calls to set hint to other places is no good because sizing is called sometimes multiple times when text is changing.

Issues Resolved

API Changes

None

Platforms Affected

  • Android

Behavioral/Visual Changes

Labels with HelpText with size correctly

Before/After Screenshots

BEFORE:
screenshot-1542302349417

AFTER:
screenshot-1542302279780

Testing Procedure

Go to issue 2580 make sure the 2 rows look the same.

PR Checklist

  • Has automated tests
  • Rebased on top of the target branch at time of PR
  • Changes adhere to coding standard

@hartez hartez requested review from jassmith and kingces95 November 16, 2018 17:01
@samhouts samhouts added the retarget-branch-required PR or associated issues target a milestone. Please target this PR to the matching branch. label Nov 19, 2018
Copy link
Contributor

@kingces95 kingces95 left a comment

Choose a reason for hiding this comment

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

Does the trick. Why did Android decide that setting automation text also set the hint text?

All versions of the same question: Why not just clear the hint text right after setting the automation text? Why bother restoring the hint text? With this change the label will measure zero width and so any hint text will never be displayed, right?

@rmarinho rmarinho removed the retarget-branch-required PR or associated issues target a milestone. Please target this PR to the matching branch. label Nov 21, 2018
@rmarinho rmarinho requested review from hartez and removed request for jassmith November 21, 2018 17:10
@samhouts samhouts added a/a11y 🔍 e/5 🕔 5 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often m/high impact ⬛ p/Android t/bug 🐛 labels Nov 21, 2018
@hartez hartez merged commit 65b172e into master Nov 21, 2018
@samhouts samhouts added the approved Has two approvals, no pending reviews, and no changes requested label Nov 22, 2018
@samhouts samhouts added this to the 4.0.0 milestone Dec 4, 2018
@StephaneDelcroix StephaneDelcroix deleted the fix-2580 branch December 19, 2018 15:33
@samhouts samhouts modified the milestones: 4.0.0, 3.5.0 Jan 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/a11y 🔍 approved Has two approvals, no pending reviews, and no changes requested e/5 🕔 5 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often m/high impact ⬛ p/Android t/bug 🐛
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding accessibility tags to a label seems to cause the renderer to need more space
5 participants