Update DrawableResolver.kt
Nicer import 😉
This commit is contained in:
parent
e6f59612b0
commit
1838c5b623
1 changed files with 2 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import androidx.annotation.AttrRes
|
import androidx.annotation.AttrRes
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class for resolving [Drawables](Drawable)
|
* Utility class for resolving [Drawables](Drawable)
|
||||||
|
|
@ -11,7 +12,7 @@ import androidx.annotation.AttrRes
|
||||||
object DrawableResolver {
|
object DrawableResolver {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun resolveDrawable(context: Context, @AttrRes attrResId: Int): Drawable? {
|
fun resolveDrawable(context: Context, @AttrRes attrResId: Int): Drawable? {
|
||||||
return androidx.core.content.ContextCompat.getDrawable(
|
return ContextCompat.getDrawable(
|
||||||
context,
|
context,
|
||||||
TypedValue().apply {
|
TypedValue().apply {
|
||||||
context.theme.resolveAttribute(
|
context.theme.resolveAttribute(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue