WindowInsetsAnimation.Callback.OnPrepare(WindowInsetsAnimation) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
インセット アニメーションが開始されようとしているとき、およびアニメーションの終了状態でビューがレイアウトされる前に呼び出されます。
[Android.Runtime.Register("onPrepare", "(Landroid/view/WindowInsetsAnimation;)V", "GetOnPrepare_Landroid_view_WindowInsetsAnimation_Handler", ApiSince=30)]
public virtual void OnPrepare (Android.Views.WindowInsetsAnimation animation);
[<Android.Runtime.Register("onPrepare", "(Landroid/view/WindowInsetsAnimation;)V", "GetOnPrepare_Landroid_view_WindowInsetsAnimation_Handler", ApiSince=30)>]
abstract member OnPrepare : Android.Views.WindowInsetsAnimation -> unit
override this.OnPrepare : Android.Views.WindowInsetsAnimation -> unit
パラメーター
- animation
- WindowInsetsAnimation
開始しようとしているアニメーション。
- 属性
注釈
インセット アニメーションが開始されようとしているとき、およびアニメーションの終了状態でビューがレイアウトされる前に呼び出されます。 インセット アニメーション中のイベントの順序は次のとおりです。
<ul>li Application calls WindowInsetsController#hide(int)
, WindowInsetsController#show(int)
, , WindowInsetsController#controlWindowInsetsAnimation
</li li>><onPrepare is called on the view hierarchy listeners</li li><View#onApplyWindowInsets
> will be called with the end state of the animation</li li>><View hierarchy gets laid out according the changes the application has due to the new insets being dispatched</li><li>#onStart
is called <em>before</em>><ビュー階層は、アニメーション開始状態/li li>#onProgress
フレームが描画された直後に、新しいレイアウト状態<</li><li<>>が呼び出されて描画されます。</li></ul>
この順序により、アプリケーションはアニメーションの完了後に終了状態を検査し、 や 関連するメソッドなどのView#setX
レイアウト後ビュー プロパティを使用して、最初#onProgress
のコールバックでアニメーションの開始状態に戻すことができます。
アニメーションがディスパッチされる前に #onStart
取り消される可能性があることに注意してください。 以降 android.os.Build.VERSION_CODES#S S
では、 #onEnd
は、その場合は なしで #onStart
すぐにディスパッチされます。 では android.os.Build.VERSION_CODES#R R
、このようなアニメーションの 後 #onPrepare
にコールバックはディスパッチされません。
注: アニメーションが を使用WindowInsetsController#controlWindowInsetsAnimation
して制御されるアプリケーションの場合、アニメーションの終了状態は未定義です。これは、 を呼び出WindowInsetsAnimationController#finish
すときに パラメーターを渡shown
すことによってのみ、アプリケーションが終了状態を決定する場合があるためです。 この状況では、システムは、アニメーションが開始される前に、逆の可視性の状態でインセットをディスパッチします。 例: を使用して入力メソッドWindowInsetsController#controlWindowInsetsAnimation
を制御し、入力メソッドが現在表示されている場合、 View#onApplyWindowInsets
に対WindowInsets.Type#ime
して を返false
す インスタンスをWindowInsets#isVisible
受け取りますWindowInsets
。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。