Code example for PopupWindow

Methods: getHeightgetWidthupdate

            int anchorX, int anchorY, int anchorWidth, int anchorHeight) {
        RectF anchor = makePixRectInScreen(
                contentViewCore, anchorX, anchorY, anchorWidth, anchorHeight);
        Point origin = adjustWindowPosition(
                contentViewCore, (int) (anchor.centerX() - getAnchorOffset()), (int) anchor.bottom);
        mPopup.update(origin.x, origin.y, mPopup.getWidth(), mPopup.getHeight());
    private static RectF makePixRectInScreen(ContentViewCore contentViewCore,
            int anchorX, int anchorY, int anchorWidth, int anchorHeight) {
        final RenderCoordinates coordinates = contentViewCore.getRenderCoordinates();
        final float yOffset = getWebViewOffsetYPixInScreen(contentViewCore);
        return new RectF(
                coordinates.fromLocalCssToPix(anchorY) + yOffset,
                coordinates.fromLocalCssToPix(anchorX + anchorWidth),
                coordinates.fromLocalCssToPix(anchorY + anchorHeight) + yOffset);
    private static float getWebViewOffsetYPixInScreen(ContentViewCore contentViewCore) {
Connect your IDE to all the code out there  Get Codota for Java