Refactor
This commit is contained in:
parent
63c417cd61
commit
a81536ab9a
96 changed files with 729 additions and 724 deletions
|
@ -56,10 +56,10 @@ object ATH {
|
|||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val decorView = activity.window.decorView
|
||||
var systemUiVisibility = decorView.systemUiVisibility
|
||||
if (enabled) {
|
||||
systemUiVisibility = systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
||||
systemUiVisibility = if (enabled) {
|
||||
systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
|
||||
} else {
|
||||
systemUiVisibility = systemUiVisibility and SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
|
||||
systemUiVisibility and SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
|
||||
}
|
||||
decorView.systemUiVisibility = systemUiVisibility
|
||||
}
|
||||
|
|
|
@ -1,28 +1,16 @@
|
|||
package code.name.monkey.appthemehelper.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
||||
object MaterialUtil {
|
||||
|
||||
fun setTint(button: MaterialButton) {
|
||||
setTint(button, ThemeStore.accentColor(button.context))
|
||||
}
|
||||
|
||||
private fun setTint(button: MaterialButton, accentColor: Int) {
|
||||
val context = button.context
|
||||
val textColor = ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(accentColor)))
|
||||
button.setTextColor(textColor)
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun setTint(button: MaterialButton, background: Boolean, color: Int = ThemeStore.accentColor(button.context)) {
|
||||
//button.setPadding(48, 48, 48, 48);
|
||||
fun setTint(button: MaterialButton, background: Boolean = true,
|
||||
color: Int = ThemeStore.accentColor(button.context)) {
|
||||
|
||||
button.isAllCaps = false
|
||||
val context = button.context
|
||||
val colorState = ColorStateList.valueOf(color)
|
||||
|
@ -34,7 +22,6 @@ object MaterialUtil {
|
|||
button.setTextColor(textColor)
|
||||
button.iconTint = textColor
|
||||
} else {
|
||||
button.strokeColor = colorState
|
||||
button.setTextColor(colorState)
|
||||
button.iconTint = colorState
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue