Fix slider sliding problem
This commit is contained in:
parent
724f743627
commit
94cda61f32
16 changed files with 33 additions and 63 deletions
|
@ -24,7 +24,7 @@ android {
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
applicationId "code.name.monkey.retromusic"
|
applicationId "code.name.monkey.retromusic"
|
||||||
versionCode 413
|
versionCode 414
|
||||||
versionName '3.4.970'
|
versionName '3.4.970'
|
||||||
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<html>
<head>
<style type="text/css">
* {
word-wrap: break-word;
}
{style-placeholder}
a {
color: {link-color};
}
a:active {
color: {link-color-active};
}
ol {
list-style-position: inside;
padding-left: 0;
padding-right: 0;
}
li {
padding-top: 8px;
}
</style>
</head>
<body>
<h4>v3.4.970</h4>
<ul>
<li>Updated internal libraries</li>
<li>Added default cover with accent color</li>
<li>Major code refactor for library tabs</li>
<li>Folder option now in available in tabs</li>
<li>Improved drive mode page</li>
<li>Added date modified option to sort songs</li>
<li>Added toggle bluetooth connection to play on device as soon as it connected</li>
<li>Fix tablet version of app</li>
<li>Fix Album and Artist details toolbar full width for better accessibility</li>
</ul>
<h4>v3.4.900</h4>
<ul>
<li>Added playlist search</li>
<li>Added Drive mode</li>
<li>Added Album and Artist layout change option in library</li>
<li>Added Show more album and artist information in details</li>
<li>Added Pixel style scroller bar</li>
<li>Added current now playing share</li>
<li>Fix font issues and colors in some places</li>
<li>Improved Full now playing theme</li>
</ul>
<h4>v3.4.850</h4>
<ul>
<li>Added new theme called circle</li>
<li>Added tiny color card style for home artists</li>
<li>Added extra track info details to now playing themes</li>
<li>Added scroll animation</li>
<li>Added smooth transition animations 🤔</li>
<li>Added current playing tab options for Bottom Navigation View</li>
<li>Added search in genre</li>
<li>Improved selecting feedback effect(ripple with corners)</li>
<li>Fix bugs & crashes</li>
<li>Fix crashing on lyrics</li>
<li>Fix genre details last song is under mini player</li>
<li>Fix colors mistakes and font sizes</li>
<li>Fix slider jumping while scrolling in now playing themes</li>
</ul>
<h4>v3.4.800</h4>
<ul>
<li>Improved dark theme colors and Follow system theme</li>
<li>Rounded rectangle ripple for BottomNavigationView</li>
<li>Follow sleep timer dialog checkbox color as accent</li>
<li>Added song list selection for Album and Artist details</li>
<li>Fixed Toolbar popup text color when selecting songs</li>
</ul>
<h4>v3.4.700</h4>
<ul>
<li>Added splash screen(for app loading time)</li>
<li>Updated dark theme colors</li>
<li>Added circular progress view</li>
<li>Hiding year if not showing</li>
</ul>
<h4>v3.4.600</h4>
<ul>
<li>Fix notification layout height</li>
<li>Fix folder list last item not showing</li>
<li>Added auto hide/ show controls according to first and last item</li>
</ul>
<h4>v3.4.500</h4>
<ul>
<li>Added peak theme</li>
<li>Added app rating dialog</li>
<li>Fix song name scrolling in now playing themes if it's long</li>
<li>Fix playing queue last item hiding FAB</li>
<li>Added desaturated color option for dark mode</li>
<li>Fix slow search loading</li>
<li>Fix last added slow loading</li>
<li>Fix home banner toolbar corner</li>
<li>Fix home crashing when switching between two tabs</li>
<li>Fix remaining time in playing queue</li>
<li>Fix font not applied for some components</li>
<li>Fix crashing on album details sorting</li>
<li>Fixed lot of internal bugs</li>
<li>Fix dialog expand</li>
<li>Fix list card color</li>
<li>Removed SlidingUpPanel to replace with BottomSheet</li>
<li>Removed color theme as per material design guidelines</li>
<li>Removed classic theme(We're bringing back)</li>
<li>Replace line switch to Material Switch in settings</li>
<li>Performance improved</li>
<li>Updated internal libraries</li>
<li>Updated translation</li>
<li>Limiting the use of Theme engine for making use of system colors</li>
<li>Change home icon from the user icon</li>
<li>Corrected all toolbar with elevation when scrolling</li>
</ul>
<p>If you see entire app white or dark or black select same theme in settings to fix </p>
<p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a>
</p>
<p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again. </p>
</body>
|
<html>
<head>
<style type="text/css">
* {
word-wrap: break-word;
}
{style-placeholder}
a {
color: {link-color};
}
a:active {
color: {link-color-active};
}
ol {
list-style-position: inside;
padding-left: 0;
padding-right: 0;
}
li {
padding-top: 8px;
}
</style>
</head>
<body>
<h4>v3.4.970</h4>
<ul>
<li>Updated internal libraries</li>
<li>Added date modified option to sort songs</li>
<li>Added toggle bluetooth connection to play on device as soon as it connected</li>
<li>Major code refactor for library tabs</li>
<li>Folder option now in available in tabs</li>
<li>Improved drive mode page</li>
<li>Improved fit, full, card themes for status visibility</li>
<li>Fix tablet version of app</li>
<li>Fix Album and Artist details toolbar full width for better accessibility</li>
<li>Updated internal libraries</li>
</ul>
<h4>v3.4.900</h4>
<ul>
<li>Added playlist search</li>
<li>Added Drive mode</li>
<li>Added Album and Artist layout change option in library</li>
<li>Added Show more album and artist information in details</li>
<li>Added Pixel style scroller bar</li>
<li>Added current now playing share</li>
<li>Fix font issues and colors in some places</li>
<li>Improved Full now playing theme</li>
</ul>
<h4>v3.4.850</h4>
<ul>
<li>Added new theme called circle</li>
<li>Added tiny color card style for home artists</li>
<li>Added extra track info details to now playing themes</li>
<li>Added scroll animation</li>
<li>Added smooth transition animations 🤔</li>
<li>Added current playing tab options for Bottom Navigation View</li>
<li>Added search in genre</li>
<li>Improved selecting feedback effect(ripple with corners)</li>
<li>Fix bugs & crashes</li>
<li>Fix crashing on lyrics</li>
<li>Fix genre details last song is under mini player</li>
<li>Fix colors mistakes and font sizes</li>
<li>Fix slider jumping while scrolling in now playing themes</li>
</ul>
<h4>v3.4.800</h4>
<ul>
<li>Improved dark theme colors and Follow system theme</li>
<li>Rounded rectangle ripple for BottomNavigationView</li>
<li>Follow sleep timer dialog checkbox color as accent</li>
<li>Added song list selection for Album and Artist details</li>
<li>Fixed Toolbar popup text color when selecting songs</li>
</ul>
<h4>v3.4.700</h4>
<ul>
<li>Added splash screen(for app loading time)</li>
<li>Updated dark theme colors</li>
<li>Added circular progress view</li>
<li>Hiding year if not showing</li>
</ul>
<h4>v3.4.600</h4>
<ul>
<li>Fix notification layout height</li>
<li>Fix folder list last item not showing</li>
<li>Added auto hide/ show controls according to first and last item</li>
</ul>
<h4>v3.4.500</h4>
<ul>
<li>Added peak theme</li>
<li>Added app rating dialog</li>
<li>Fix song name scrolling in now playing themes if it's long</li>
<li>Fix playing queue last item hiding FAB</li>
<li>Added desaturated color option for dark mode</li>
<li>Fix slow search loading</li>
<li>Fix last added slow loading</li>
<li>Fix home banner toolbar corner</li>
<li>Fix home crashing when switching between two tabs</li>
<li>Fix remaining time in playing queue</li>
<li>Fix font not applied for some components</li>
<li>Fix crashing on album details sorting</li>
<li>Fixed lot of internal bugs</li>
<li>Fix dialog expand</li>
<li>Fix list card color</li>
<li>Removed SlidingUpPanel to replace with BottomSheet</li>
<li>Removed color theme as per material design guidelines</li>
<li>Removed classic theme(We're bringing back)</li>
<li>Replace line switch to Material Switch in settings</li>
<li>Performance improved</li>
<li>Updated internal libraries</li>
<li>Updated translation</li>
<li>Limiting the use of Theme engine for making use of system colors</li>
<li>Change home icon from the user icon</li>
<li>Corrected all toolbar with elevation when scrolling</li>
</ul>
<p>If you see entire app white or dark or black select same theme in settings to fix </p>
<p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a>
</p>
<p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again. </p>
</body>
|
|
@ -18,11 +18,11 @@ import code.name.monkey.retromusic.util.ViewUtil
|
||||||
import code.name.monkey.retromusic.volume.AudioVolumeObserver
|
import code.name.monkey.retromusic.volume.AudioVolumeObserver
|
||||||
import code.name.monkey.retromusic.volume.OnAudioVolumeChangedListener
|
import code.name.monkey.retromusic.volume.OnAudioVolumeChangedListener
|
||||||
import com.google.android.material.slider.Slider
|
import com.google.android.material.slider.Slider
|
||||||
import com.google.android.material.slider.Slider.OnChangeListener
|
|
||||||
import kotlinx.android.synthetic.main.fragment_volume.*
|
import kotlinx.android.synthetic.main.fragment_volume.*
|
||||||
|
|
||||||
class VolumeFragment : Fragment(), OnAudioVolumeChangedListener,
|
class VolumeFragment : Fragment(), OnAudioVolumeChangedListener,
|
||||||
View.OnClickListener, OnChangeListener {
|
View.OnClickListener, Slider.OnChangeListener {
|
||||||
|
|
||||||
private var audioVolumeObserver: AudioVolumeObserver? = null
|
private var audioVolumeObserver: AudioVolumeObserver? = null
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -219,10 +218,8 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
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
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -253,10 +252,8 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
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
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -211,10 +210,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -229,10 +228,8 @@ class CirclePlayerFragment : AbsPlayerFragment(), Callback, OnAudioVolumeChanged
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ 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
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -213,10 +212,8 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,10 +172,8 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -204,10 +203,8 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment(),
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,10 +210,8 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
import code.name.monkey.retromusic.extensions.ripAlpha
|
||||||
import code.name.monkey.retromusic.extensions.setRange
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -237,10 +236,8 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment(),
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,10 +143,8 @@ class PeakPlayerControlFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,10 +264,8 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
override fun onUpdateProgressViews(progress: Int, total: Int) {
|
||||||
if (total <= 0) {
|
progressSlider.valueTo = total.toFloat()
|
||||||
return
|
progressSlider.value = progress.toFloat()
|
||||||
}
|
|
||||||
progressSlider.setRange(progress.toFloat(), total.toFloat())
|
|
||||||
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
songTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
|
||||||
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,8 +53,8 @@ class MusicProgressViewUpdateHelper : Handler {
|
||||||
private fun refreshProgressViews(): Int {
|
private fun refreshProgressViews(): Int {
|
||||||
val progressMillis = MusicPlayerRemote.songProgressMillis
|
val progressMillis = MusicPlayerRemote.songProgressMillis
|
||||||
val totalMillis = MusicPlayerRemote.songDurationMillis
|
val totalMillis = MusicPlayerRemote.songDurationMillis
|
||||||
println("$progressMillis $totalMillis")
|
if (totalMillis > 0)
|
||||||
callback?.onUpdateProgressViews(progressMillis, totalMillis)
|
callback?.onUpdateProgressViews(progressMillis, totalMillis)
|
||||||
|
|
||||||
if (!MusicPlayerRemote.isPlaying) {
|
if (!MusicPlayerRemote.isPlaying) {
|
||||||
return intervalPaused
|
return intervalPaused
|
||||||
|
@ -76,10 +76,9 @@ class MusicProgressViewUpdateHelper : Handler {
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val CMD_REFRESH_PROGRESS_VIEWS = 1
|
private const val CMD_REFRESH_PROGRESS_VIEWS = 1
|
||||||
|
private const val MIN_INTERVAL = 20
|
||||||
private val MIN_INTERVAL = 20
|
private const val UPDATE_INTERVAL_PLAYING = 1000
|
||||||
private val UPDATE_INTERVAL_PLAYING = 1000
|
private const val UPDATE_INTERVAL_PAUSED = 500
|
||||||
private val UPDATE_INTERVAL_PAUSED = 500
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:value="1.0f"
|
android:value="1.0f"
|
||||||
android:valueFrom="0.0f"
|
android:valueFrom="-0.1f"
|
||||||
android:valueTo="1.0f"
|
android:valueTo="1.0f"
|
||||||
app:labelBehavior="gone"
|
app:labelBehavior="gone"
|
||||||
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
||||||
|
|
Loading…
Reference in a new issue