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

[Android] TalkBack now reads name and helptext on buttons. #13244

Merged
merged 7 commits into from
Dec 31, 2020
Merged

Conversation

PureWeen
Copy link
Contributor

@PureWeen PureWeen commented Dec 28, 2020

Description of Change

Original PR here
#9728

  • Removed fix on original PR for fixing AutomationId and Content Description. That fix needs more review
  • This PR applies a different fix to resolve the wrong name/help text being read. The main problem is that the Renderers for Switch/Button override the SetBasicContentDescription from this PR [Android] Fixes AutomationProperties.Name on Button #4094. This was done so that the Hint doesn't get set on the Switch/Button but it needs to use the actual control and not the ViewGroup container
  • Fixed an issue where a reused control would get set to the previous elements AutomationId. The defaultContentDescription would only get set when ContentDescription wasn't null. This leads to the defaultContentDescription getting set to the AutomationId because you can't just use a null check to determine if a default should be set for a string. This would make it so when a control gets recycled to a new element it would set the ContentDescription to the previous AutomationId thinking that was the defaultContentDescription. The defaultContentDescription/defaultHint are now set only once explicitly the first time the AutomationId/ContentDescription are set.

Issues Resolved

Platforms Affected

  • Android

Testing Procedure

Switch to Legacy Renderers as the change is only relevant for the Legacy Button Renderer. Switch Renderer doesn't have a fast renderer so it's relevant either way

  • Verify UI test 5150
  • Verify UI Test 4053

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@PureWeen PureWeen added this to To do in vNext+1 (5.0.0) via automation Dec 28, 2020
@PureWeen PureWeen added this to the 5.0.0 milestone Dec 28, 2020
@PureWeen PureWeen moved this from To do to In Review in vNext+1 (5.0.0) Dec 28, 2020
Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Hey @PureWeen seems it broke the test Bugzilla38112_SwitchIsStillOnScreen_google_pixel_2-8_1_0

@PureWeen PureWeen added DO-NOT-MERGE-!!! 🛑 This is in progress and needs to be updated before it can be merged. and removed DO-NOT-MERGE-!!! 🛑 This is in progress and needs to be updated before it can be merged. labels Dec 29, 2020
@rmarinho
Copy link
Member

@PureWeen I think it's normal with legacy renderes to talk the container first then the button with content description right? But what is strange is that on 4053 test It didn't talkback the container for the button but on 5150 it does.

@PureWeen
Copy link
Contributor Author

@rmarinho The automation has just applied to the actual control and not the container for some time now. The Container always gets set to {AutomationID}_Container. If you set the helptext/name to the container then things like Button won't ready correctly.

But what is strange is that on 4053 test It didn't talkback the container for the button but on 5150 it does.

I don't follow this one. I tested both 4053 and 5150 and they seem to work the same

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Good now if it passes UITEsts

@rmarinho rmarinho merged commit 75f9a3f into 5.0.0 Dec 31, 2020
vNext+1 (5.0.0) automation moved this from In Review to Done Dec 31, 2020
@rmarinho rmarinho deleted the fix_5150 branch December 31, 2020 14:06
@PureWeen
Copy link
Contributor Author

/sudo backport 4.8.0

@PureWeen
Copy link
Contributor Author

@vs-mobiletools-engineering-service2 backport 4.8.0

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job Created! The magic is happening here

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Oh no! Backport failed! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4383653 for more details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

AutomationProperties.Name, AutomationProperties.HelpText on Button not read by Android TalkBack
5 participants