MasayukiSuda/BubbleLayout

Issue in showing BubbleLayout in 7.0 OS

hshah67 opened this issue · 3 comments

os_7_0

OS_7_0

Issue in showing bubble layout
os_6_0

OS_6_0

Will you paste the code you wrote here?

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.

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