Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong position of hint if popupWidth is not specified #2

Open
traninho opened this issue Mar 12, 2015 · 0 comments
Open

Wrong position of hint if popupWidth is not specified #2

traninho opened this issue Mar 12, 2015 · 0 comments

Comments

@traninho
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant