MD3 look for Smart playlist buttons
This commit is contained in:
parent
5d8ad186d5
commit
58feab5c23
5 changed files with 72 additions and 138 deletions
|
@ -120,6 +120,14 @@ fun MaterialButton.accentOutlineColor() {
|
|||
rippleColor = colorStateList
|
||||
}
|
||||
|
||||
fun MaterialButton.elevatedAccentColor() {
|
||||
if (materialYou) return
|
||||
val color = ThemeStore.accentColor(context)
|
||||
val colorStateList = ColorStateList.valueOf(color)
|
||||
iconTint = colorStateList
|
||||
rippleColor = colorStateList
|
||||
}
|
||||
|
||||
fun SeekBar.applyColor(@ColorInt color: Int) {
|
||||
thumbTintList = ColorStateList.valueOf(color)
|
||||
progressTintList = ColorStateList.valueOf(color)
|
||||
|
|
|
@ -37,6 +37,7 @@ import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog
|
|||
import code.name.monkey.retromusic.dialogs.ImportPlaylistDialog
|
||||
import code.name.monkey.retromusic.extensions.accentColor
|
||||
import code.name.monkey.retromusic.extensions.drawNextToNavbar
|
||||
import code.name.monkey.retromusic.extensions.elevatedAccentColor
|
||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||
|
@ -76,6 +77,7 @@ class HomeFragment :
|
|||
|
||||
loadProfile()
|
||||
setupTitle()
|
||||
colorButtons()
|
||||
postponeEnterTransition()
|
||||
view.doOnPreDraw { startPostponedEnterTransition() }
|
||||
binding.appBarLayout.statusBarForeground =
|
||||
|
@ -173,6 +175,13 @@ class HomeFragment :
|
|||
.into(binding.userImage)
|
||||
}
|
||||
|
||||
fun colorButtons() {
|
||||
binding.history.elevatedAccentColor()
|
||||
binding.lastAdded.elevatedAccentColor()
|
||||
binding.topPlayed.elevatedAccentColor()
|
||||
binding.actionShuffle.elevatedAccentColor()
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater)
|
||||
inflater.inflate(R.menu.menu_main, menu)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue