Fix old issues
This commit is contained in:
parent
c6fc672cd1
commit
893f7fafdd
7 changed files with 23 additions and 14 deletions
|
@ -97,10 +97,14 @@ class SongFileAdapter(
|
|||
val error = RetroUtil.getTintedVectorDrawable(
|
||||
activity, R.drawable.ic_file_music_white_24dp, iconColor
|
||||
)
|
||||
Glide.with(activity).load(AudioFileCover(file.path))
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE).error(error).placeholder(error)
|
||||
Glide.with(activity)
|
||||
.load(AudioFileCover(file.path))
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.error(error)
|
||||
.placeholder(error)
|
||||
.animate(android.R.anim.fade_in)
|
||||
.signature(MediaStoreSignature("", file.lastModified(), 0)).into(holder.image)
|
||||
.signature(MediaStoreSignature("", file.lastModified(), 0))
|
||||
.into(holder.image)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHold
|
|||
@Nullable
|
||||
public ImageView image;
|
||||
|
||||
@Nullable
|
||||
public ImageView playerImage;
|
||||
|
||||
@Nullable
|
||||
public ViewGroup imageContainer;
|
||||
|
||||
|
@ -84,6 +87,7 @@ public class MediaEntryViewHolder extends AbstractDraggableSwipeableItemViewHold
|
|||
text = itemView.findViewById(R.id.text);
|
||||
|
||||
image = itemView.findViewById(R.id.image);
|
||||
playerImage = itemView.findViewById(R.id.player_image);
|
||||
time = itemView.findViewById(R.id.time);
|
||||
|
||||
imageText = itemView.findViewById(R.id.imageText);
|
||||
|
|
|
@ -30,6 +30,7 @@ class SongsFragment :
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
App.musicComponent.inject(this)
|
||||
retainInstance = true
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
@ -38,7 +39,6 @@ class SongsFragment :
|
|||
}
|
||||
|
||||
override fun createLayoutManager(): GridLayoutManager {
|
||||
println("createLayoutManager: ${getGridSize()}")
|
||||
return GridLayoutManager(requireActivity(), getGridSize()).apply {
|
||||
spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
||||
override fun getSpanSize(position: Int): Int {
|
||||
|
|
|
@ -19,9 +19,10 @@ import android.content.res.ColorStateList
|
|||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.core.content.ContextCompat
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.extensions.getAdaptiveIconDrawable
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.RetroColorUtil
|
||||
|
||||
|
@ -44,16 +45,15 @@ class ColorIconsImageView @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
fun setIconBackgroundColor(color: Int) {
|
||||
background = getAdaptiveIconDrawable(context)
|
||||
background = ContextCompat.getDrawable(context, R.drawable.color_circle_gradient)
|
||||
if (ATHUtil.isWindowBackgroundDark(context) && PreferenceUtil.getInstance(context).desaturatedColor()) {
|
||||
val desaturatedColor = RetroColorUtil.desaturateColor(color, 0.4f)
|
||||
backgroundTintList = ColorStateList.valueOf(desaturatedColor)
|
||||
imageTintList =
|
||||
ColorStateList.valueOf(ATHUtil.resolveColor(context, R.attr.colorSurface))
|
||||
} else {
|
||||
backgroundTintList = ColorStateList.valueOf(color)
|
||||
imageTintList =
|
||||
ColorStateList.valueOf(ATHUtil.resolveColor(context, R.attr.colorSurface))
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f))
|
||||
imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f))
|
||||
}
|
||||
requestLayout()
|
||||
invalidate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue