Package-level declarations

Properties

Link copied to clipboard

Returns a Sequence over this view and its descendants recursively. This is a depth-first traversal similar to View.findViewById. A view with no children will return a single-element sequence of itself.

Link copied to clipboard

Returns a Sequence of the parent chain of this view by repeatedly calling View.getParent. An unattached view will return a zero-element sequence.

Link copied to clipboard

Returns a Sequence over the items in this menu.

Returns a Sequence over the immediate child views in this view group.

Link copied to clipboard

Returns a Sequence over the child views in this view group recursively.

Link copied to clipboard

Returns an IntRange of the valid indices for the children of this view group.

Link copied to clipboard

Returns true when this view's visibility is View.GONE, false otherwise.

Link copied to clipboard

Returns true when this view's visibility is View.INVISIBLE, false otherwise.

Link copied to clipboard

Returns true when this view's visibility is View.VISIBLE, false otherwise.

Link copied to clipboard

Returns the bottom margin if this view's ViewGroup.LayoutParams is a ViewGroup.MarginLayoutParams, otherwise 0.

Link copied to clipboard

Returns the end margin if this view's ViewGroup.LayoutParams is a ViewGroup.MarginLayoutParams, otherwise 0.

Link copied to clipboard

Returns the left margin if this view's ViewGroup.LayoutParams is a ViewGroup.MarginLayoutParams, otherwise 0.

Link copied to clipboard

Returns the right margin if this view's ViewGroup.LayoutParams is a ViewGroup.MarginLayoutParams, otherwise 0.

Link copied to clipboard

Returns the start margin if this view's ViewGroup.LayoutParams is a ViewGroup.MarginLayoutParams, otherwise 0.

Link copied to clipboard

Returns the top margin if this view's ViewGroup.LayoutParams is a ViewGroup.MarginLayoutParams, otherwise 0.

Link copied to clipboard

Returns the number of items in this menu.

Returns the number of views in this view group.

Functions

Link copied to clipboard
operator fun Menu.contains(item: MenuItem): Boolean

Returns true if item is found in this menu.

inline operator fun ViewGroup.contains(view: View): Boolean

Returns true if view is found in this view group.

Link copied to clipboard
inline fun View.doOnAttach(crossinline action: (view: View) -> Unit)

Performs the given action when this view is attached to a window. If the view is already attached to a window the action will be performed immediately, otherwise the action will be performed after the view is next attached.

Link copied to clipboard
inline fun View.doOnDetach(crossinline action: (view: View) -> Unit)

Performs the given action when this view is detached from a window. If the view is not attached to a window the action will be performed immediately, otherwise the action will be performed after the view is detached from its current window.

Link copied to clipboard
inline fun View.doOnLayout(crossinline action: (view: View) -> Unit)

Performs the given action when this view is laid out. If the view has been laid out and it has not requested a layout, the action will be performed straight away, otherwise the action will be performed after the view is next laid out.

Link copied to clipboard
inline fun View.doOnNextLayout(crossinline action: (view: View) -> Unit)

Performs the given action when this view is next laid out.

Link copied to clipboard
inline fun View.doOnPreDraw(crossinline action: (view: View) -> Unit): OneShotPreDrawListener

Performs the given action when the view tree is about to be drawn.

Link copied to clipboard
fun View.drawToBitmap(config: Bitmap.Config = Bitmap.Config.ARGB_8888): Bitmap

Return a Bitmap representation of this View.

Link copied to clipboard
inline fun Menu.forEach(action: (item: MenuItem) -> Unit)

Performs the given action on each item in this menu.

inline fun ViewGroup.forEach(action: (view: View) -> Unit)

Performs the given action on each view in this view group.

Link copied to clipboard
inline fun Menu.forEachIndexed(action: (index: Int, item: MenuItem) -> Unit)

Performs the given action on each item in this menu, providing its sequential index.

inline fun ViewGroup.forEachIndexed(action: (index: Int, view: View) -> Unit)

Performs the given action on each view in this view group, providing its sequential index.

Link copied to clipboard
inline operator fun Menu.get(index: Int): MenuItem

Returns the menu at index.

operator fun ViewGroup.get(index: Int): View

Returns the view at index.

Link copied to clipboard
inline fun Menu.isEmpty(): Boolean

Returns true if this menu contains no items.

inline fun ViewGroup.isEmpty(): Boolean

Returns true if this view group contains no views.

Link copied to clipboard
inline fun Menu.isNotEmpty(): Boolean

Returns true if this menu contains one or more items.

Returns true if this view group contains one or more views.

Link copied to clipboard

Returns a MutableIterator over the items in this menu.

Returns a MutableIterator over the views in this view group.

Link copied to clipboard
inline operator fun Menu.minusAssign(item: MenuItem)

Removes item from this menu.

inline operator fun ViewGroup.minusAssign(view: View)

Removes view from this view group.

Link copied to clipboard
inline operator fun ViewGroup.plusAssign(view: View)

Adds view to this view group.

Link copied to clipboard
inline fun View.postDelayed(delayInMillis: Long, crossinline action: () -> Unit): Runnable

Version of View.postDelayed which re-orders the parameters, allowing the action to be placed outside of parentheses.

Link copied to clipboard
fun View.postOnAnimationDelayed(delayInMillis: Long, action: () -> Unit): Runnable

Version of View.postOnAnimationDelayed which re-orders the parameters, allowing the action to be placed outside of parentheses.

Link copied to clipboard
inline fun Menu.removeItemAt(index: Int)

Removes the menu item at the specified index.

Link copied to clipboard

Sets the margins in the ViewGroup's MarginLayoutParams. This version of the method sets all axes to the provided size.

Link copied to clipboard
inline fun View.setPadding(@Px size: Int)

Sets the view's padding. This version of the method sets all axes to the provided size.

Link copied to clipboard
@JvmName(name = "updateLayoutParamsTyped")
inline fun <T : ViewGroup.LayoutParams> View.updateLayoutParams(block: T.() -> Unit)

Executes block with a typed version of the View's layoutParams and reassigns the layoutParams with the updated version.

Executes block with the View's layoutParams and reassigns the layoutParams with the updated version.

Link copied to clipboard
inline fun ViewGroup.MarginLayoutParams.updateMargins(@Px left: Int = leftMargin, @Px top: Int = topMargin, @Px right: Int = rightMargin, @Px bottom: Int = bottomMargin)

Updates the margins in the ViewGroup's ViewGroup.MarginLayoutParams. This version of the method allows using named parameters to just set one or more axes.

Link copied to clipboard
inline fun ViewGroup.MarginLayoutParams.updateMarginsRelative(@Px start: Int = marginStart, @Px top: Int = topMargin, @Px end: Int = marginEnd, @Px bottom: Int = bottomMargin)

Updates the relative margins in the ViewGroup's MarginLayoutParams. This version of the method allows using named parameters to just set one or more axes.

Link copied to clipboard
inline fun View.updatePadding(@Px left: Int = paddingLeft, @Px top: Int = paddingTop, @Px right: Int = paddingRight, @Px bottom: Int = paddingBottom)

Updates this view's padding. This version of the method allows using named parameters to just set one or more axes.

Link copied to clipboard
inline fun View.updatePaddingRelative(@Px start: Int = paddingStart, @Px top: Int = paddingTop, @Px end: Int = paddingEnd, @Px bottom: Int = paddingBottom)

Updates this view's relative padding. This version of the method allows using named parameters to just set one or more axes.