View Utils
Utils class for custom views.
Types
Link copied to clipboard
interface OnApplyWindowInsetsListener
Wrapper around androidx.core.view.OnApplyWindowInsetsListener which also passes the initial padding set on the view.
Link copied to clipboard
Simple data object to store the initial padding for a view.
Functions
Link copied to clipboard
open fun addOnGlobalLayoutListener(@Nullable view: View, @NonNull victim: ViewTreeObserver.OnGlobalLayoutListener)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun doOnApplyWindowInsets(@NonNull view: View, @NonNull listener: ViewUtils.OnApplyWindowInsetsListener)
Wrapper around androidx.core.view.OnApplyWindowInsetsListener that records the initial padding of the view and requests that insets are applied when attached.
open fun doOnApplyWindowInsets(@NonNull view: View, @Nullable attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int)
open fun doOnApplyWindowInsets(@NonNull view: View, @Nullable attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int, @Nullable listener: ViewUtils.OnApplyWindowInsetsListener)
Wrapper around androidx.core.view.OnApplyWindowInsetsListener that can automatically apply inset padding based on view attributes.
Link copied to clipboard
Returns the color if it can be retrieved from the
view
's background drawable, or null otherwise.Link copied to clipboard
Link copied to clipboard
Returns the content view that is the parent of the provided view.
Link copied to clipboard
Returns the content view overlay that can be used to add drawables on top of all other views.
Link copied to clipboard
Backward-compatible getOverlay.
Link copied to clipboard
Returns the absolute elevation of the parent of the provided
view
, or in other words, the sum of the elevations of all ancestors of the view
.Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun removeOnGlobalLayoutListener(@Nullable view: View, @NonNull victim: ViewTreeObserver.OnGlobalLayoutListener)
open fun removeOnGlobalLayoutListener(@NonNull viewTreeObserver: ViewTreeObserver, @NonNull victim: ViewTreeObserver.OnGlobalLayoutListener)
Link copied to clipboard
Requests that insets should be applied to this view once it is attached.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard