Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

ComposeView

class ComposeView : AbstractComposeView
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.compose.ui.platform.AbstractComposeView
   ↳ androidx.compose.ui.platform.ComposeView

A android.view.View that can host Jetpack Compose UI content. Use setContent to supply the content composable function for the view.

This android.view.View requires that the window it is attached to contains a ViewTreeLifecycleOwner. This androidx.lifecycle.LifecycleOwner is used to dispose of the underlying composition when the host Lifecycle is destroyed, permitting the view to be attached and detached repeatedly while preserving the composition. Call disposeComposition to dispose of the underlying composition earlier, or if the view is never initially attached to a window. (The requirement to dispose of the composition explicitly in the event that the view is never (re)attached is temporary.)

Summary

Public constructors
<init>(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

A android.view.View that can host Jetpack Compose UI content.

Public methods
Unit

The Jetpack Compose UI content for this view.

Unit
setContent(content: () -> Unit)

Set the Jetpack Compose UI content for this view.

Inherited functions
Inherited extension functions
From androidx.compose.ui.test.android.view.View
ImageBitmap

Captures the underlying view's surface into bitmap.

From androidx.core.view.android.view.ViewGroup
operator Boolean

Returns true if view is found in this view group.

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

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

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

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

operator View
ViewGroup.get(index: Int)

Returns the view at index.

Boolean

Returns true if this view group contains no views.

Boolean

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

operator MutableIterator<View>

Returns a MutableIterator over the views in this view group.

operator Unit

Removes view from this view group.

operator Unit

Adds view to this view group.

From androidx.core.view.android.view.View
Unit
View.doOnAttach(crossinline action: (view: View) -> Unit)

Performs the given action when this view is attached to a window.

Unit
View.doOnDetach(crossinline action: (view: View) -> Unit)

Performs the given action when this view is detached from a window.

Unit
View.doOnLayout(crossinline action: (view: View) -> Unit)

Performs the given action when this view is laid out.

Unit
View.doOnNextLayout(crossinline action: (view: View) -> Unit)

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

OneShotPreDrawListener
View.doOnPreDraw(crossinline action: (view: View) -> Unit)

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

Bitmap
View.drawToBitmap(config: Config = Bitmap.Config.ARGB_8888)

Return a Bitmap representation of this View.

Runnable
View.postDelayed(delayInMillis: Long, crossinline action: () -> Unit)

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

Runnable
View.postOnAnimationDelayed(delayInMillis: Long, crossinline action: () -> Unit)

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

Unit
View.setPadding(@Px size: Int)

Sets the view's padding.

Unit

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

Unit
View.updateLayoutParams(block: T.() -> Unit)

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

Unit
View.updatePadding(@Px left: Int = paddingLeft, @Px top: Int = paddingTop, @Px right: Int = paddingRight, @Px bottom: Int = paddingBottom)

Updates this view's padding.

Unit
View.updatePaddingRelative(@Px start: Int = paddingStart, @Px top: Int = paddingTop, @Px end: Int = paddingEnd, @Px bottom: Int = paddingBottom)

Updates this view's relative padding.

From androidx.fragment.app.android.view.View
F

Find a Fragment associated with a View.

From androidx.navigation.android.view.View
NavController

Find a NavController associated with a View.

From androidx.lifecycle.android.view.View
LifecycleOwner?

Locates the LifecycleOwner responsible for managing this View, if present.

ViewModelStoreOwner?

Locates the ViewModelStoreOwner associated with this View, if present.

From androidx.savedstate.android.view.View
SavedStateRegistryOwner?

Locates the SavedStateRegistryOwner associated with this View, if present.

From androidx.compose.ui.platform.android.view.ViewGroup
Composition
ViewGroup.setContent(parent: CompositionReference = Recomposer.current(), content: () -> Unit)

Composes the given composable into the given view.

Composition
ViewGroup.setViewContent(parent: CompositionReference = Recomposer.current(), composable: () -> Unit)

Composes the children of the view with the passed in composable.

Inherited properties
Inherited extension properties
From androidx.core.view.android.view.View
Sequence<View>

Returns a Sequence over this view and its descendants recursively.

Sequence<ViewParent>

Returns a Sequence of the parent chain of this view by repeatedly calling View.getParent.

Boolean

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

Boolean

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

Boolean

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

Int</