package com.wmdigit.wmposdemo.utils;

import android.content.Context;
import android.content.res.Configuration;

public class ScreenUtils {
    public static boolean isScreenLandscape(Context context) {
        Configuration mConfiguration = context.getResources().getConfiguration(); //获取设置的配置信息
        int ori = mConfiguration.orientation ; //获取屏幕方向
        if(ori == Configuration.ORIENTATION_LANDSCAPE){
            //横屏
            return true;
        }else if(ori == Configuration.ORIENTATION_PORTRAIT){
            //竖屏
            return false;
        }
        return false;
    }
}
