Closed mrfix1t closed 8 years ago
I think I've done a simpler (and maybe better?) fix in commit ae1b758387c3ff3c0ea695fb9054cce6fedae352
Thanks!
Well it also fixes the issue. But from my point of view it's little overhead and overkill to reinit display metrics every time Popup indicator is showing.
We're not "reinit-ing" anything. getResources is a simple getter (return mResources) and getDisplayMetrics is a nother simple getter (return mMetrics) so I don't see the overhead you're referring to.
Well, yes, it's simple getter. But we don't need to do this each time before show indicator. We need to set new display metrics in only one case, when parent view onSizeChanged method is calling (because of redrawing). In other cases length of seekbar is remains unchanged, so older display metrics is ok. So, I think my solution is bit cleaner.
As I said, we're not creating new DisplayMetrics or new "anything", we're just reading the screen size when we need it.
Fix for issue https://github.com/AnderWeb/discreteSeekBar/issues/53. In some cases, (ex. when activity containing seekBar don't recreate on rotations), PopupIndicator don't know about new display metrics, that causes indicator cut behavior when rotate from vertical layout to horizontal. To fix that, now PopupIndicator metrics initialized during onSizeChange state of SeekBar.