TypeRegistryAutofillProvider

Allows registering value providers for specific types. This provider does not support polymorphism. If you register provider for some interface A, it provides a value only for A::class. Provider for AImpl must be registered separately.

Functions

Link copied to clipboard
abstract fun provide(type: KClass<*>): AutofillProvider.Value<Any?>

Returns an instance of Value.Provided, whenever value of type can be provided. Otherwise, it returns Value.Absent

Link copied to clipboard
Link copied to clipboard
abstract fun <T> register(type: KClass<T & Any>, provider: () -> T?)

Registers a provider for type. It overwrites any provider registered for the same type with this method.

Link copied to clipboard
inline fun <T : Any> TypeRegistryAutofillProvider.register(noinline provider: () -> T?)
Link copied to clipboard
abstract fun unregister(type: KClass<*>)

Unregisters provider registered with register for type so it is no longer in use.

Link copied to clipboard