Reworked switching to semitones
Using an expandable Tab-like component instead of a combobox
This commit is contained in:
parent
621b38c98b
commit
4b06536582
5 changed files with 209 additions and 63 deletions
|
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue