UiVersions


@RequiresApi(api = Build.VERSION_CODES.R)
public final class UiVersions


Defines the inline suggestion UI version constants.

Summary

Nested types

public interface UiVersions.Content

Represents the UI content that can be converted into a Slice to be read to render a UI in a remote process.

public interface UiVersions.Style

Represents a UI style specification that contains the version information and can be converted into a Bundle to be read to render a UI in a remote process.

public final class UiVersions.StylesBuilder

A builder responsible for providing a Bundle with encoded UI style specifications for one or more versions of UI templates.

Constants

static final String
INLINE_UI_VERSION_1 = "androidx.autofill.inline.ui.version:v1"

The ID for the version 1 implementation of the inline UI library.

Public methods

static @NonNull List<String>
getVersions(@NonNull Bundle versionedBundle)

The versionedBundle is expected to be generated either by build or getSupportedInlineUiVersionsAsBundle.

static @NonNull UiVersions.StylesBuilder

Returns a new styles builder.

Constants

INLINE_UI_VERSION_1

Added in 1.1.0
public static final String INLINE_UI_VERSION_1 = "androidx.autofill.inline.ui.version:v1"

The ID for the version 1 implementation of the inline UI library.

Public methods

getVersions

Added in 1.1.0
public static @NonNull List<StringgetVersions(@NonNull Bundle versionedBundle)

The versionedBundle is expected to be generated either by build or getSupportedInlineUiVersionsAsBundle.

Parameters
@NonNull Bundle versionedBundle

the bundle that encodes the versions information.

Returns
@NonNull List<String>

the list of versions that are both specified in the versionedBundle and supported by the current library.

newStylesBuilder

Added in 1.1.0
public static @NonNull UiVersions.StylesBuilder newStylesBuilder()

Returns a new styles builder.

See androidx.autofill.inline.v1.InlineSuggestionUi for example usage.