Fix lyrics loading
This commit is contained in:
parent
598364b8e0
commit
1e2be0a69f
4 changed files with 56 additions and 94 deletions
|
@ -1,12 +1,9 @@
|
|||
package code.name.monkey.appthemehelper.util
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.PorterDuff
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.appcompat.widget.AppCompatButton
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import com.afollestad.materialdialogs.internal.button.DialogActionButton
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
|
@ -49,4 +46,18 @@ object MaterialUtil {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
fun setTint(button: DialogActionButton, color: Int = ThemeStore.accentColor(button.context), background: Boolean = true) {
|
||||
val temp = button as AppCompatButton
|
||||
val context = temp.context
|
||||
val colorState = ColorStateList.valueOf(color)
|
||||
val textColor = ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)))
|
||||
|
||||
if (background) {
|
||||
temp.backgroundTintList = colorState
|
||||
temp.setTextColor(textColor)
|
||||
} else {
|
||||
temp.setTextColor(colorState)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue