Use elevation

This commit is contained in:
tzugen 2023-06-06 12:33:45 +02:00
parent 63296829a8
commit ec852b0e74
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
2 changed files with 8 additions and 5 deletions

View File

@ -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
}
}

View File

@ -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">