Updates edittext views with corner rounded
This commit is contained in:
parent
7a42723b9e
commit
f9f30c8387
46 changed files with 1127 additions and 1286 deletions
|
@ -2,6 +2,7 @@ package code.name.monkey.appthemehelper.util
|
|||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.ColorInt
|
||||
|
@ -10,6 +11,7 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
|
||||
object MaterialUtil {
|
||||
|
||||
@JvmOverloads
|
||||
|
@ -39,15 +41,20 @@ object MaterialUtil {
|
|||
val colorState = ColorStateList.valueOf(accentColor)
|
||||
|
||||
if (background) {
|
||||
//textInputLayout.backgroundTintList = colorState
|
||||
textInputLayout.backgroundTintList = colorState
|
||||
textInputLayout.defaultHintTextColor = colorState
|
||||
} else {
|
||||
textInputLayout.boxStrokeColor = accentColor
|
||||
textInputLayout.defaultHintTextColor = colorState
|
||||
textInputLayout.isHintAnimationEnabled = true
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun setCursorPointerColor(view: EditText, @ColorInt color: Int) {
|
||||
try {
|
||||
//get the pointer resource id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue