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

Issue in showing BubbleLayout in 7.0 OS #7

Open
hshah67 opened this issue Jun 15, 2017 · 3 comments
Open

Issue in showing BubbleLayout in 7.0 OS #7

hshah67 opened this issue Jun 15, 2017 · 3 comments

Comments

@hshah67
Copy link

hshah67 commented Jun 15, 2017

os_7_0

OS_7_0

Issue in showing bubble layout
os_6_0

OS_6_0

@MasayukiSuda
Copy link
Owner

Will you paste the code you wrote here?

@hshah67
Copy link
Author

hshah67 commented Jun 15, 2017

getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@OverRide
public void onGlobalLayout() {

            int calculatedGravity = mGravity;
            if (calculatedGravity == GRAVITY_AUTO) {

                if (getHeight() < getMaxAvailableTopHeight(anchor)) {
                    calculatedGravity = GRAVITY_TOP;
                } else {
                    calculatedGravity = GRAVITY_BOTTOM;
                }
            }

            int x, y;
            int[] locationOnScreen = new int[2];
            anchor.getLocationOnScreen(locationOnScreen);
            if (calculatedGravity == GRAVITY_TOP) {
                **y = locationOnScreen[1] - getHeight();**
                setArrowDirection(ArrowDirection.BOTTOM);
            } else {
                y = locationOnScreen[1] + anchor.getHeight();
                setArrowDirection(ArrowDirection.TOP);
            }

            x = calculateXAndSetArrowPosition(anchor);

            mPopupWindow.update(x, y, -1, -1);
            getViewTreeObserver().removeOnGlobalLayoutListener(this);
        }
    });

here isssue is in getHeight().
in both device we are getting different value for getHeight() for bubblelayout.

@pj210493
Copy link

@hshah67 @MasayukiSuda
How to give margin from right to bubble view .

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

3 participants