MaterialDateTimePicker icon indicating copy to clipboard operation
MaterialDateTimePicker copied to clipboard

Make TalkBack only read the value changed when something changes

Open cf256 opened this issue 6 years ago • 1 comments

Thanks for the great library!

We're experiencing an issue when using the timepicker with TalkBack enabled.

If you are on for example "Hour mode" (i.e. selecting hours), and you use 2 fingers to swipe to an hour, TalkBack only reads the seconds out loud. I.e "00". The same goes for minutes. If you are in AM/PM mode it only reads AM or PM.

I think this is related to the onValueSelected method in TimePickerDialog which sets the hours, minutes, seconds and amPmDisplay. These setters will in turn call Utils.tryAccessibilityAnnounce(mTimePicker, text);, which will try to read out the values. However, since the announcements all come at almost the same time, TalkBack will only announce the latest value. Which will either be the seconds or AM/PM.

Not sure what the best way is to fix this is. Maybe to diff the old value with the new value and only announce it if it's different?

cf256 avatar Oct 04 '19 11:10 cf256

I must say that I don't intensively test the talkback logic. It's an area that can use improvement.

I am open to suggestions here, and PRs that improve it are much appreciated.

I'll give it some thought as well, but my time to work on this library has been limited the last year.

wdullaer avatar Oct 05 '19 12:10 wdullaer