MaterialScopeKt

Added in 1.3.0-alpha04

public final class MaterialScopeKt


Summary

Public methods

static final @NonNull LayoutElementBuilders.LayoutElement
materialScope(
    @NonNull Context context,
    @NonNull DeviceParametersBuilders.DeviceParameters deviceConfiguration,
    boolean allowDynamicTheme,
    @NonNull ColorScheme defaultColorScheme,
    @ExtensionFunctionType @NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.LayoutElement> layout
)

Creates a top-level receiver scope MaterialScope that calls the given layout to support for opinionated defaults and building Material3 components and layout, with default dynamic theme.

Public methods

public static final @NonNull LayoutElementBuilders.LayoutElement materialScope(
    @NonNull Context context,
    @NonNull DeviceParametersBuilders.DeviceParameters deviceConfiguration,
    boolean allowDynamicTheme,
    @NonNull ColorScheme defaultColorScheme,
    @ExtensionFunctionType @NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.LayoutElement> layout
)

Creates a top-level receiver scope MaterialScope that calls the given layout to support for opinionated defaults and building Material3 components and layout, with default dynamic theme.

Parameters
@NonNull Context context

The Android Context for the Tile service

@NonNull DeviceParametersBuilders.DeviceParameters deviceConfiguration

The device parameters for where the components will be rendered

boolean allowDynamicTheme

If dynamic colors theme should be used on components, meaning that colors will follow the system theme if enabled on the device. If not set, defaults to using the system theme

@NonNull ColorScheme defaultColorScheme

Color Scheme with static colors. The color theme to be used, when allowDynamicTheme is false, or when dynamic theming is disabled by the system or user. If not set, defaults to default theme.

@ExtensionFunctionType @NonNull Function1<@NonNull MaterialScope, @NonNull LayoutElementBuilders.LayoutElement> layout

Scoped slot for the content of layout to be displayed