ComposeView


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

By default, the composition is disposed according to ViewCompositionStrategy.Default. 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.)

ComposeView only supports being added into view hierarchies propagating LifecycleOwner and SavedStateRegistryOwner via androidx.lifecycle.setViewTreeLifecycleOwner and androidx.savedstate.setViewTreeSavedStateRegistryOwner. In most cases you will already have it set up correctly as androidx.activity.ComponentActivity, androidx.fragment.app.Fragment and androidx.navigation.NavController will provide the correct values.

Summary

Nested types

Here to allow extension functions

Public constructors

ComposeView(context: Context, attrs: AttributeSet?, defStyleAttr: Int)
android

Public functions

open Unit

The Jetpack Compose UI content for this view.

android
open CharSequence
android
Unit
setContent(content: @Composable () -> Unit)

Set the Jetpack Compose UI content for this view.

android

Public properties

open CharSequence
android

Protected properties

open Boolean

If true, this View's composition will be created when it becomes attached to a window for the first time.

android

Inherited functions

From androidx.compose.ui.platform.AbstractComposeView
open Unit
addView(child: View?)
android
open Unit
addView(child: View?, index: Int)
android
open Unit
addView(child: View?, params: ViewGroup.LayoutParams?)
android
open Unit
addView(child: View?, index: Int, params: ViewGroup.LayoutParams?)
android
open Unit
addView(child: View?, width: Int, height: Int)
android
open Boolean
addViewInLayout(child: View?, index: Int, params: ViewGroup.LayoutParams?)
android
open Boolean
addViewInLayout(
    child: View?,
    index: Int,
    params: ViewGroup.LayoutParams?,
    preventRequestLayout: Boolean
)
android
Unit

Perform initial composition for this view.

android
Unit

Perform initial composition for this view, even if this view isn't attached to the hierarchy.

android
Unit

Dispose of the underlying composition and requestLayout.

android
open Boolean
android
open Unit
android
final Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)
android
final Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
android
open Unit
onRtlPropertiesChanged(layoutDirection: Int)
android
Unit

Set the CompositionContext that should be the parent of this view's composition.

android
open Unit
setTransitionGroup(isTransitionGroup: Boolean)
android
Unit

Set the strategy for managing disposal of this View's internal composition.

android
open Boolean
android
From android.view.View
Unit
addFocusables(views: ArrayList<View>, direction: Int)
android
Unit
android
Unit
android
Unit
android
ViewPropertyAnimator
android
Unit
android
Unit
android
Unit
android
Boolean
android
Boolean
awakenScrollBars(startDelay: Int)
android
Boolean
awakenScrollBars(startDelay: Int, invalidate: Boolean)
android
Unit
android
Unit
android
Unit
android
Unit
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
Boolean
android
Unit
android
Unit
android
Unit
android
Boolean
android
Unit
android
Unit
android
Unit
android
Int
android
Int
android
Int
android
Unit
android
WindowInsets
android
Int
android
Int
android
Int
android
AccessibilityNodeInfo
android
open Unit
android
Unit
android
Boolean
android
Boolean
dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean)
android
Boolean
dispatchNestedPreFling(velocityX: Float, velocityY: Float)
android
Boolean
dispatchNestedPrePerformAccessibilityAction(
    action: Int,
    arguments: Bundle?
)
android
Boolean
dispatchNestedPreScroll(
    dx: Int,
    dy: Int,
    consumed: IntArray?,
    offsetInWindow: IntArray?
)
android
Boolean
dispatchNestedScroll(
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int,
    offsetInWindow: IntArray?
)
android
Boolean
android
Unit
draw(canvas: Canvas)
android
Unit
android
OnBackInvokedDispatcher?
android
T
<T : View> findViewById(id: Int)
android
T
<T : View> findViewWithTag(tag: Any)
android
Boolean
android
View
focusSearch(direction: Int)
android
Unit
forceHasOverlappingRendering(hasOverlappingRendering: Boolean)
android
Unit
android
Unit
generateDisplayHash(
    hashAlgorithm: String,
    bounds: Rect?,
    executor: Executor,
    callback: DisplayHashResultCallback
)
android
IntArray
android
Boolean
getClipBounds(outRect: Rect)
android
Bitmap
android
Unit
getDrawingRect(outRect: Rect)
android
ArrayList<View>
getFocusables(direction: Int)
android
Unit
android
Boolean
android
Boolean
getGlobalVisibleRect(r: Rect, globalOffset: Point)
android
Unit
getHitRect(outRect: Rect)
android
open Int
@ViewDebug.ExportedProperty(category = "layout", mapping = [@ViewDebug.IntToString(from = 0, to = "RESOLVED_DIRECTION_LTR"), @ViewDebug.IntToString(from = 1, to = "RESOLVED_DIRECTION_RTL")])
getLayoutDirection()
android
Boolean
android
Unit
android
Unit
android
Unit
android
ViewParent
android
open ViewParent
android
Any
getTag(key: Int)
android
open Int
@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "GRAVITY"), @ViewDebug.IntToString(from = 2, to = "TEXT_START"), @ViewDebug.IntToString(from = 3, to = "TEXT_END"), @ViewDebug.IntToString(from = 4, to = "CENTER"), @ViewDebug.IntToString(from = 5, to = "VIEW_START"), @ViewDebug.IntToString(from = 6, to = "VIEW_END")])
getTextAlignment()
android
open Int
@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = 2, to = "ANY_RTL"), @ViewDebug.IntToString(from = 3, to = "LTR"), @ViewDebug.IntToString(from = 4, to = "RTL"), @ViewDebug.IntToString(from = 5, to = "LOCALE"), @ViewDebug.IntToString(from = 6, to = "FIRST_STRONG_LTR"), @ViewDebug.IntToString(from = 7, to = "FIRST_STRONG_RTL")])
getTextDirection()
android
Unit
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Unit
android
Unit
invalidate(dirty: Rect)
android
Unit
invalidate(l: Int, t: Int, r: Int, b: Int)
android
Unit
android
Unit
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
open View
keyboardNavigationClusterSearch(currentCluster: View, direction: Int)
android
Unit
measure(widthMeasureSpec: Int, heightMeasureSpec: Int)
android
Unit
android
Unit
android
Unit
android
Unit
android
WindowInsets
android
Unit
android
Boolean
android
Boolean
android
Unit
android
Unit
android
InputConnection
android
Unit
onCreateViewTranslationRequest(
    supportedFormats: IntArray,
    requestsCollector: Consumer<ViewTranslationRequest>
)
android
Unit
onCreateVirtualViewTranslationRequests(
    virtualIds: LongArray,
    supportedFormats: IntArray,
    requestsCollector: Consumer<ViewTranslationRequest>
)
android
Unit
android
Boolean
android
Unit
onDraw(canvas: Canvas)
android
Unit
android
Unit
android
Boolean
android
Unit
android
Unit
android
Unit
onFocusChanged(
    gainFocus: Boolean,
    direction: Int,
    previouslyFocusedRect: Rect?
)
android
Boolean
android
Unit
android
Boolean
android
Unit
android
Unit
android
Boolean
onKeyDown(keyCode: Int, event: KeyEvent)
android
Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent)
android
Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent)
android
Boolean
onKeyPreIme(keyCode: Int, event: KeyEvent)
android
Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent)
android
Boolean
onKeyUp(keyCode: Int, event: KeyEvent)
android
Unit
onOverScrolled(
    scrollX: Int,
    scrollY: Int,
    clampedX: Boolean,
    clampedY: Boolean
)
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
ContentInfo?
android
Unit
android
Parcelable?
android
Unit
onScreenStateChanged(screenState: Int)
android
Unit
onScrollCaptureSearch(
    localVisibleRect: Rect,
    windowOffset: Point,
    targets: Consumer<ScrollCaptureTarget>
)
android
Unit
onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int)
android
Boolean
onSetAlpha(alpha: Int)
android
Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)
android
Unit
android
Boolean
android
Boolean
android
Unit
android
Unit
android
Unit
android
Unit
onVisibilityChanged(changedView: View, visibility: Int)
android
Unit
onWindowFocusChanged(hasWindowFocus: Boolean)
android
Unit
android
Unit
android
Boolean
overScrollBy(
    deltaX: Int,
    deltaY: Int,
    scrollX: Int,
    scrollY: Int,
    scrollRangeX: Int,
    scrollRangeY: Int,
    maxOverScrollX: Int,
    maxOverScrollY: Int,
    isTouchEvent: Boolean
)
android
Boolean
performAccessibilityAction(action: Int, arguments: Bundle?)
android
Boolean
android
Boolean
android
Boolean
android
Boolean
performHapticFeedback(feedbackConstant: Int)
android
Boolean
android
Boolean
performHapticFeedback(feedbackConstant: Int, flags: Int)
android
Boolean
android
Boolean
android
ContentInfo?
android
Unit
playSoundEffect(soundConstant: Int)
android
Boolean
post(action: Runnable)
android
Boolean
postDelayed(action: Runnable, delayMillis: Long)
android
Unit
android
Unit
postInvalidate(left: Int, top: Int, right: Int, bottom: Int)
android
Unit
postInvalidateDelayed(delayMilliseconds: Long)
android
Unit
postInvalidateDelayed(
    delayMilliseconds: Long,
    left: Int,
    top: Int,
    right: Int,
    bottom: Int
)
android
Unit
android
Unit
postInvalidateOnAnimation(left: Int, top: Int, right: Int, bottom: Int)
android
Unit
android
Unit
postOnAnimationDelayed(action: Runnable, delayMillis: Long)
android
Unit
android
Unit
android
Boolean
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
Boolean
android
Boolean
requestFocus(direction: Int)
android
Boolean
android
open Unit
android
Unit
android
Unit
android
Boolean
android
Boolean
requestRectangleOnScreen(rectangle: Rect, immediate: Boolean)
android
Boolean
requestRectangleOnScreen(rectangle: Rect, immediate: Boolean, source: Int)
android
Unit
android
Unit
android
T
<T : View> requireViewById(id: Int)
android
Unit
android
Unit
android
Unit
saveAttributeDataForStyleable(
    context: Context,
    styleable: IntArray,
    attrs: AttributeSet?,
    t: TypedArray,
    defStyleAttr: Int,
    defStyleRes: Int
)
android
Unit
android
Unit
scheduleDrawable(who: Drawable, what: Runnable, when: Long)
android
Unit
scrollBy(x: Int, y: Int)
android
Unit
scrollTo(x: Int, y: Int)
android
Unit
android
Unit
android
Unit
setAccessibilityDataSensitive(accessibilityDataSensitive: Int)
android
Unit
setAllowClickWhenDisabled(clickableWhenDisabled: Boolean)
android
Unit
android
Unit
android
Unit
setAutofillHints(vararg autofillHints: String)
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
setHandwritingBoundsOffsets(
    offsetLeft: Float,
    offsetTop: Float,
    offsetRight: Float,
    offsetBottom: Float
)
android
Unit
setHasTransientState(hasTransientState: Boolean)
android
Unit
setIsCredential(isCredential: Boolean)
android
Unit
setIsHandwritingDelegate(isHandwritingDelegate: Boolean)
android
Unit
android
Unit
setLayerType(layerType: Int, paint: Paint?)
android
Unit
setLeftTopRightBottom(left: Int, top: Int, right: Int, bottom: Int)
android
Unit
setMeasuredDimension(measuredWidth: Int, measuredHeight: Int)
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
setOnReceiveContentListener(
    mimeTypes: Array<String>?,
    listener: OnReceiveContentListener?
)
android
Unit
android
Unit
android
Unit
android
Unit
setPadding(left: Int, top: Int, right: Int, bottom: Int)
android
Unit
setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int)
android
Unit
android
Unit
setRenderEffect(renderEffect: RenderEffect?)
android
Unit
android
Unit
setScrollIndicators(indicators: Int, mask: Int)
android
Unit
setTag(key: Int, tag: Any)
android
Unit
android
Unit
android
Unit
setWillNotCacheDrawing(willNotCacheDrawing: Boolean)
android
Unit
setWillNotDraw(willNotDraw: Boolean)
android
Boolean
android
Boolean
android
ActionMode
android
ActionMode
android
Unit
android
Boolean
startDrag(
    data: ClipData,
    shadowBuilder: View.DragShadowBuilder,
    myLocalState: Any,
    flags: Int
)
android
Boolean
startDragAndDrop(
    data: ClipData,
    shadowBuilder: View.DragShadowBuilder,
    myLocalState: Any,
    flags: Int
)
android
Boolean
android
Unit
android
open String
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Boolean
android
Boolean
android
Boolean
android
From android.view.ViewGroup
Unit
android
Unit
addExtraDataToAccessibilityNodeInfo(
    info: AccessibilityNodeInfo,
    extraDataKey: String,
    arguments: Bundle?
)
android
Unit
addFocusables(views: ArrayList<View>, direction: Int, focusableMode: Int)
android
Unit
addKeyboardNavigationClusters(
    views: MutableCollection<View>,
    direction: Int
)
android
Boolean
android
Unit
android
Unit
attachLayoutAnimationParameters(
    child: View,
    params: ViewGroup.LayoutParams,
    index: Int,
    count: Int
)
android
Unit
attachViewToParent(child: View, index: Int, params: ViewGroup.LayoutParams)
android
Unit
android
Boolean
android
Boolean
android
Unit
android
Unit
childHasTransientStateChanged(
    child: View,
    childHasTransientState: Boolean
)
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
debug(depth: Int)
android
Unit
android
Unit
android
Unit
android
Unit
detachViewsFromParent(start: Int, count: Int)
android
WindowInsets
android
Boolean
android
Unit
android
Unit
dispatchCreateViewTranslationRequest(
    viewIds: MutableMap<AutofillIdLongArray>,
    supportedFormats: IntArray,
    capability: TranslationCapability,
    requests: MutableList<ViewTranslationRequest>
)
android
Unit
android
Boolean
android
Unit
android
Unit
android
Unit
android
Unit
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Boolean
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
dispatchScrollCaptureSearch(
    localVisibleRect: Rect,
    windowOffset: Point,
    targets: Consumer<ScrollCaptureTarget>
)
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Boolean
android
Boolean
android
Boolean
dispatchUnhandledMove(focused: View, direction: Int)
android
Unit
dispatchVisibilityChanged(changedView: View, visibility: Int)
android
Unit
android
Unit
android
Unit
android
WindowInsets
android
WindowInsetsAnimation.Bounds
android
Unit
android
Unit
android
Boolean
drawChild(canvas: Canvas, child: View, drawingTime: Long)
android
Unit
android
Unit
android
View
android
OnBackInvokedDispatcher?
android
Unit
findViewsWithText(
    outViews: ArrayList<View>,
    text: CharSequence,
    flags: Int
)
android
View
focusSearch(focused: View, direction: Int)
android
Unit
android
Boolean
android
ViewGroup.LayoutParams
android
ViewGroup.LayoutParams
android
ViewGroup.LayoutParams
android
View
getChildAt(index: Int)
android
Int
getChildDrawingOrder(drawingPosition: Int)
android
Int
getChildDrawingOrder(childCount: Int, drawingPosition: Int)
android
Boolean
android
Boolean
getChildVisibleRect(child: View, r: Rect, offset: Point)
android
Boolean
android
Boolean
android
Int
android
Unit
invalidateChild(child: View, dirty: Rect)
android
ViewParent
invalidateChildInParent(location: IntArray, dirty: Rect)
android
Unit
android
Unit
layout(l: Int, t: Int, r: Int, b: Int)
android
Unit
measureChild(
    child: View,
    parentWidthMeasureSpec: Int,
    parentHeightMeasureSpec: Int
)
android
Unit
measureChildWithMargins(
    child: View,
    parentWidthMeasureSpec: Int,
    widthUsed: Int,
    parentHeightMeasureSpec: Int,
    heightUsed: Int
)
android
Unit
measureChildren(widthMeasureSpec: Int, heightMeasureSpec: Int)
android
Unit
notifySubtreeAccessibilityStateChanged(
    child: View,
    source: View,
    changeType: Int
)
android
Unit
android
Unit
android
IntArray
android
Unit
onDescendantInvalidated(child: View, target: View)
android
Unit
android
Boolean
android
Boolean
android
Boolean
onNestedFling(
    target: View,
    velocityX: Float,
    velocityY: Float,
    consumed: Boolean
)
android
Boolean
onNestedPreFling(target: View, velocityX: Float, velocityY: Float)
android
Boolean
onNestedPrePerformAccessibilityAction(
    target: View,
    action: Int,
    args: Bundle?
)
android
Unit
onNestedPreScroll(target: View, dx: Int, dy: Int, consumed: IntArray)
android
Unit
onNestedScroll(
    target: View,
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int
)
android
Unit
onNestedScrollAccepted(child: View, target: View, axes: Int)
android
Boolean
onRequestFocusInDescendants(direction: Int, previouslyFocusedRect: Rect)
android
Boolean
android
PointerIcon
onResolvePointerIcon(event: MotionEvent, pointerIndex: Int)
android
Boolean
onStartNestedScroll(child: View, target: View, nestedScrollAxes: Int)
android
Unit
android
Unit
onViewAdded(child: View)
android
Unit
android
Unit
propagateRequestedFrameRate(frameRate: Float, forceOverride: Boolean)
android
Unit
android
Unit
android
Unit
android
Unit
removeDetachedView(child: View, animate: Boolean)
android
Unit
android
Unit
removeViewAt(index: Int)
android
Unit
android
Unit
removeViews(start: Int, count: Int)
android
Unit
removeViewsInLayout(start: Int, count: Int)
android
Unit
requestChildFocus(child: View, focused: View)
android
Boolean
requestChildRectangleOnScreen(
    child: View,
    rectangle: Rect,
    immediate: Boolean
)
android
Unit
android
Boolean
requestFocus(direction: Int, previouslyFocusedRect: Rect)
android
Boolean
android
Unit
android
Boolean
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
Boolean
android
Boolean
showContextMenuForChild(originalView: View, x: Float, y: Float)
android
ActionMode
startActionModeForChild(
    originalView: View,
    callback: ActionMode.Callback
)
android
ActionMode
startActionModeForChild(
    originalView: View,
    callback: ActionMode.Callback,
    type: Int
)
android
Unit
android
Unit
android
Unit
android
Unit
android
From android.view.ViewParent
Boolean
requestChildRectangleOnScreen(
    child: View,
    rectangle: Rect,
    immediate: Boolean,
    source: Int
)
android

