屏幕信息
可以通过 ScreenInfo
组件获取有关设备屏幕状态的详细信息。
getHinge - 返回 Rect 对象中的铰链的坐标。
fun getHinge(context: Context): Rect?
isSurfaceDuoDevice - 检查设备是否为 Surface Duo。
fun isSurfaceDuoDevice(context: Context): Boolean
getWindowRect - 返回整个设备窗口的坐标。
fun getWindowRect(context: Context): Rect
getScreenRectangles - 返回设备的两个屏幕的坐标。
fun getScreenRectangles(context: Context): List<Rect>?
isDualMode - 检查应用程序是否处于双屏模式下。
fun isDualMode(context: Context): Boolean
getCurrentRotation - 返回屏幕的旋转的常量证书。
根据旋转角度,函数将返回:Surface.ROTATION_0
、Surface.ROTATION_90
、Surface.ROTATION_180
、Surface.ROTATION_270
。
fun getCurrentRotation(context: Context): Int