findByResources
inline fun <T : Any> findByResources(callback: T? = null, method: (Resources, Resources.Theme) -> T?): T
Using the resources and theme provided by ContextHelper.getAppContext and method to find the required resources.
val drawable = findByResources { res, theme ->
ResourcesCompat.getDrawable(res, R.drawable.android_logo, theme)
}
Content copied to clipboard
Since
0.5.2
Parameters
callback
The default value if findByResources can't get the resource by method.
method
Method of providing resources
T
Resource Type.