Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

androidx.compose.ui.platform

Interfaces

AndroidOwner

Interface to be implemented by Owners able to handle Android View specific functionality.

ClipboardManager

Interface for managing the Clipboard.

InspectableValue

A compose value that is inspectable by tools.

TextToolbar

Interface for text-related toolbar.

UriHandler

An interface of providing platform specific URL handling.

Classes

AbstractComposeView

Base class for custom android.view.Views implemented using Jetpack Compose UI.

AndroidUriHandler

AtomicInt

ComposeView

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

InspectorInfo

A builder for an InspectableValue.

InspectorValueInfo

Implementation of InspectableValue based on a builder InspectorInfo DSL.

ValueElement

A ValueElement describes an element of a compose value instance.

ValueElementSequence

A builder for a sequence of ValueElement.

Enums

TextToolbarStatus

Status of the TextToolbar.

Top-level functions summary

InspectorInfo.() -> Unit
debugInspectorInfo(crossinline definitions: InspectorInfo.() -> Unit)

Factory method for avoiding DSL allocation when no debug inspector info is needed.

Composition
subcomposeInto(container: LayoutNode, parent: CompositionReference, composable: () -> Unit)

Top-level properties summary

ProvidableAmbient<AnimationClockObservable>

The default animation clock used for animations when an explicit clock isn't provided.

ProvidableAmbient<Autofill?>

The ambient that can be used to trigger autofill actions.

ProvidableAmbient<AutofillTree>

The ambient that can be used to add AutofillNodes to the autofill tree.

ProvidableAmbient<ClipboardManager>

The ambient to provide communication with platform clipboard service.

ProvidableAmbient<Configuration>

The Android Configuration.

ProvidableAmbient<Context>

Provides a Context that can be used by Android applications.

ProvidableAmbient<Density>

Provides the Density to be used to transform between density-independent pixelunits (DP) and pixel units or scale-independent pixel units (SP) and pixel units.

ProvidableAmbient<FocusManager>

The ambient that can be used to control focus within Compose.

ProvidableAmbient<HapticFeedback>

The ambient to provide haptic feedback to the user.

ProvidableAmbient<Boolean>

Inspectable mode ambient.

ProvidableAmbient<LayoutDirection>

The ambient to provide the layout direction.

ProvidableAmbient<LifecycleOwner>

The ambient containing the current LifecycleOwner.

InspectorInfo.() -> Unit

An empty InspectorInfo DSL.

ProvidableAmbient<TextInputService?>

The ambient to provide communication with platform text input service.

ProvidableAmbient<TextToolbar>

The ambient to provide text-related toolbar.

ProvidableAmbient<UriHandler>

The ambient to provide functionality related to URL, e.

ProvidableAmbient<View>

The ambient containing the current Compose View.

ProvidableAmbient<ViewModelStoreOwner>

The ambient containing the current ViewModelStoreOwner.

Boolean

Turn on inspector debug information.

Extension functions summary

For android.app.Activity
Composition
Activity.setViewContent(composable: () -> Unit)

Sets the contentView of an activity to a FrameLayout, and composes the contents of the layout with the passed in composable.

For 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.

For ComponentActivity
Composition
ComponentActivity.setContent(parent: CompositionReference = Recomposer.current(), content: () -> Unit)

Composes the given composable into the given activity.

For Modifier
Modifier

Applies a tag to allow modified element to be found in tests.

Top-level functions

debugInspectorInfo

inline fun debugInspectorInfo(crossinline definitions: InspectorInfo.() -> Unit): InspectorInfo.() -> Unit

Factory method for avoiding DSL allocation when no debug inspector info is needed.

subcomposeInto

@MainThread fun subcomposeInto(
    container: LayoutNode,
    parent: CompositionReference,
    composable: () -> Unit
): Composition

Top-level properties

AnimationClockAmbient

val AnimationClockAmbient: ProvidableAmbient<AnimationClockObservable>

The default animation clock used for animations when an explicit clock isn't provided.

AutofillAmbient

val AutofillAmbient: ProvidableAmbient<Autofill?>

The ambient that can be used to trigger autofill actions. Eg. Autofill.requestAutofillForNode.

AutofillTreeAmbient

val AutofillTreeAmbient: ProvidableAmbient<AutofillTree>

