WindowInsetsAnimation.Callback.OnPrepare(WindowInsetsAnimation) メソッド

定義

インセット アニメーションが開始されようとしているとき、およびアニメーションの終了状態でビューがレイアウトされる前に呼び出されます。

[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

の Java ドキュメント android.view.WindowInsetsAnimation.Callback.onPrepare(android.view.WindowInsetsAnimation)

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象