internal static void ApplySeekBarColors(this ASeekBar seekBar, Color progressColor, Color backgroundColor, Color thumbColor) { seekBar.ApplyProgressBarColors(progressColor, backgroundColor); if (thumbColor.IsDefault) { // reset everything to defaults seekBar.ThumbTintList = seekBar.ProgressTintList; } else { // handle the case where the thumb is set var thumb = thumbColor.ToAndroid(); seekBar.ThumbTintList = ColorStateList.ValueOf(thumb); } }
internal static void ApplySeekBarColors(this ASeekBar seekBar, Color progressColor, Color backgroundColor, Color thumbColor) { seekBar.ApplyProgressBarColors(progressColor, backgroundColor); if (Forms.IsLollipopOrNewer) { if (thumbColor.IsDefault) { // reset everything to defaults seekBar.ThumbTintList = seekBar.ProgressTintList; } else { // handle the case where the thumb is set var thumb = thumbColor.ToAndroid(); seekBar.ThumbTintList = ColorStateList.ValueOf(thumb); } } else { seekBar.Thumb.SetColorFilter(thumbColor.ToAndroid(), PorterDuff.Mode.SrcIn); } }