Issue in showing BubbleLayout in 7.0 OS
hshah67 opened this issue · 3 comments
hshah67 commented
MasayukiSuda commented
Will you paste the code you wrote here?
hshah67 commented
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 commented
@hshah67 @MasayukiSuda
How to give margin from right to bubble view .