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 應用程式呼叫 <, >, /WindowInsetsController#hide(int)WindowInsetsController#show(int)liWindowInsetsController#controlWindowInsetsAnimation<li>li onPrepare 在檢視階層中被呼叫 監聽者</li><li>< 將被呼叫,並伴隨動畫>的最終狀態/liView#onApplyWindowInsets<li>視圖階層會根據應用程式因新嵌入詞的調度<而要求的變更來佈局/li><li>< 稱為 >em#onStartbefore</em><>視圖階層會在新的佈局<狀態/Li><>#onProgress Li 被立即呼叫,並使用 animation start state</li><LI>畫出畫面。</li></ul>
這種排序方式允許應用程式在動畫結束後檢查結束狀態,然後利用後置檢視屬性(如#onProgress及相關方法)在第一次View#setX回調時回復動畫的起始狀態。
請注意,動畫可能會在派遣前 #onStart 被取消。 在android.os.Build.VERSION_CODES#S S那種情況下,#onEnd會立即被派遣,沒有任何。#onStart 在 android.os.Build.VERSION_CODES#R R上,之後不會為 #onPrepare 此動畫發送回調。
注意:若動畫由應用程式控制WindowInsetsController#controlWindowInsetsAnimation,則動畫的結束狀態未定義,因為應用程式可能僅透過呼叫shownWindowInsetsAnimationController#finish參數來決定結束狀態。 在這種情況下,系統會在動畫開始前,將嵌入圖調度為相反的可見度狀態。 範例:當以 控制輸入WindowInsetsController#controlWindowInsetsAnimation法時,輸入法目前顯示View#onApplyWindowInsets,將接收WindowInsets一個實例,該WindowInsets#isVisible實例會回傳 false 。WindowInsets.Type#ime
Java 文件 android.view.WindowInsetsAnimation.Callback.onPrepare(android.view.WindowInsetsAnimation)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。