Fixed purpleish color on Volume Seekbar

This commit is contained in:
Hemanth S 2020-05-21 03:03:46 +05:30
parent 347d6c5238
commit a3cee7d5f4
2 changed files with 6 additions and 16 deletions

View file

@ -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 <T : View> 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)

View file

@ -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,11 +98,10 @@ 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) {
@ -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 {