Register now for Android Dev Summit 2019!

LayoutInflaterCompat

class LayoutInflaterCompat
kotlin.Any
   ↳ androidx.core.view.LayoutInflaterCompat

Helper for accessing features in LayoutInflater.

Summary

Public methods

static LayoutInflaterFactory!

Return the current LayoutInflaterFactory (or null).

static Unit
setFactory(@NonNull inflater: LayoutInflater, @NonNull factory: LayoutInflaterFactory)

Attach a custom Factory interface for creating views while using this LayoutInflater.

static Unit
setFactory2(@NonNull inflater: LayoutInflater, @NonNull factory: Factory2)

Attach a custom LayoutInflater.Factory2 for creating views while using this LayoutInflater.

Public methods

getFactory

static fun getFactory(inflater: LayoutInflater!): LayoutInflaterFactory!

Deprecated: Use setFactory2(LayoutInflater, LayoutInflater.Factory2) to set and LayoutInflater#getFactory2() to get the factory.

Return the current LayoutInflaterFactory (or null). This is called on each element name. If the factory returns a View, add that to the hierarchy. If it returns null, proceed to call onCreateView(name).

Return
LayoutInflaterFactory!: The LayoutInflaterFactory associated with the LayoutInflater. Will be null if the inflater does not have a LayoutInflaterFactory but a raw LayoutInflater.Factory.

setFactory

static fun setFactory(@NonNull inflater: LayoutInflater, @NonNull factory: LayoutInflaterFactory): Unit

Deprecated: Use setFactory2(LayoutInflater, LayoutInflater.Factory2) instead to set and LayoutInflater#getFactory2() to get the factory.

Attach a custom Factory interface for creating views while using this LayoutInflater. This must not be null, and can only be set once; after setting, you can not change the factory.

setFactory2

static fun setFactory2(@NonNull inflater: LayoutInflater, @NonNull factory: Factory2): Unit

Attach a custom LayoutInflater.Factory2 for creating views while using this LayoutInflater. This must not be null, and can only be set once; after setting, you can not change the factory.