IWindowInsetsAnimationController.SetInsetsAndAlpha Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Modifies the insets for the frame being drawn by indirectly moving the windows around in the system that are causing window insets.
[Android.Runtime.Register("setInsetsAndAlpha", "(Landroid/graphics/Insets;FF)V", "GetSetInsetsAndAlpha_Landroid_graphics_Insets_FFHandler:Android.Views.IWindowInsetsAnimationControllerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=30)]
public void SetInsetsAndAlpha (Android.Graphics.Insets? insets, float alpha, float fraction);
[<Android.Runtime.Register("setInsetsAndAlpha", "(Landroid/graphics/Insets;FF)V", "GetSetInsetsAndAlpha_Landroid_graphics_Insets_FFHandler:Android.Views.IWindowInsetsAnimationControllerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=30)>]
abstract member SetInsetsAndAlpha : Android.Graphics.Insets * single * single -> unit
Parameters
- insets
- Insets
The new insets to apply. Based on the requested insets, the system will
calculate the positions of the windows in the system causing insets such that
the resulting insets of that configuration will match the passed in parameter.
Note that these insets are being clamped to the range from
#getHiddenStateInsets
to #getShownStateInsets
.
If you intend on changing alpha only, pass null or #getCurrentInsets()
.
- alpha
- Single
The new alpha to apply to the inset side.
- fraction
- Single
instantaneous animation progress. This value is dispatched to
WindowInsetsAnimation.Callback
.
- Attributes
Remarks
Modifies the insets for the frame being drawn by indirectly moving the windows around in the system that are causing window insets.
Note that these insets are always relative to the window, which is the same as being relative to View#getRootView
Also note that this will <b>not</b> inform the view system of a full inset change via View#dispatchApplyWindowInsets
in order to avoid a full layout pass during the animation. If you'd like to animate views during a window inset animation, register a WindowInsetsAnimation.Callback
by calling View#setWindowInsetsAnimationCallback(WindowInsetsAnimation.Callback)
that will be notified about any insets change via WindowInsetsAnimation.Callback#onProgress
during the animation.
View#dispatchApplyWindowInsets
will instead be called once the animation has finished, i.e. once #finish
has been called. Note: If there are no insets, alpha animation is still applied.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.