wrapContextIfPossible

abstract fun wrapContextIfPossible(@NonNull context: Context, @NonNull colorResourceIdsToColorValues: Map<Integer, Integer>): Context

Wraps the given Context with the theme overlay where color resources are updated at runtime. If not possible, the original Context will be returned.

Parameters

context

The target context.

colorResourceIdsToColorValues

The mapping from the color resources id to the updated color value.