public static void UpdateMinimum(this SeekBar seekBar, ISlider slider) { if (NativeVersion.Supports(NativeApis.SeekBarSetMin)) { seekBar.Min = (int)slider.Minimum; } }
public static void SetColorFilter(this ADrawable drawable, AColor color, FilterMode mode) { if (drawable == null) { return; } if (NativeVersion.Supports(NativeApis.BlendModeColorFilter)) { BlendMode?filterMode29 = GetFilterMode(mode); if (filterMode29 != null) { drawable.SetColorFilter(new BlendModeColorFilter(color, filterMode29)); } } else { #pragma warning disable CS0612 // Type or member is obsolete PorterDuff.Mode?filterModePre29 = GetFilterModePre29(mode); #pragma warning restore CS0612 // Type or member is obsolete if (filterModePre29 != null) #pragma warning disable CS0618 // Type or member is obsolete { drawable.SetColorFilter(color, filterModePre29); } #pragma warning restore CS0618 // Type or member is obsolete } }
internal static UIView GetTrackSubview(this UISwitch uISwitch) { UIView uIView; if (NativeVersion.IsAtLeast(13)) { uIView = uISwitch.Subviews[0].Subviews[0]; } else { uIView = uISwitch.Subviews[0].Subviews[0].Subviews[0]; } return(uIView); }
public static void UpdateTrackColor(this UISwitch uiSwitch, ISwitch view, UIColor?defaultOnTrackColor, UIColor?defaultOffTrackColor) { if (view == null) { return; } if (view.TrackColor == Forms.Color.Default) { uiSwitch.OnTintColor = defaultOnTrackColor; } else { uiSwitch.OnTintColor = view.TrackColor.ToNative(); } UIView uIView; if (NativeVersion.IsAtLeast(13)) { uIView = uiSwitch.Subviews[0].Subviews[0]; } else { uIView = uiSwitch.Subviews[0].Subviews[0].Subviews[0]; } if (view.TrackColor == Forms.Color.Default) { uIView.BackgroundColor = defaultOffTrackColor; } else { uIView.BackgroundColor = uiSwitch.OnTintColor; } }