public static int getScreenWidth(Context context) {
        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        if (wm == null) {
            return -1;
        }
        Point point = new Point();
        wm.getDefaultDisplay().getRealSize(point);
        return point.x;
    }
Return the width of screen, in pixel.

@return the width of screen, in pixel
imitate/src/main/java/com/engineer/imitate/util/ScreenUtils.java