SeekBarHint
SeekBarHint copied to clipboard
Wrong position of hint if `popupWidth` is not specified
Hi,
first of all, thank you for the widget. I have found out that the widget shows the popup at wrong position if popupWidth
is not specified.
private float getXPosition(SeekBar seekBar){
float val = (((float)seekBar.getProgress() * (float)(seekBar.getWidth() - 2 * seekBar.getThumbOffset())) / seekBar.getMax());
float offset = seekBar.getThumbOffset();
int textWidth = mPopupWidth;
float textCenter = (textWidth/2.0f);
float newX = val+offset - textCenter;
return newX;
}
The problem is that if you not specify popupWidth then mPopupWidth
will have LayoutParam.WRAP_CONTENT
set (a value is -2) and textCenter will be -1.