Fix miniplayer showing, cardview,remmeber last selected option,

This commit is contained in:
h4h13 2019-10-12 02:31:39 +05:30
parent 0e179d6842
commit b9e3483a47
22 changed files with 154 additions and 380 deletions

View file

@ -35,12 +35,26 @@ import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.R
import com.google.android.material.card.MaterialCardView
import com.google.android.material.shape.CornerFamily
import com.google.android.material.shape.MaterialShapeDrawable
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
object ViewUtil {
const val RETRO_MUSIC_ANIM_TIME = 1000
fun cardViewTopCorners(cardView: MaterialCardView) {
val radius = PreferenceUtil.getInstance(cardView.context).dialogCorner
(cardView.background as? MaterialShapeDrawable).let {
it?.shapeAppearanceModel?.apply {
toBuilder()
.setTopLeftCorner(CornerFamily.CUT, 10f)
.build()
}
}
}
fun createTextColorTransition(v: TextView, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator {
return createColorAnimator(v, "textColor", startColor, endColor)
@ -66,7 +80,7 @@ object ViewUtil {
progress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val background = ld.findDrawableByLayerId(android.R.id.background)
val primaryColor = ATHUtil.resolveColor(progressSlider.context, R.attr.colorPrimary);
val primaryColor = ATHUtil.resolveColor(progressSlider.context, R.attr.colorPrimary)
background.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(primaryColor)), PorterDuff.Mode.SRC_IN)
val secondaryProgress = ld.findDrawableByLayerId(android.R.id.secondaryProgress)
@ -121,7 +135,7 @@ object ViewUtil {
recyclerView.setPopupTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(accentColor)))
recyclerView.setThumbColor(accentColor)
recyclerView.setTrackColor(Color.TRANSPARENT)
recyclerView.setTrackColor(ColorUtil.withAlpha(ATHUtil.resolveColor(context, R.attr.colorControlNormal), 0.12f));
recyclerView.setTrackColor(ColorUtil.withAlpha(ATHUtil.resolveColor(context, R.attr.colorControlNormal), 0.12f))
}