package com.bonait.bnframework.common.utils;

import android.app.Activity;
import android.util.DisplayMetrics;

public class ScreenUtils {
    /**
     * 是否竖屏
     *
     * @return
     */
    public static boolean IsPortraitScreen(Activity mLauncher) {
        boolean su = false;
        DisplayMetrics dm = new DisplayMetrics();
        mLauncher.getWindowManager().getDefaultDisplay().getMetrics(dm);
        int mWidth = dm.widthPixels;
        int mHeight = dm.heightPixels;
        if (mHeight > mWidth) {//layout port
            // 竖屏 .......
            su = true;
        } else {//layout land
            // 横屏 .......
            su = false;
        }
        return su;
    }
}
