画面情報

注意事項

このコンポーネントは非推奨とされており、現在はサポートされていません。

表示領域と折りたたみ機能に関する情報を取得するには、Jetpack Window Manager を使用する必要があります。

または、デュアルスクリーンおよび折りたたみ型デバイスに自動的に適応できる、これらのデュアルスクリーン コントロールとレイアウトのいずれかを使用します。

ScreenInfo コンポーネントを使用すると、デバイスの画面の状態に関する詳細を取得できます。

getHinge - Rect オブジェクト内の Hinge の座標を返します。

  • fun ​getHinge​(context: Context): Rect?

isSurfaceDuoDevice - デバイスが Surface Duo であるかどうかを確認します。

  • fun isSurfaceDuoDevice(context: Context): Boolean

getWindowRect - デバイス ウィンドウ全体の座標を返します。

  • fun getWindowRect(context: Context): Rect

getScreenRectangles - デバイスの 2 つの画面の座標を返します。

  • fun ​getScreenRectangles​(context: Context): List<Rect>?

​isDualMode​ - アプリケーションがデュアルスクリーン モードであるかどうかを確認します。

  • fun ​isDualMode​(context: Context): Boolean

​getCurrentRotation​ - 画面の回転を表す定数 int を返します。 関数によって返される回転に応じて、Surface.​ROTATION_0Surface.ROTATION_90Surface.ROTATION_180Surface.ROTATION_270 を返します。

  • fun ​getCurrentRotation​(context: Context): Int