ContextThemeWrapper

constructor()(source)

Creates a new context wrapper with no theme and no base context.

Note: A base context must be attached using attachBaseContext before calling any other method on the newly constructed context wrapper.


constructor(base: Context, @StyleRes themeResId: Int)(source)

Creates a new context wrapper with the specified theme.

The specified theme will be applied on top of the base context's theme. Any attributes not explicitly defined in the theme identified by themeResId will retain their original values.

Parameters

base

the base context

themeResId

the resource ID of the theme to be applied on top of the base context's theme


constructor(base: Context, theme: Resources.Theme)(source)

Creates a new context wrapper with the specified theme.

Unlike ContextThemeWrapper, the theme passed to this constructor will completely replace the base context's theme.

Parameters

base

the base context

theme

the theme against which resources should be inflated