Replaced material progress with Materia Design components
This commit is contained in:
parent
06a52b1323
commit
0e81e3cb48
7 changed files with 26 additions and 143 deletions
|
@ -15,14 +15,12 @@ import code.name.monkey.retromusic.extensions.show
|
|||
import code.name.monkey.retromusic.extensions.textColorPrimary
|
||||
import code.name.monkey.retromusic.extensions.textColorSecondary
|
||||
import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment
|
||||
import code.name.monkey.retromusic.glide.SongGlideRequest
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import com.bumptech.glide.Glide
|
||||
import kotlinx.android.synthetic.main.fragment_mini_player.*
|
||||
import kotlin.math.abs
|
||||
|
||||
|
@ -97,19 +95,6 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
|
|||
|
||||
miniPlayerTitle.isSelected = true
|
||||
miniPlayerTitle.text = builder
|
||||
|
||||
if (RetroUtil.isTablet()) {
|
||||
image?.let {
|
||||
SongGlideRequest.Builder.from(
|
||||
Glide.with(requireContext()),
|
||||
MusicPlayerRemote.currentSong
|
||||
).checkIgnoreMediaStore(requireContext())
|
||||
.ignoreMediaStore(PreferenceUtil.isAllowedToDownloadMetadata())
|
||||
.asBitmap()
|
||||
.build()
|
||||
.into(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onServiceConnected() {
|
||||
|
|
|
@ -27,6 +27,7 @@ import androidx.core.view.ViewCompat
|
|||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||
import com.google.android.material.progressindicator.ProgressIndicator
|
||||
|
||||
object ViewUtil {
|
||||
|
||||
|
@ -76,6 +77,10 @@ object ViewUtil {
|
|||
)
|
||||
}
|
||||
|
||||
fun setProgressDrawable(progressIndicator: ProgressIndicator, newColor: Int) {
|
||||
progressIndicator.progressTintList = ColorStateList.valueOf(newColor)
|
||||
}
|
||||
|
||||
fun hitTest(v: View, x: Int, y: Int): Boolean {
|
||||
val tx = (ViewCompat.getTranslationX(v) + 0.5f).toInt()
|
||||
val ty = (ViewCompat.getTranslationY(v) + 0.5f).toInt()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue