narendrakothamire / android-binding

Automatically exported from code.google.com/p/android-binding
0 stars 0 forks source link

Add binding support for SeekBar.progress property #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, it is impossible to bind to the progress property of a SeekBar. 
While it is possible to bind to the SeekBar's current position by implementing 
a Command that binds to onSeekBarChange, it would be more natural to bind 
directly to the progress property.

Original issue reported on code.google.com by bspe...@gmail.com on 5 Apr 2013 at 9:28

GoogleCodeExporter commented 8 years ago
SeekBar is a subclass of progress bar, that means, "progress" attribute is also 
defined for seek bar. 

Original comment by gueei....@gmail.com on 3 May 2013 at 2:24

GoogleCodeExporter commented 8 years ago
For one-way binding, I agree. However, if you bind an observable integer to the 
SeekBar, the integer won't be updated when the user changes the bar position. 
This appears to be caused to the SeekBar.createAttributeForView override, which 
does not call ProgressBar.createAttributeForView nor register the progress 
bar's attributes for input binding. I ended up forking the project and 
modifying this method to call the base class version instead of returning null 
at the end, which appears to work.

This can be reproduced easily by binding an observable integer to the progress 
attribute on both a SeekBar and a ProgressBar. Then, the progress bar should 
track the movement of the seek bar.

Original comment by bspe...@gmail.com on 3 May 2013 at 3:31