[Now Playing] Fixed Seekbar behaviour
This commit is contained in:
parent
67e5cea649
commit
8b9c8d7855
15 changed files with 128 additions and 182 deletions
|
@ -14,14 +14,17 @@
|
||||||
*/
|
*/
|
||||||
package code.name.monkey.retromusic.fragments.base
|
package code.name.monkey.retromusic.fragments.base
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.animation.AccelerateInterpolator
|
import android.view.animation.AccelerateInterpolator
|
||||||
import android.view.animation.DecelerateInterpolator
|
import android.view.animation.DecelerateInterpolator
|
||||||
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
@ -31,6 +34,7 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
||||||
import code.name.monkey.retromusic.service.MusicService
|
import code.name.monkey.retromusic.service.MusicService
|
||||||
|
import code.name.monkey.retromusic.util.MusicUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
||||||
|
|
||||||
|
@ -51,7 +55,10 @@ abstract class AbsPlayerControlsFragment(@LayoutRes layout: Int) : AbsMusicServi
|
||||||
|
|
||||||
var lastDisabledPlaybackControlsColor: Int = 0
|
var lastDisabledPlaybackControlsColor: Int = 0
|
||||||
|
|
||||||
open val seekBar: SeekBar? = null
|
var isSeeking = false
|
||||||
|
private set
|
||||||
|
|
||||||
|
open val progressSlider: SeekBar? = null
|
||||||
|
|
||||||
abstract val shuffleButton: ImageButton
|
abstract val shuffleButton: ImageButton
|
||||||
|
|
||||||
|
@ -61,17 +68,51 @@ abstract class AbsPlayerControlsFragment(@LayoutRes layout: Int) : AbsMusicServi
|
||||||
|
|
||||||
open val previousButton: ImageButton? = null
|
open val previousButton: ImageButton? = null
|
||||||
|
|
||||||
|
open val songTotalTime: TextView? = null
|
||||||
|
|
||||||
|
open val songCurrentProgress: TextView? = null
|
||||||
|
|
||||||
|
private var progressAnimator: ObjectAnimator? = null
|
||||||
|
|
||||||
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
|
progressSlider?.max = total
|
||||||
|
|
||||||
|
if (isSeeking) {
|
||||||
|
progressSlider?.progress = progress
|
||||||
|
} else {
|
||||||
|
progressAnimator = ObjectAnimator.ofInt(progressSlider, "progress", progress).apply {
|
||||||
|
duration = SLIDER_ANIMATION_TIME
|
||||||
|
interpolator = LinearInterpolator()
|
||||||
|
start()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
songTotalTime?.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
|
songCurrentProgress?.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
|
}
|
||||||
|
|
||||||
private fun setUpProgressSlider() {
|
private fun setUpProgressSlider() {
|
||||||
seekBar?.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() {
|
progressSlider?.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() {
|
||||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||||
if (fromUser) {
|
if (fromUser) {
|
||||||
MusicPlayerRemote.seekTo(progress)
|
|
||||||
onUpdateProgressViews(
|
onUpdateProgressViews(
|
||||||
MusicPlayerRemote.songProgressMillis,
|
progress,
|
||||||
MusicPlayerRemote.songDurationMillis
|
MusicPlayerRemote.songDurationMillis
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
||||||
|
isSeeking = true
|
||||||
|
progressViewUpdateHelper.stop()
|
||||||
|
progressAnimator?.cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
||||||
|
isSeeking = false
|
||||||
|
MusicPlayerRemote.seekTo(seekBar.progress)
|
||||||
|
progressViewUpdateHelper.start()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import android.view.View
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
@ -40,7 +41,7 @@ class AdaptivePlaybackControlsFragment :
|
||||||
private var _binding: FragmentAdaptivePlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentAdaptivePlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -55,6 +56,12 @@ class AdaptivePlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentAdaptivePlayerPlaybackControlsBinding.bind(view)
|
_binding = FragmentAdaptivePlayerPlaybackControlsBinding.bind(view)
|
||||||
|
@ -160,18 +167,6 @@ class AdaptivePlaybackControlsFragment :
|
||||||
|
|
||||||
override fun hide() {}
|
override fun hide() {}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -18,13 +18,12 @@ import android.animation.ObjectAnimator
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.animation.AccelerateInterpolator
|
|
||||||
import android.view.animation.DecelerateInterpolator
|
import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
|
@ -46,7 +45,7 @@ class BlurPlaybackControlsFragment :
|
||||||
private var _binding: FragmentBlurPlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentBlurPlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -61,6 +60,12 @@ class BlurPlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentBlurPlayerPlaybackControlsBinding.bind(view)
|
_binding = FragmentBlurPlayerPlaybackControlsBinding.bind(view)
|
||||||
|
@ -179,18 +184,6 @@ class BlurPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -47,7 +47,7 @@ class CardPlaybackControlsFragment :
|
||||||
private var _binding: FragmentCardPlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentCardPlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -170,18 +170,6 @@ class CardPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateProgressTextColor() {
|
private fun updateProgressTextColor() {
|
||||||
val color = MaterialValueHelper.getPrimaryTextColor(context, false)
|
val color = MaterialValueHelper.getPrimaryTextColor(context, false)
|
||||||
binding.songTotalTime.setTextColor(color)
|
binding.songTotalTime.setTextColor(color)
|
||||||
|
|
|
@ -43,7 +43,7 @@ class CardBlurPlaybackControlsFragment :
|
||||||
private var _binding: FragmentCardBlurPlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentCardBlurPlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -149,18 +149,6 @@ class CardBlurPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -25,6 +25,7 @@ import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
@ -48,7 +49,7 @@ class ColorPlaybackControlsFragment :
|
||||||
private var _binding: FragmentColorPlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentColorPlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -63,6 +64,12 @@ class ColorPlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentColorPlayerPlaybackControlsBinding.bind(view)
|
_binding = FragmentColorPlayerPlaybackControlsBinding.bind(view)
|
||||||
|
@ -174,18 +181,6 @@ class ColorPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
fun createRevealAnimator(view: View): Animator {
|
fun createRevealAnimator(view: View): Animator {
|
||||||
val location = IntArray(2)
|
val location = IntArray(2)
|
||||||
binding.playPauseButton.getLocationOnScreen(location)
|
binding.playPauseButton.getLocationOnScreen(location)
|
||||||
|
|
|
@ -17,12 +17,11 @@ package code.name.monkey.retromusic.fragments.player.fit
|
||||||
import android.animation.ObjectAnimator
|
import android.animation.ObjectAnimator
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.animation.AccelerateInterpolator
|
|
||||||
import android.view.animation.DecelerateInterpolator
|
import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
import androidx.core.view.isVisible
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
|
@ -44,7 +43,7 @@ class FitPlaybackControlsFragment :
|
||||||
private var _binding: FragmentFitPlaybackControlsBinding? = null
|
private var _binding: FragmentFitPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -59,6 +58,12 @@ class FitPlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentFitPlaybackControlsBinding.bind(view)
|
_binding = FragmentFitPlaybackControlsBinding.bind(view)
|
||||||
|
@ -182,18 +187,6 @@ class FitPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -45,7 +45,7 @@ class FlatPlaybackControlsFragment :
|
||||||
private var _binding: FragmentFlatPlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentFlatPlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -178,18 +178,6 @@ class FlatPlaybackControlsFragment :
|
||||||
updateShuffleState()
|
updateShuffleState()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -27,6 +27,7 @@ import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import androidx.appcompat.widget.PopupMenu
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
@ -46,7 +47,6 @@ import code.name.monkey.retromusic.fragments.base.goToAlbum
|
||||||
import code.name.monkey.retromusic.fragments.base.goToArtist
|
import code.name.monkey.retromusic.fragments.base.goToArtist
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||||
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
|
||||||
import code.name.monkey.retromusic.model.Song
|
import code.name.monkey.retromusic.model.Song
|
||||||
import code.name.monkey.retromusic.service.MusicService
|
import code.name.monkey.retromusic.service.MusicService
|
||||||
import code.name.monkey.retromusic.util.MusicUtil
|
import code.name.monkey.retromusic.util.MusicUtil
|
||||||
|
@ -70,7 +70,7 @@ class FullPlaybackControlsFragment :
|
||||||
private var _binding: FragmentFullPlayerControlsBinding? = null
|
private var _binding: FragmentFullPlayerControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -85,6 +85,12 @@ class FullPlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentFullPlayerControlsBinding.bind(view)
|
_binding = FragmentFullPlayerControlsBinding.bind(view)
|
||||||
|
@ -206,18 +212,6 @@ class FullPlaybackControlsFragment :
|
||||||
return (parentFragment as FullPlayerFragment).onMenuItemClick(item!!)
|
return (parentFragment as FullPlayerFragment).onMenuItemClick(item!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onRepeatModeChanged() {
|
override fun onRepeatModeChanged() {
|
||||||
updateRepeatState()
|
updateRepeatState()
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
|
@ -46,7 +47,7 @@ class LockScreenControlsFragment :
|
||||||
private var _binding: FragmentLockScreenPlaybackControlsBinding? = null
|
private var _binding: FragmentLockScreenPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -61,6 +62,12 @@ class LockScreenControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentLockScreenPlaybackControlsBinding.bind(view)
|
_binding = FragmentLockScreenPlaybackControlsBinding.bind(view)
|
||||||
|
@ -166,18 +173,6 @@ class LockScreenControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -21,6 +21,7 @@ import android.view.View
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
|
@ -46,7 +47,7 @@ class MaterialControlsFragment :
|
||||||
private var _binding: FragmentMaterialPlaybackControlsBinding? = null
|
private var _binding: FragmentMaterialPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -61,6 +62,12 @@ class MaterialControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentMaterialPlaybackControlsBinding.bind(view)
|
_binding = FragmentMaterialPlaybackControlsBinding.bind(view)
|
||||||
|
@ -174,18 +181,6 @@ class MaterialControlsFragment :
|
||||||
|
|
||||||
public override fun hide() {}
|
public override fun hide() {}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -14,13 +14,12 @@
|
||||||
*/
|
*/
|
||||||
package code.name.monkey.retromusic.fragments.player.normal
|
package code.name.monkey.retromusic.fragments.player.normal
|
||||||
|
|
||||||
import android.animation.ObjectAnimator
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.animation.DecelerateInterpolator
|
import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
@ -33,7 +32,6 @@ import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.fragments.base.goToAlbum
|
import code.name.monkey.retromusic.fragments.base.goToAlbum
|
||||||
import code.name.monkey.retromusic.fragments.base.goToArtist
|
import code.name.monkey.retromusic.fragments.base.goToArtist
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
import code.name.monkey.retromusic.util.MusicUtil
|
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
||||||
|
|
||||||
|
@ -43,7 +41,7 @@ class PlayerPlaybackControlsFragment :
|
||||||
private var _binding: FragmentPlayerPlaybackControlsBinding? = null
|
private var _binding: FragmentPlayerPlaybackControlsBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -58,6 +56,12 @@ class PlayerPlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentPlayerPlaybackControlsBinding.bind(view)
|
_binding = FragmentPlayerPlaybackControlsBinding.bind(view)
|
||||||
|
@ -183,18 +187,6 @@ class PlayerPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -22,6 +22,7 @@ import android.view.View
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
|
@ -45,7 +46,7 @@ class PeakPlayerControlFragment : AbsPlayerControlsFragment(R.layout.fragment_pe
|
||||||
private var _binding: FragmentPeakControlPlayerBinding? = null
|
private var _binding: FragmentPeakControlPlayerBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -60,6 +61,12 @@ class PeakPlayerControlFragment : AbsPlayerControlsFragment(R.layout.fragment_pe
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onViewCreated(
|
override fun onViewCreated(
|
||||||
view: View,
|
view: View,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
|
@ -109,18 +116,6 @@ class PeakPlayerControlFragment : AbsPlayerControlsFragment(R.layout.fragment_pe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setUpPlayPauseFab() {
|
private fun setUpPlayPauseFab() {
|
||||||
TintHelper.setTintAuto(binding.playPauseButton, Color.WHITE, true)
|
TintHelper.setTintAuto(binding.playPauseButton, Color.WHITE, true)
|
||||||
TintHelper.setTintAuto(binding.playPauseButton, Color.BLACK, false)
|
TintHelper.setTintAuto(binding.playPauseButton, Color.BLACK, false)
|
||||||
|
|
|
@ -21,6 +21,7 @@ import android.view.animation.DecelerateInterpolator
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
|
import android.widget.TextView
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
@ -48,7 +49,7 @@ class PlainPlaybackControlsFragment :
|
||||||
private var _binding: FragmentPlainControlsFragmentBinding? = null
|
private var _binding: FragmentPlainControlsFragmentBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override val seekBar: SeekBar
|
override val progressSlider: SeekBar
|
||||||
get() = binding.progressSlider
|
get() = binding.progressSlider
|
||||||
|
|
||||||
override val shuffleButton: ImageButton
|
override val shuffleButton: ImageButton
|
||||||
|
@ -63,6 +64,12 @@ class PlainPlaybackControlsFragment :
|
||||||
override val previousButton: ImageButton
|
override val previousButton: ImageButton
|
||||||
get() = binding.previousButton
|
get() = binding.previousButton
|
||||||
|
|
||||||
|
override val songTotalTime: TextView
|
||||||
|
get() = binding.songTotalTime
|
||||||
|
|
||||||
|
override val songCurrentProgress: TextView
|
||||||
|
get() = binding.songCurrentProgress
|
||||||
|
|
||||||
override fun onPlayStateChanged() {
|
override fun onPlayStateChanged() {
|
||||||
updatePlayPauseDrawableState()
|
updatePlayPauseDrawableState()
|
||||||
}
|
}
|
||||||
|
@ -175,18 +182,6 @@ class PlainPlaybackControlsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
|
||||||
binding.progressSlider.max = total
|
|
||||||
|
|
||||||
val animator = ObjectAnimator.ofInt(binding.progressSlider, "progress", progress)
|
|
||||||
animator.duration = SLIDER_ANIMATION_TIME
|
|
||||||
animator.interpolator = LinearInterpolator()
|
|
||||||
animator.start()
|
|
||||||
|
|
||||||
binding.songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
|
||||||
binding.songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|
|
@ -18,7 +18,6 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.animation.DecelerateInterpolator
|
import android.view.animation.DecelerateInterpolator
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.SeekBar
|
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue