Google is committed to advancing racial equity for Black communities. See how.

AndroidViewHolder

abstract class AndroidViewHolder : ViewGroup
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.compose.ui.viewinterop.AndroidViewHolder

A base class used to host a View inside Compose. This API is not designed to be used directly, but rather using the AndroidView and AndroidViewBinding APIs, which are built on top of AndroidViewHolder.

Summary

Public constructors
<init>(context: Context)

A base class used to host a View inside Compose.

Public methods
open LayoutParams?

open Unit

Protected methods
open Unit

open Unit

open Unit
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Inherited extension functions
From androidx.ui.test.android.view.View
Bitmap

Captures the underlying view's surface into bitmap.

From androidx.compose.ui.platform.android.view.ViewGroup
Composition
ViewGroup.setContent(recomposer: Recomposer, parentComposition: CompositionReference? = null, content: () -> Unit)

Composes the given composable into the given view.

Composition
ViewGroup.setContent(content: () -> Unit)

Composes the given composable into the given view.

Composition
ViewGroup.setViewContent(parent: CompositionReference? = null, composable: () -> Unit)

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

Properties
Density

The screen density of the layout.

Modifier

The modifier of the LayoutNode corresponding to this View.

() -> Unit

The update logic of the View.

View?

The view hosted by this holder.

Public constructors

<init>

AndroidViewHolder(context: Context)

A base class used to host a View inside Compose. This API is not designed to be used directly, but rather using the AndroidView and AndroidViewBinding APIs, which are built on top of AndroidViewHolder.

Public methods

getLayoutParams

open fun getLayoutParams(): LayoutParams?

requestDisallowInterceptTouchEvent

open fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean): Unit

Protected methods

onAttachedToWindow

protected open fun onAttachedToWindow(): Unit

onDetachedFromWindow

protected open fun onDetachedFromWindow(): Unit

onLayout

protected open fun onLayout(
    changed: Boolean,
    l: Int,
    t: Int,
    r: Int,
    b: Int
): Unit

onMeasure

protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit

Properties

density

var density: Density

The screen density of the layout.

modifier

var modifier: Modifier

The modifier of the LayoutNode corresponding to this View.

update

var update: () -> Unit

The update logic of the View.

view

var view: View?

The view hosted by this holder.