Skip to content

Conversation

@ShaanNarendran
Copy link
Contributor

Purpose / Description

The problem is when hovering over the ease buttons in talkback, instead of saying "less than 1 minute, hard", the voice would say "less than 1 metre, hard". This was because there was no content description defined there and it was reading 'm' as metre.

Approach

Added a content description block to the EaseButton.kt file, previously it was just setting the text directly but now the content description is defined while replacing m with minutes, h with hours, d with days.

How Has This Been Tested?

Screen_recording_20251209_111440.webm

Learning (optional, can help others)

I had not found any particular buttons which were not working with talkback so I decided to check the reviewer tab and realised its quite unusable in its current state.
I had a lot of difficulty tracing where the text was being set for the button since it's dynamic and not static. I initially made the mistake of thinking AnswerButton.kt is where the time is set and tried to implement the fix there but after a lot of testing, realised it was not. Then I swept for nextTime and managed to find AbstractFlashcardViewer.kt which was using an EaseButton class which was the actual class to be changed.

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@ShaanNarendran ShaanNarendran force-pushed the Fixing-Time-Audio-Talkback branch from 58cbf6e to e3d012c Compare December 9, 2025 06:30
@david-allison
Copy link
Member

This needs to be internationalized using Android's plurals mechanism.

Look into getQuantityString

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Dec 9, 2025
@ShaanNarendran ShaanNarendran force-pushed the Fixing-Time-Audio-Talkback branch from e3d012c to 6e5488d Compare December 9, 2025 06:35
@ShaanNarendran
Copy link
Contributor Author

This needs to be internationalized using Android's plurals mechanism.

Look into getQuantityString

Ok, let me have a look. Sorry for so many forced pushes, I was having trouble with git TT.

@ShaanNarendran
Copy link
Contributor Author

This needs to be internationalized using Android's plurals mechanism.

Look into getQuantityString

I would use getQuantityString to fix pluralisation issues I assume like if it's 2 then I'd need it to be minutes not minute and vice versa. By internationalised, are you referring to other languages and how they handle pluralisation?

@david-allison
Copy link
Member

david-allison commented Dec 9, 2025

  • The first issue is that other languages may not use m, d etc...
  • Secondly, these need to be translated into the user's language, so 'h' would be mapped to heure in French
  • Finally, different languages use different strings based on quantity.

You may want to make an issue/sub-issue of the accessibility issue for this PR. This will allow you to research and list where d, h etc... come from, and allow us to produce a reusable solution for handling this.

⚠️ Finally, this screen is deprecated and pending removal, and work should focus on ReviewerFragment

@ShaanNarendran
Copy link
Contributor Author

  • The first issue is that other languages may not use m, d etc...

  • Secondly, these need to be translated into the user's language, so 'h' would be mapped to heure in French

  • Finally, different languages use different strings based on quantity.

You may want to make an issue/sub-issue of the accessibility issue for this PR. This will allow you to research and list where d, h etc... come from, and allow us to produce a reusable solution for handling this.

⚠️ Finally, this screen is deprecated and pending removal, and work should focus on ReviewerFragment

I'll make a separate issue page then for this, so further discussion can be had there.

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

Labels

Needs Author Reply Waiting for a reply from the original author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants