mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-15 08:50:35 +03:00
Use elevation
This commit is contained in:
parent
63296829a8
commit
ec852b0e74
@ -166,19 +166,22 @@ class TrackViewHolder(val view: View) :
|
||||
ContextCompat.getDrawable(view.context, R.drawable.ic_stat_play)!!
|
||||
}
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
private fun setPlayIcon(isPlaying: Boolean) {
|
||||
if (isPlaying && !isPlayingCached) {
|
||||
isPlayingCached = true
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(
|
||||
playingIcon, null, null, null
|
||||
)
|
||||
songLayout.backgroundTintMode = PorterDuff.Mode.ADD
|
||||
songLayout.backgroundTintMode = PorterDuff.Mode.MULTIPLY
|
||||
songLayout.elevation = 3F
|
||||
} else if (!isPlaying && isPlayingCached) {
|
||||
isPlayingCached = false
|
||||
title.setCompoundDrawablesWithIntrinsicBounds(
|
||||
0, 0, 0, 0
|
||||
)
|
||||
songLayout.backgroundTintMode = PorterDuff.Mode.MULTIPLY
|
||||
songLayout.backgroundTintMode = PorterDuff.Mode.ADD
|
||||
songLayout.elevation = 0F
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
a:id="@+id/song_layout"
|
||||
a:layout_width="fill_parent"
|
||||
a:layout_height="?android:attr/listPreferredItemHeight"
|
||||
a:background="#00000000"
|
||||
a:backgroundTint="@color/material_on_surface_stroke"
|
||||
a:backgroundTintMode="multiply"
|
||||
a:background="?attr/colorSurface"
|
||||
a:backgroundTint="?attr/colorPrimaryContainer"
|
||||
a:backgroundTintMode="add"
|
||||
a:minHeight="?android:attr/listPreferredItemHeight"
|
||||
a:orientation="horizontal">
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user