Java Code Examples for com.blankj.utilcode.util.ScreenUtils#getScreenHeight()

The following examples show how to use com.blankj.utilcode.util.ScreenUtils#getScreenHeight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditNotePresenter.java    From SuperNote with GNU General Public License v3.0 5 votes vote down vote up
@Override
public int getNoteEditNeedHeight() {
    // 屏幕高度减去 状态栏高度、toolbar高度、底部工具栏高度
    float height = ScreenUtils.getScreenHeight() - ThemeUtils.getStatusBarHeight()
            - SizeUtils.dp2px(56) - SizeUtils.dp2px(48);
    return (int) height;
}
 
Example 2
Source File: EverywherePopup.java    From EasyPopup with Apache License 2.0 5 votes vote down vote up
/**
     * 自适应触摸点 弹出
     * @param parent
     * @param touchX
     * @param touchY
     * @return
     */
    public EverywherePopup showEverywhere(View parent,int touchX, int touchY) {
//        if (isRealWHAlready()) {
            int screenHeight = ScreenUtils.getScreenHeight();
            int screenWidth = ScreenUtils.getScreenWidth();
            int offsetX=touchX;
            int offsetY=touchY;
            if (touchX<getWidth() && screenHeight-touchY<getHeight()){
                //左下弹出动画
                getPopupWindow().setAnimationStyle(R.style.LeftBottomPopAnim);
                offsetY=touchY-getHeight();
            }else if (touchX+getWidth()>screenWidth && touchY+getHeight()>screenHeight){
                //右下弹出动画
                getPopupWindow().setAnimationStyle(R.style.RightBottomPopAnim);
                offsetX=(touchX-getWidth());
                offsetY=touchY-getHeight();
            }else if (touchX+getWidth()>screenWidth){
                getPopupWindow().setAnimationStyle(R.style.RightTopPopAnim);
                offsetX=(touchX-getWidth());
            }else {
                getPopupWindow().setAnimationStyle(R.style.LeftTopPopAnim);
            }

            showAtLocation(parent, Gravity.NO_GRAVITY,offsetX,offsetY);
//        }
        return this;
    }
 
Example 3
Source File: DeviceInfoItem.java    From AndroidUtilCode with Apache License 2.0 4 votes vote down vote up
private static String getScreenInfo() {
    return "width=" + ScreenUtils.getScreenWidth() +
            ", height=" + ScreenUtils.getScreenHeight() +
            ", density=" + ScreenUtils.getScreenDensity();
}