kyleduo/BlurPopupWindow

When screen size is varies means BlurPopup window background is not fully covered.

Opened this issue · 1 comments

There is an height issue. When screen size is varies means BlurPopup window background is not fully covered.

Attached screenshot for reference. Kindly do needful. Thank You.

Screenshot_2019-06-24-12-48-25-649_com obs littlebird

I have fixed it with the following code.

In BlurPopupWindow class I have modified the following method

actually the navigation height was coming to big. So I have fixed with following code.

private static int getNaviHeight(Activity activity) {
        if (activity == null) {
            return 0;
        }
        Display display = activity.getWindowManager().getDefaultDisplay();
        int contentHeight = activity.getResources().getDisplayMetrics().heightPixels;
        int realHeight = 0;
        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            final DisplayMetrics metrics = new DisplayMetrics();
            display.getRealMetrics(metrics);
            realHeight = metrics.heightPixels;
        } else {
            try {
                Method mGetRawH = Display.class.getMethod("getRawHeight");
                realHeight = (Integer) mGetRawH.invoke(display);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (contentHeight == realHeight) {
            return 0;
        }
        int navigationBarHeight = 0;
        int resourceId = activity.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
        if (resourceId > 0) {
            navigationBarHeight = activity.getResources().getDimensionPixelSize(resourceId);
        }
        return navigationBarHeight;
        //return realHeight - contentHeight;
    }