{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

CompositionLocalsKt

public final class CompositionLocalsKt


Summary

Public methods

static final @NonNull ProvidableCompositionLocal<AccessibilityManager>

The CompositionLocal to provide communication with platform accessibility service.

static final @NonNull ProvidableCompositionLocal<Autofill>

The CompositionLocal that can be used to trigger autofill actions.

static final @NonNull ProvidableCompositionLocal<@NonNull AutofillTree>

The CompositionLocal that can be used to add import androidx.compose.ui.autofill.AutofillNodes to the autofill tree.

static final @NonNull ProvidableCompositionLocal<@NonNull ClipboardManager>

The CompositionLocal to provide communication with platform clipboard service.

static final @NonNull ProvidableCompositionLocal<@NonNull Density>

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

static final @NonNull ProvidableCompositionLocal<@NonNull FocusManager>

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

static final @NonNull ProvidableCompositionLocal<@NonNull FontFamily.Resolver>

The CompositionLocal for compose font resolution from FontFamily.

static final @NonNull ProvidableCompositionLocal<@NonNull HapticFeedback>

The CompositionLocal to provide haptic feedback to the user.

static final @NonNull ProvidableCompositionLocal<@NonNull InputModeManager>

The CompositionLocal to provide an instance of InputModeManager which controls the current input mode.

static final @NonNull ProvidableCompositionLocal<@NonNull LayoutDirection>

The CompositionLocal to provide the layout direction.

static final @NonNull ProvidableCompositionLocal<@NonNull PlatformTextInputPluginRegistry>

The CompositionLocal to provide platform text input services.

static final @NonNull ProvidableCompositionLocal<TextInputService>

The CompositionLocal to provide communication with platform text input service.

static final @NonNull ProvidableCompositionLocal<@NonNull TextToolbar>

The CompositionLocal to provide text-related toolbar.

static final @NonNull ProvidableCompositionLocal<@NonNull UriHandler>

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

static final @NonNull ProvidableCompositionLocal<@NonNull ViewConfiguration>

The CompositionLocal that provides the ViewConfiguration.

static final @NonNull ProvidableCompositionLocal<@NonNull WindowInfo>

The CompositionLocal that provides information about the window that hosts the current Owner.

Public methods

getLocalAccessibilityManager

public static final @NonNull ProvidableCompositionLocal<AccessibilityManagergetLocalAccessibilityManager()

The CompositionLocal to provide communication with platform accessibility service.

getLocalAutofill

@ExperimentalComposeUiApi
public static final @NonNull ProvidableCompositionLocal<AutofillgetLocalAutofill()

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

getLocalAutofillTree

@ExperimentalComposeUiApi
public static final @NonNull ProvidableCompositionLocal<@NonNull AutofillTreegetLocalAutofillTree()

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

getLocalClipboardManager

public static final @NonNull ProvidableCompositionLocal<@NonNull ClipboardManagergetLocalClipboardManager()

The CompositionLocal to provide communication with platform clipboard service.

getLocalDensity

public static final @NonNull ProvidableCompositionLocal<@NonNull DensitygetLocalDensity()

Provides the Density to be used to transform between density-independent pixel units (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.

getLocalFocusManager

public static final @NonNull ProvidableCompositionLocal<@NonNull FocusManagergetLocalFocusManager()

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

getLocalFontFamilyResolver

public static final @NonNull ProvidableCompositionLocal<@NonNull FontFamily.ResolvergetLocalFontFamilyResolver()

The CompositionLocal for compose font resolution from FontFamily.

getLocalHapticFeedback

public static final @NonNull ProvidableCompositionLocal<@NonNull HapticFeedbackgetLocalHapticFeedback()

The CompositionLocal to provide haptic feedback to the user.

getLocalInputModeManager

public static final @NonNull ProvidableCompositionLocal<@NonNull InputModeManagergetLocalInputModeManager()

The CompositionLocal to provide an instance of InputModeManager which controls the current input mode.

getLocalLayoutDirection

public static final @NonNull ProvidableCompositionLocal<@NonNull LayoutDirectiongetLocalLayoutDirection()

The CompositionLocal to provide the layout direction.

getLocalPlatformTextInputPluginRegistry

@ExperimentalTextApi
public static final @NonNull ProvidableCompositionLocal<@NonNull PlatformTextInputPluginRegistrygetLocalPlatformTextInputPluginRegistry()

The CompositionLocal to provide platform text input services.

This is a low-level API for code that talks directly to the platform input method framework. Higher-level text input APIs in the Foundation library are more appropriate for most cases.

getLocalTextInputService

public static final @NonNull ProvidableCompositionLocal<TextInputServicegetLocalTextInputService()

The CompositionLocal to provide communication with platform text input service.

getLocalTextToolbar

public static final @NonNull ProvidableCompositionLocal<@NonNull TextToolbargetLocalTextToolbar()

The CompositionLocal to provide text-related toolbar.

getLocalUriHandler

public static final @NonNull ProvidableCompositionLocal<@NonNull UriHandlergetLocalUriHandler()

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

getLocalViewConfiguration

public static final @NonNull ProvidableCompositionLocal<@NonNull ViewConfigurationgetLocalViewConfiguration()

The CompositionLocal that provides the ViewConfiguration.

getLocalWindowInfo

public static final @NonNull ProvidableCompositionLocal<@NonNull WindowInfogetLocalWindowInfo()

The CompositionLocal that provides information about the window that hosts the current Owner.