This commit is contained in:
Muntashir Al-Islam 2020-08-02 14:14:02 +06:00
commit 283280529b
140 changed files with 2267 additions and 931 deletions

View file

@ -1,6 +1,7 @@
package code.name.monkey.appthemehelper.util
import android.content.res.ColorStateList
import android.graphics.Color
import code.name.monkey.appthemehelper.ThemeStore
import com.google.android.material.button.MaterialButton
import com.google.android.material.textfield.TextInputLayout
@ -36,6 +37,20 @@ object MaterialUtil {
}
}
@JvmOverloads
@JvmStatic
fun tintColor(
button: MaterialButton,
textColor: Int = Color.WHITE,
backgroundColor: Int = Color.BLACK
) {
val backgroundColorStateList = ColorStateList.valueOf(backgroundColor)
val textColorColorStateList = ColorStateList.valueOf(textColor)
button.backgroundTintList = backgroundColorStateList
button.setTextColor(textColorColorStateList)
button.iconTint = textColorColorStateList
}
@JvmOverloads
@JvmStatic
fun setTint(textInputLayout: TextInputLayout, background: Boolean = true) {