parent
1b8c517e3e
commit
44dada9e60
|
@ -75,7 +75,7 @@ import org.schabi.newpipe.local.feed.item.StreamItem
|
|||
import org.schabi.newpipe.local.feed.service.FeedLoadService
|
||||
import org.schabi.newpipe.local.subscription.SubscriptionManager
|
||||
import org.schabi.newpipe.util.DeviceUtils
|
||||
import org.schabi.newpipe.util.DrawableResolver.Companion.resolveDrawable
|
||||
import org.schabi.newpipe.util.DrawableResolver.resolveDrawable
|
||||
import org.schabi.newpipe.util.Localization
|
||||
import org.schabi.newpipe.util.NavigationHelper
|
||||
import org.schabi.newpipe.util.ThemeHelper.getGridSpanCountStreams
|
||||
|
|
|
@ -2,18 +2,18 @@ package org.schabi.newpipe.util
|
|||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.TypedValue
|
||||
import androidx.annotation.AttrRes
|
||||
|
||||
/**
|
||||
* Utility class for resolving [Drawables](Drawable)
|
||||
*/
|
||||
class DrawableResolver {
|
||||
companion object {
|
||||
object DrawableResolver {
|
||||
@JvmStatic
|
||||
fun resolveDrawable(context: Context, @AttrRes attrResId: Int): Drawable? {
|
||||
return androidx.core.content.ContextCompat.getDrawable(
|
||||
context,
|
||||
android.util.TypedValue().apply {
|
||||
TypedValue().apply {
|
||||
context.theme.resolveAttribute(
|
||||
attrResId,
|
||||
this,
|
||||
|
@ -22,5 +22,4 @@ class DrawableResolver {
|
|||
}.resourceId
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue