예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }