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

TalkBack describes main FAB as "unlabeled button" #192

Open
2 tasks done
TacoTheDank opened this issue Feb 27, 2024 · 2 comments
Open
2 tasks done

TalkBack describes main FAB as "unlabeled button" #192

TacoTheDank opened this issue Feb 27, 2024 · 2 comments

Comments

@TacoTheDank
Copy link

TacoTheDank commented Feb 27, 2024

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the library.

Step 2: Describe your environment

  • Library version: view-3.3.0
  • Android version: 12
  • Support library version: ? (not sure what this means)
  • Device brand: Samsung
  • Device model: Galaxy S10

Step 3: Describe the problem:

Steps to reproduce:

  1. Set contentDescription of SpeedDialView
  2. Enable TalkBack
  3. Press on main FAB
  4. Observe "unlabeled button"

Observed Results:

  • When using TalkBack, main FAB is described as "unlabeled button."

Expected Results:

  • When using TalkBack, main FAB would be described as "Apply action button."

Relevant Code:

<com.leinardi.android.speeddial.SpeedDialView
            android:id="@+id/fabSD"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:accessibilityTraversalBefore="@android:id/list"
            android:contentDescription="@string/apply_action"
            android:visibility="gone"
            app:sdMainFabClosedSrc="@drawable/ic_fab_edit"
            app:sdOverlayLayout="@id/fabSDOverlay" />

I think the problem is that SpeedDialView is not the FAB itself, but just a LinearLayout. Thus, the contentDescription is being applied to the SpeedDialView and not the (main) FAB that's IN the SpeedDialView. (If that's not the problem, then I don't know what is.)

@leinardi
Copy link
Owner

leinardi commented Feb 27, 2024

Hi @TacoTheDank, thank you for reporting the issue.

As far as I can tell the contentDescription that you set to the SpeedDialView is also applied to the main FAB (see here and here).

Can you please try to call SpeedDialView.setContentDescription() programmatically after the main fab is created? maybe something is still null when I'm trying to set it from XML and a workaround could be to call setContentDescription programmatically.

Unfortunately right now I do not have time to dig deeper in this issue but PRs are welcome.

@TacoTheDank
Copy link
Author

@leinardi Hi, I did what you suggested. I removed android:contentDescription="@string/apply_action" from the XML and set setContentDescription() programmatically, and it now works. The main FAB is now described as "Apply action button."

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

No branches or pull requests

2 participants