AnderWeb / discreteSeekBar

Apache License 2.0
2.11k stars 400 forks source link

Seekbar String Transform updated wrong. #34

Closed PaulWoitaschek closed 8 years ago

PaulWoitaschek commented 9 years ago

When using setNumericTransformer with a custom transformToString, the library probes for the max and determines the size of the bubble by a call to mIndicator.updateSizes using the current max value. The problem is that if setNumericTransformer is called on initialization, the max has not been set and thus is 100. So the bubble has the wrong size. Also when you later change your seekbars max value, the value does not get updated and the bubble stays at the wrong size. So my suggestion is to simply update the indicator size by a call on mIndicator.updateSizes in setMax.

AnderWeb commented 8 years ago

When you call setNumericTransformer() the max has already been set from the constructor so it will always use the current max value. Anything else I'm missing there?

The second part, changing the max value in a later time is true and I can fix it by calling updateSizes as you suggest.