@@ -0,0 +1,1002 @@
+package me.majiajie.https;%0D%0A%0D%0Aimport android.app.Activity;%0D%0Aimport android.util.DisplayMetrics;%0D%0A%0D%0A/**%0D%0A * %E5%B1%8F%E5%B9%95%E7%AA%97%E5%8F%A3%E5%B7%A5%E5%85%B7%E7%B1%BB%0D%0A */%0D%0Apublic class WindowUtil%0D%0A%7B%0D%0A    private WindowUtil()%7B%7D%0D%0A%0D%0A    /**%0D%0A     * %E8%8E%B7%E5%8F%96%E5%B1%8F%E5%B9%95%E9%AB%98%E5%BA%A6PX%0D%0A     */%0D%0A    public static int getHeight(Activity activity)%0D%0A    %7B%0D%0A        return getDisplayMetrics(activity).heightPixels;%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * %E8%8E%B7%E5%8F%96%E5%B1%8F%E5%B9%95%E5%AE%BD%E5%BA%A6PX%0D%0A     */%0D%0A    public static int getWidth(Activity activity)%0D%0A    %7B%0D%0A        return getDisplayMetrics(activity).widthPixels;%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * %E8%8E%B7%E5%8F%96%E5%B1%8F%E5%B9%95%E5%AE%BD%E5%BA%A6%E5%92%8C%E9%AB%98%E5%BA%A6,%5B0%5D%E5%AE%BD%EF%BC%8C%5B1%5D%E9%AB%98%0D%0A     */%0D%0A    public static int%5B%5D getWidthAndHeight(Activity activity)%0D%0A    %7B%0D%0A        return new int%5B%5D%7BgetDisplayMetrics(activity).widthPixels,%0D%0A                getDisplayMetrics(activity).heightPixels%7D;%0D%0A    %7D%0D%0A%0D%0A    private static DisplayMetrics getDisplayMetrics(Activity activity)%0D%0A    %7B%0D%0A        DisplayMetrics metrics = new DisplayMetrics();%0D%0A        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);%0D%0A        return metrics;%0D%0A    %7D%0D%0A%0D%0A%0D%0A%7D%0D%0A

add windowUtil