次の方法で共有


アプリケーションで画面の向きを設定する

Azure Communication Services UI ライブラリを使用すると、開発者はアプリケーションで画面の向きを設定できます。 画面の向きモードは、通話設定画面と UI ライブラリの呼び出し画面で指定できます。

[前提条件]

画面の向きを設定する

詳細については、 オープンソースの Android UI ライブラリサンプル アプリケーション コードを参照してください。

使用可能な向き

次の表に、すぐに使用できる向きの CallCompositeSupportedScreenOrientation の種類を一覧表示します。 複合のさまざまな画面の向きを設定する場合は、 CallCompositeSupportedScreenOrientationCallCompositeに設定します。

方向モード CallCompositeSupportedScreenOrientation 型
PORTRAIT CallCompositeSupportedScreenOrientation.PORTRAIT
LANDSCAPE CallCompositeSupportedScreenOrientation.LANDSCAPE
REVERSE_LANDSCAPE CallCompositeSupportedScreenOrientation.REVERSE_LANDSCAPE
USER_LANDSCAPE CallCompositeSupportedScreenOrientation.USER_LANDSCAPE
FULL_SENSOR CallCompositeSupportedScreenOrientation.FULL_SENSOR
USER CallCompositeSupportedScreenOrientation.USER

オリエンテーションAPI

CallCompositeSupportedScreenOrientation は Android UI ライブラリのカスタム型です。 方向の種類の名前は、Android プラットフォームの向きモードの名前と類似性を維持することによって定義されます。

既定では、セットアップ画面の向きは PORTRAIT モードで、呼び出し元の画面は USER モードです。 画面に別の向きを設定するには、 CallCompositeSupportedScreenOrientation渡します。 すぐに使用できる UI ライブラリには、複合で使用できる一連の CallCompositeSupportedScreenOrientation 型が含まれています。

静的関数CallCompositeSupportedScreenOrientationを使用して、CallCompositeSupportedScreenOrientation.values()型の一覧を取得することもできます。

方向を設定するには、 CallCompositeSupportedScreenOrientation を指定し、 CallCompositeBuilderに渡します。 次の使用例は、セットアップ画面の FULL_SENSOR を設定し、複合の呼び出し元画面の LANDSCAPE を設定します。

import com.azure.android.communication.ui.calling.models.CallCompositeSupportedScreenOrientation

// CallCompositeSupportedLocale provides a list of supported locales
val callComposite: CallComposite =
            CallCompositeBuilder()
            .setupScreenOrientation(CallCompositeSupportedScreenOrientation.FULL_SENSOR)
            .callScreenOrientation(CallCompositeSupportedScreenOrientation.LANDSCAPE)
            .build()

詳細については、 オープンソースの iOS UI ライブラリサンプル アプリケーション コードを参照してください。

使用可能な向き

次の表に、すぐに使用できる向きの OrientationOptions の種類を一覧表示します。 複合のさまざまな画面の向きを設定する場合は、 OrientationOptionsCallCompositeに設定します。

方向モード OrientationOptions 型
portrait OrientationOptions.portrait
landscape OrientationOptions.landscape
landscapeRight OrientationOptions.landscapeRight
landscapeLeft OrientationOptions.landscapeLeft
allButUpsideDown OrientationOptions.allButUpsideDown

オリエンテーションAPI

OrientationOptions は、iOS UI ライブラリのカスタム型です。 向きの種類の名前は、iOS プラットフォームの向きモードの名前と類似性を維持することによって定義されます。

既定では、セットアップ画面の向きは portrait モードで、呼び出し元の画面は allButUpsideDown モードです。 画面に別の向きを設定するには、 OrientationOptions渡します。 すぐに使用できる UI ライブラリには、複合で使用できる一連の OrientationOptions 型が含まれています。


let callCompositeOptions = CallCompositeOptions(localization: localizationConfig,
                                                setupScreenOrientation: OrientationOptions.portrait,
                                                callingScreenOrientation: OrientationOptions.allButUpsideDown)
let callComposite = CallComposite(withOptions: callCompositeOptions)

次のステップ