findByContext

inline fun <T : Any> findByContext(callback: T? = null, method: Context.() -> T?): T

Using the context provided by ContextHelper.getAppContext and method to find the required resources.

val drawable = findByContext {
AppCompatResources.getDrawable(this, R.drawable.android_logo)
}

Since

0.5.2

Parameters

callback

The default value if findByContext can't get the resource by method.

method

Method of providing resources

T

Resource Type.