wrap

open fun wrap(@NonNull context: Context, @Nullable attrs: AttributeSet, @AttrRes defStyleAttr: Int, @StyleRes defStyleRes: Int): Context

Wraps the given context with a dewey theme overlay.

If the context is already wrapped with the dewey theme overlay, the context is returned unchanged. If the context is not wrapped with the dewey theme overlay, a new context is created with the dewey theme overlay applied to it.

If the dewey theme overlay is set on the view, the view will be inflated with the dewey theme overlay applied to it. This means that the view will be styled with the dewey theme overlay's attributes.

If the dewey theme overlay is set on the view and the android theme overlay is set on the view, the android theme overlay will override the dewey theme overlay.

Return

the wrapped context

Parameters

context

the context to wrap

attrs

the attributes of the view

defStyleAttr

an attribute in the current theme that contains a reference to a style

defStyleRes

a resource identifier of a style resource that supplies default values for the view


open fun wrap(@NonNull context: Context, @Nullable attrs: AttributeSet, @AttrRes defStyleAttr: Int, @StyleRes defStyleRes: Int, @StyleRes defaultThemeOverlayId: Int): Context

Wraps the given context with a dewey theme overlay.

If the context is already wrapped with the dewey theme overlay, the context is returned unchanged. If the context is not wrapped with the dewey theme overlay, a new context is created with the dewey theme overlay applied to it.

If the dewey theme overlay is set on the view, the view will be inflated with the dewey theme overlay applied to it. This means that the view will be styled with the dewey theme overlay's attributes.

If the dewey theme overlay is set on the view and the android theme overlay is set on the view, the android theme overlay will override the dewey theme overlay.

Return

the wrapped context

Parameters

context

the context to wrap

attrs

the attributes of the view

defStyleAttr

an attribute in the current theme that contains a reference to a style

defStyleRes

a resource identifier of a style resource that supplies default values for the view

defaultThemeOverlayId

the default theme overlay id to use if the dewey theme overlay is not set