Reworked switching to semitones

Using an expandable Tab-like component instead of a combobox
This commit is contained in:
litetex 2022-03-04 21:37:11 +01:00
parent 621b38c98b
commit 4b06536582
5 changed files with 209 additions and 63 deletions

View file

@ -0,0 +1,26 @@
package org.schabi.newpipe.util
import android.content.Context
import android.graphics.drawable.Drawable
import androidx.annotation.AttrRes
/**
* Utility class for resolving [Drawables](Drawable)
*/
class DrawableResolver {
companion object {
@JvmStatic
fun resolveDrawable(context: Context, @AttrRes attrResId: Int): Drawable? {
return androidx.core.content.ContextCompat.getDrawable(
context,
android.util.TypedValue().apply {
context.theme.resolveAttribute(
attrResId,
this,
true
)
}.resourceId
)
}
}
}