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

[Bug] [Android] Talkback AutomationProperties.LabledBy not working in non-fast label renderer #10282

Open
jgold6 opened this issue Apr 9, 2020 · 0 comments

Comments

@jgold6
Copy link
Contributor

jgold6 commented Apr 9, 2020

Description

If using the original , i.e. non-fast, renderer for a label, then doing the following does not work as expected (MyEntry is an Entry, MyLabel is a Label):

    AutomationProperties.SetIsInAccessibleTree(MyEntry, true);
    AutomationProperties.SetLabeledBy(MyEntry, MyLabel);

With the above it is expected that, with Talkback on, when the Entry is selected Talkback will say "Edit box for <text of label>" but with the original renderer on Android devices running 7.0 (or 5.1) and later, the Talkback only says "Edit Box". I do not know exactly what version of Android the issue starts on because I have no way to test 5.1 or 6.0 devices. Issues does not reproduce on a 5.0 device (that I own), but does on >= 7.0 (tested on emulators).

Worth noting is that emulators do not have Talkback by default, but the Android Accessibility Suite can be installed in emulators from the Google Play Store, but emulators for 5.1 and 6.0 do not allow Google Play to be installed, so I could not test on those Android versions.

Originally reported here: https://forums.xamarin.com/discussion/180260/how-can-i-use-custom-renderers-without-breaking-talkback

Steps to Reproduce

  1. Open the attached test project and deploy to Android device or simulator >= 7.0 with Android Accessibility Suite installed
  2. Enable Talkback in the device/emulator Accessibility settings
  3. Stop and redeploy the app.
  4. Select the Entry

Expected Behavior

Talkback will say "Edit Box for Custom Text Here"

Actual Behavior

Talkback only says "Edit box"

Basic Information

  • Version with issue: 4.5.0.503

  • Last known good version: Unknown

  • IDE: Visual Studio 2019 16.5.3

  • Platform Target Frameworks:

    • Android: 9.0
  • Android Support Library Version: 28.0.0.3

  • Nuget Packages: Xamarin.Forms, Xamarin.Essentials

  • Affected Devices: Android >= 5.1 or 7.0 (I can't verify on 5.1 or 6.0 as I do not have access to devices or emulators that have Talkback with 5.1 or 6.0)

Reproduction Link

TestTalkbackCustomRenderer.zip

Workaround

If you create a custom renderer for a Label, make sure to inherit from Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer

@jgold6 jgold6 added t/bug 🐛 s/unverified New report that has yet to be verified labels Apr 9, 2020
@samhouts samhouts added e/6 🕕 6 and removed s/unverified New report that has yet to be verified labels Apr 17, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants