Refactor code
Moving business logic from UI to ViewModel class
This commit is contained in:
parent
c379342f6a
commit
2854b33d56
14 changed files with 155 additions and 198 deletions
|
@ -35,6 +35,7 @@ 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.progressindicator.ProgressIndicator
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
|
@ -145,6 +146,17 @@ fun TextInputLayout.accentColor() {
|
|||
isHintAnimationEnabled = true
|
||||
}
|
||||
|
||||
fun ProgressIndicator.accentColor() {
|
||||
val accentColor = ThemeStore.accentColor(context)
|
||||
indicatorColors = intArrayOf(accentColor)
|
||||
trackColor = ColorUtil.withAlpha(accentColor, 0.2f)
|
||||
}
|
||||
|
||||
fun ProgressIndicator.applyColor(color: Int) {
|
||||
indicatorColors = intArrayOf(color)
|
||||
trackColor = ColorUtil.withAlpha(color, 0.2f)
|
||||
}
|
||||
|
||||
fun TextInputEditText.accentColor() {
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue