mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-19 08:35:20 +01:00
Code refactor
This commit is contained in:
parent
1941086b4a
commit
c81d0c17fb
13 changed files with 58 additions and 58 deletions
|
@ -33,6 +33,7 @@ import code.name.monkey.retromusic.App
|
|||
import code.name.monkey.retromusic.R
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
|
@ -107,6 +108,15 @@ fun ExtendedFloatingActionButton.accentColor() {
|
|||
iconTint = textColorStateList
|
||||
}
|
||||
|
||||
fun FloatingActionButton.accentColor() {
|
||||
val color = ThemeStore.accentColor(context)
|
||||
val textColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))
|
||||
val colorStateList = ColorStateList.valueOf(color)
|
||||
val textColorStateList = ColorStateList.valueOf(textColor)
|
||||
backgroundTintList = colorStateList
|
||||
imageTintList = textColorStateList
|
||||
}
|
||||
|
||||
fun MaterialButton.applyColor(color: Int) {
|
||||
val backgroundColorStateList = ColorStateList.valueOf(color)
|
||||
val textColorColorStateList = ColorStateList.valueOf(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue