So I have a SeekBar
in my app and I'm using the TalkBack function of Android. When the SeekBar
is scrolled, the device says "(android:contentDescription of view), SeekBar control, 50%". Is it possible to change it so it says the actual value (from -4 to +4), like "SeekBar control, negative 4"?

- 1,044
- 9
- 25

- 381
- 5
- 14
-
1do you want to add those -4 and +4 to both sides or when you scroll display that value eg 3.2 – Charuක Jan 09 '17 at 05:53
-
1-4 to +4 is already displayed above the SeekBar control, but it is a different view so the values are not spoken as actual -4 to 4 but rather by percentage – mugiwara528 Jan 09 '17 at 05:58
3 Answers
If you're using a SeekBar, I figure you're tracking the value somewhere. In our case, there is a TextView above the SeekBar that displays the current value derived from the SeekBar's progress.
I've found that setting android:accessibilityLiveRegion="assertive"
as an attribute for the TextView works perfectly. It results an an announcement of the updated value (since the TextView is update), followed by the SeekBar's progress.
Note: Setting android:accessibilityLiveRegion
to assertive
was appropriate for us because it's less time consuming for a user to rapidly change the SeekBar's progress. Setting it to polite
announces every increment, while assertive
skips unannounced increments to the most recent.

- 1,044
- 11
- 17
Though not the perfect answer, I found this useful method: https://developer.android.com/reference/android/view/View.html#announceForAccessibility(java.lang.CharSequence)
Which basically makes the TalkBack function talk during a specific event. I added this in the OnSeekBarChangeListener to make it "talk" every time I change the value of the slider.

- 381
- 5
- 14
Yes, Its possible.
You said its showing "SeekBar control, 50%" means you are getting percentage.
So, use this percentage to achieve you goal:
int minValue = -4;
int maxValue = 4;
int diff = maxValue - minValue;
int realProgress = minValue + (diff * percentage / 100);
realProgress is your answer.
Hope it will help you!

- 3,152
- 2
- 15
- 21
-
1Not really what I need. I already know this. My problem is that I want the TalkBack function to say the actual value of "zero" or whatsoever, not "50 percent" – mugiwara528 Jan 09 '17 at 06:10
-
-
-
http://stackoverflow.com/questions/3911966/how-to-convert-number-to-words-in-java may helps you – Jagruttam Panchal Jan 09 '17 at 07:00
-
This answer doesn't really answer the original question. This doesn't help talk balk at all. – Pieces Oct 19 '17 at 20:10
-
@Pieces, This question is not about Talkback, real problem is value is coming in percentage and mugiwara wants it in real progress. – Jagruttam Panchal Oct 26 '17 at 10:19
-
1
-
@Pieces, its not about displaying or speaking. Problem is he wants progress value instead progress percentages. First understand the issue then comment over anyone's answer. – Jagruttam Panchal Oct 30 '17 at 05:47
-
1I have the same issue so I do understand the question. You should take your own advice. Look at the second comment under the question. – Pieces Oct 30 '17 at 10:53
-