Inherited properties

From androidx.compose.ui.platform.AbstractComposeView
AutoClearFocusBehavior

Controls behavior for how focus should be automatically cleared for this ComposeView when responding to input.

android
Boolean

true if this View is host to an active Compose UI composition.

android
open Boolean
android
Boolean

Enables the display of visual layout bounds for the Compose UI content of this view.

android
From android.view.View
open View.AccessibilityDelegate
android
open Int
android
open AccessibilityNodeProvider
android
open CharSequence?
android
open Int
android
open Int
android
open String?
android
open String?
android
open Float
android
open Animation
android
open Matrix?
android
open IBinder
android
open MutableMap<IntInt>
android
open Array<String>?
android
AutofillId
android
open Int
android
open AutofillValue?
android
open Drawable
android
open BlendMode?
android
open ColorStateList?
android
open PorterDuff.Mode?
android
open Int
android
Int
android
open Float
android
open Int
android
open Float
android
open Rect
android
Boolean
android
ContentCaptureSession?
android
open CharSequence
android
Int
android
Context
android
open ContextMenu.ContextMenuInfo
android
Boolean
android
open Display
android
IntArray
android
open Bitmap
android
open Int
android
open Int
android
open Long
android
open Float
android
open Int
android
open Boolean
android
open Boolean
android
open Int
android
open Drawable
android
open Int
android
open BlendMode?
android
open ColorStateList?
android
open PorterDuff.Mode?
android
open Float
android
open Handler
android
open Float
android
open Float
android
open Float
android
open Float
android
open Int
android
open Runnable?
android
Boolean
android
Int
android
open Int
android
open Int
android
open Drawable?
android
open Drawable?
android
open Int
android
open Int
android
open Int
android
open Int
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open KeyEvent.DispatcherState
android
open Int
android
open Int
android
open Int
android
open ViewGroup.LayoutParams
android
Int
android
open Float
android
open Int
android
open Matrix
android
Int
android
Int
android
Int
android
Int
android
Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open View.OnFocusChangeListener
android
open Int
android
open ViewOutlineProvider
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
final ViewParent
android
open ViewParent
android
OutcomeReceiver<GetCredentialResponseGetCredentialException>?
android
GetCredentialRequest?
android
open Float
android
open Float
android
open PointerIcon
android
MutableList<Rect>
android
open Array<String>?
android
open Float
android
open Resources
android
Boolean
android
Int
android
open Float
android
open Int
android
open AttachedSurfaceControl?
android
open View
android
open WindowInsets
android
open Float
android
open Float
android
open Float
android
open Float
android
open Float
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
open Int
android
Int
android
Int
android
open Int
android
open Int
android
CharSequence?
android
open StateListAnimator
android
open Int
android
open Int
android
open CharSequence?
android
open MutableList<Rect>
android
open Int
android
open Any
android
open Int
android
open Int
android
open CharSequence?
android
Int
android
open Float
android
open Int
android
open TouchDelegate
android
open ArrayList<View>
android
open Float
android
open String
android
open Float
android
open Float
android
open Float
android
open Long
android
open Int
android
open Int
android
open Drawable?
android
open Drawable?
android
open Int
android
open ViewTranslationResponse?
android
open ViewTreeObserver
android
open Int
android
Int
android
open Int
android
open WindowId
android
open WindowInsetsController?
android
open Int
android
open IBinder
android
open Int
android
open Float
android
open Float
android
open Float
android
From android.view.ViewGroup

Public constructors

ComposeView

ComposeView(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Public functions

Content

@Composable
open fun Content(): Unit

The Jetpack Compose UI content for this view. Subclasses must implement this method to provide content. Initial composition will occur when the view becomes attached to a window or when createComposition is called, whichever comes first.

getAccessibilityClassName

open fun getAccessibilityClassName(): CharSequence

setContent

fun setContent(content: @Composable () -> Unit): Unit

Set the Jetpack Compose UI content for this view. Initial composition will occur when the view becomes attached to a window or when createComposition is called, whichever comes first.

Public properties

accessibilityClassName

open val accessibilityClassNameCharSequence

Protected properties

shouldCreateCompositionOnAttachedToWindow

protected open val shouldCreateCompositionOnAttachedToWindowBoolean

If true, this View's composition will be created when it becomes attached to a window for the first time. Defaults to true.

Subclasses may choose to override this property to prevent this eager initial composition in cases where the view's content is not yet ready. Initial composition will still occur when this view is first measured.