Fix old issues

This commit is contained in:
h4h13 2020-04-15 14:19:28 +05:30
parent c6fc672cd1
commit 893f7fafdd
7 changed files with 23 additions and 14 deletions

View file

@ -24,8 +24,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 414
versionName '3.4.970'
versionCode 416
versionName '3.5.970'
multiDexEnabled true
@ -130,14 +130,14 @@ dependencies {
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.palette:palette:1.0.0"
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation "androidx.viewpager2:viewpager2:1.1.0-alpha01"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.fragment:fragment:1.2.2'
implementation 'androidx.fragment:fragment:1.2.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha05'

View file

@ -1,7 +1,7 @@
[
{
"name": "Hemanth Savarala",
"summary": "Lead developer",
"summary": "Lead developer & Designer",
"link": "https://github.com/h4h13",
"profile_image": "https://i.imgur.com/AoVs9oj.jpg"
},

View file

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

View file

@ -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);

View file

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

View file

@ -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()

View file

@ -844,4 +844,5 @@
<string name="start_payment">Start payment</string>
<string name="pref_title_expand_now_playing_panel">Show now playing screen</string>
<string name="pref_summary_expand_now_playing_panel">Clicking on the notification will show now playing screen instead of the home screen</string>
</resources>