From a3cee7d5f4b60694ba80518745c5ecade4ba2108 Mon Sep 17 00:00:00 2001 From: Hemanth S Date: Thu, 21 May 2020 03:03:46 +0530 Subject: [PATCH] Fixed purpleish color on Volume Seekbar --- .../monkey/retromusic/extensions/ViewExtensions.kt | 8 -------- .../monkey/retromusic/fragments/VolumeFragment.kt | 14 ++++++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt b/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt index 5d6b2e62..d25c953e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt +++ b/app/src/main/java/code/name/monkey/retromusic/extensions/ViewExtensions.kt @@ -24,7 +24,6 @@ import androidx.annotation.ColorInt import androidx.annotation.LayoutRes import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.TintHelper -import com.google.android.material.slider.Slider @Suppress("UNCHECKED_CAST") fun ViewGroup.inflate(@LayoutRes layout: Int): T { @@ -50,13 +49,6 @@ fun EditText.appHandleColor(): EditText { return this } -fun Slider.setRange(progress: Float, to: Float) { - valueFrom = 0F - valueTo = to - value = progress -} - - fun SeekBar.applyColor(@ColorInt color: Int) { thumbTintList = ColorStateList.valueOf(color) progressTintList = ColorStateList.valueOf(color) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt index b0dc0b91..2043617e 100755 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/VolumeFragment.kt @@ -15,7 +15,6 @@ import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.applyColor import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.util.PreferenceUtil -import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.volume.AudioVolumeObserver import code.name.monkey.retromusic.volume.OnAudioVolumeChangedListener import kotlinx.android.synthetic.main.fragment_volume.* @@ -99,15 +98,14 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum } fun tintWhiteColor() { - val iconColor = Color.WHITE - volumeDown.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN) - volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN) - - ViewUtil.setProgressDrawable(volumeSeekBar, iconColor, true) + val color = Color.WHITE + volumeDown.setColorFilter(color, PorterDuff.Mode.SRC_IN) + volumeUp.setColorFilter(color, PorterDuff.Mode.SRC_IN) + volumeSeekBar.applyColor(color) } fun setTintable(color: Int) { - volumeSeekBar.applyColor(color) + volumeSeekBar.applyColor(color) } fun removeThumb() { @@ -126,7 +124,7 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum volumeDown.setColorFilter(color, PorterDuff.Mode.SRC_IN) volumeUp.setColorFilter(color, PorterDuff.Mode.SRC_IN) //TintHelper.setTint(volumeSeekBar, color, false) - ViewUtil.setProgressDrawable(volumeSeekBar, color, true) + volumeSeekBar.applyColor(color) } companion object {