diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt index 08097dde..693851b0 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt @@ -1,6 +1,7 @@ package code.name.monkey.retromusic.adapter.song import android.app.ActivityOptions +import android.content.res.ColorStateList import android.graphics.drawable.Drawable import android.view.LayoutInflater import android.view.MenuItem @@ -84,10 +85,13 @@ open class SongAdapter( loadAlbumCover(song, holder) } - private fun setColors(color: Int, holder: ViewHolder) { + private fun setColors(color: MediaNotificationProcessor, holder: ViewHolder) { if (holder.paletteColorContainer != null) { - holder.paletteColorContainer?.setBackgroundColor(color) + holder.title?.setTextColor(color.primaryTextColor) + holder.text?.setTextColor(color.secondaryTextColor) + holder.paletteColorContainer?.setBackgroundColor(color.backgroundColor) } + holder.mask?.backgroundTintList = ColorStateList.valueOf(color.primaryTextColor) } protected open fun loadAlbumCover(song: Song, holder: ViewHolder) { @@ -100,11 +104,11 @@ open class SongAdapter( .into(object : RetroMusicColoredTarget(holder.image!!) { override fun onLoadCleared(placeholder: Drawable?) { super.onLoadCleared(placeholder) - setColors(defaultFooterColor, holder) + } override fun onColorReady(colors: MediaNotificationProcessor) { - setColors(colors.backgroundColor, holder) + setColors(colors, holder) } }) } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt index 977ce8ff..bd7c11b4 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt @@ -32,9 +32,9 @@ class ColorFragment : AbsPlayerFragment() { get() = navigationColor override fun onColorChanged(color: MediaNotificationProcessor) { + lastColor = color.secondaryTextColor playbackControlsFragment.setDark(color) navigationColor = color.backgroundColor - lastColor = color.secondaryTextColor callbacks?.onPaletteColorChanged() ToolbarContentTintHelper.colorizeToolbar( diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt index 247b0b15..a1a46ee6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt @@ -98,8 +98,8 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { fun setDark(colors: MediaNotificationProcessor) { setDark(colors.secondaryTextColor) - TintHelper.setTintAuto(playPauseButton, colors.backgroundColor, false) TintHelper.setTintAuto(playPauseButton, colors.primaryTextColor, true) + TintHelper.setTintAuto(playPauseButton, colors.backgroundColor, false) title.setTextColor(colors.primaryTextColor) text.setTextColor(colors.secondaryTextColor) diff --git a/app/src/main/java/code/name/monkey/retromusic/glide/RetroMusicColoredTarget.kt b/app/src/main/java/code/name/monkey/retromusic/glide/RetroMusicColoredTarget.kt index 90342fe4..bbfc03d9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/glide/RetroMusicColoredTarget.kt +++ b/app/src/main/java/code/name/monkey/retromusic/glide/RetroMusicColoredTarget.kt @@ -29,9 +29,6 @@ abstract class RetroMusicColoredTarget(view: ImageView) : BitmapPaletteTarget(vi protected val defaultFooterColor: Int get() = ATHUtil.resolveColor(getView().context, R.attr.colorControlNormal) - protected val albumArtistFooterColor: Int - get() = ATHUtil.resolveColor(getView().context, R.attr.colorControlNormal) - abstract fun onColorReady(colors: MediaNotificationProcessor) override fun onLoadFailed(e: Exception?, errorDrawable: Drawable?) { diff --git a/app/src/main/res/layout/fragment_album_material_cover.xml b/app/src/main/res/layout/fragment_album_material_cover.xml index 83d8946d..11005594 100644 --- a/app/src/main/res/layout/fragment_album_material_cover.xml +++ b/app/src/main/res/layout/fragment_album_material_cover.xml @@ -1,30 +1,29 @@ - + android:layout_height="match_parent"> + app:cardCornerRadius="8dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintDimensionRatio="1:1" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - + android:layout_height="match_parent" + android:scaleType="centerCrop" + tools:ignore="ContentDescription,UnusedAttribute" + tools:srcCompat="@tools:sample/backgrounds/scenic[8]" /> - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_album_card.xml b/app/src/main/res/layout/item_album_card.xml index 5129afda..a3d8e3aa 100644 --- a/app/src/main/res/layout/item_album_card.xml +++ b/app/src/main/res/layout/item_album_card.xml @@ -16,6 +16,7 @@ + + android:layout_margin="4dp" + app:cardCornerRadius="16dp">