The ambient that can be used to add AutofillNodes to the autofill tree. The AutofillTree is a temporary data structure that will be replaced by Autofill Semantics (b/138604305).

ClipboardManagerAmbient

val ClipboardManagerAmbient: ProvidableAmbient<ClipboardManager>

The ambient to provide communication with platform clipboard service.

ConfigurationAmbient

val ConfigurationAmbient: ProvidableAmbient<Configuration>

The Android Configuration. The Configuration is useful for determining how to organize the UI.

ContextAmbient

val ContextAmbient: ProvidableAmbient<Context>

Provides a Context that can be used by Android applications.

DensityAmbient

val DensityAmbient: ProvidableAmbient<Density>

Provides the Density to be used to transform between density-independent pixelunits (DP) and pixel units or scale-independent pixel units (SP) and pixel units. This is typically used when a DP is provided and it must be converted in the body of Layout or DrawModifier.

FocusManagerAmbient

val FocusManagerAmbient: ProvidableAmbient<FocusManager>

The ambient that can be used to control focus within Compose.

HapticFeedBackAmbient

val HapticFeedBackAmbient: ProvidableAmbient<HapticFeedback>

The ambient to provide haptic feedback to the user.

InspectionMode

val InspectionMode: ProvidableAmbient<Boolean>

Inspectable mode ambient. True if the composition is composed inside a Inspectable component.

LayoutDirectionAmbient

val LayoutDirectionAmbient: ProvidableAmbient<LayoutDirection>

The ambient to provide the layout direction.

LifecycleOwnerAmbient

val LifecycleOwnerAmbient: ProvidableAmbient<LifecycleOwner>

The ambient containing the current LifecycleOwner.

NoInspectorInfo

val NoInspectorInfo: InspectorInfo.() -> Unit

An empty InspectorInfo DSL.

TextInputServiceAmbient

val TextInputServiceAmbient: ProvidableAmbient<TextInputService?>

The ambient to provide communication with platform text input service.

TextToolbarAmbient

val TextToolbarAmbient: ProvidableAmbient<TextToolbar>

The ambient to provide text-related toolbar.

UriHandlerAmbient

val UriHandlerAmbient: ProvidableAmbient<UriHandler>

The ambient to provide functionality related to URL, e.g. open URI.

ViewAmbient

val ViewAmbient: ProvidableAmbient<View>

The ambient containing the current Compose View.

ViewModelStoreOwnerAmbient

val ViewModelStoreOwnerAmbient: ProvidableAmbient<ViewModelStoreOwner>

The ambient containing the current ViewModelStoreOwner.

isDebugInspectorInfoEnabled

var isDebugInspectorInfoEnabled: Boolean

Turn on inspector debug information. Used internally during inspection.

Extension functions

setContent

fun ViewGroup.setContent(
    parent: CompositionReference = Recomposer.current(),
    content: () -> Unit
): Composition

Composes the given composable into the given view.

The new composition can be logically "linked" to an existing one, by providing a parent. This will ensure that invalidations and ambients will flow through the two compositions as if they were not separate.

Note that this ViewGroup should have an unique id for the saved instance state mechanism to be able to save and restore the values used within the composition. See View.setId.

Parameters
parent: CompositionReference = Recomposer.current() The Recomposer or parent composition reference.
content: () -> Unit Composable that will be the content of the view.

setContent

fun ComponentActivity.setContent(
    parent: CompositionReference = Recomposer.current(),
    content: () -> Unit
): Composition

Composes the given composable into the given activity. The content will become the root view of the given activity.

Composition.dispose is called automatically when the Activity is destroyed.

Parameters
parent: CompositionReference = Recomposer.current() The parent composition reference to coordinate scheduling of composition updates
content: () -> Unit A @Composable function declaring the UI contents

setViewContent

fun Activity.setViewContent(composable: () -> Unit): Composition

Deprecated.

Sets the contentView of an activity to a FrameLayout, and composes the contents of the layout with the passed in composable.

setViewContent

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

Deprecated.

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

testTag

@Stable fun Modifier.testTag(tag: String): Modifier

Applies a tag to allow modified element to be found in tests.

This is a convenience method for a semantics that sets SemanticsPropertyReceiver.testTag.