зеркало из https://github.com/DeGsoft/maui-linux.git
Родитель
62a32bcc0d
Коммит
9493446d93
|
@ -38,7 +38,7 @@ namespace Xamarin.Forms.Controls
|
|||
|
||||
var thumbColorSwitch = new Switch() { ThumbColor = Color.Yellow };
|
||||
var thumbColorContainer = new ValueViewContainer<Switch>(Test.Switch.ThumbColor, thumbColorSwitch, nameof(Switch.ThumbColor), value => value.ToString());
|
||||
var changeThumbColorButton = new Button { Text = "Change ThumbColor", Command = new Command(() => thumbColorSwitch.ThumbColor = Color.Azure) };
|
||||
var changeThumbColorButton = new Button { Text = "Change ThumbColor", Command = new Command(() => thumbColorSwitch.ThumbColor = Color.Lime) };
|
||||
var clearThumbColorButton = new Button { Text = "Clear ThumbColor", Command = new Command(() => thumbColorSwitch.ThumbColor = Color.Default) };
|
||||
thumbColorContainer.ContainerLayout.Children.Add(changeThumbColorButton);
|
||||
thumbColorContainer.ContainerLayout.Children.Add(clearThumbColorButton);
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
if (Element == null)
|
||||
return;
|
||||
|
||||
Control.ThumbDrawable.SetColorFilter(Element.ThumbColor, _defaultThumbColorFilter);
|
||||
Control.ThumbDrawable.SetColorFilter(Element.ThumbColor, _defaultThumbColorFilter, PorterDuff.Mode.Multiply);
|
||||
}
|
||||
|
||||
void HandleToggled(object sender, EventArgs e)
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
drawable.SetColorFilter(colorFilter);
|
||||
}
|
||||
|
||||
public static void SetColorFilter(this ADrawable drawable, Color color, AColorFilter defaultColorFilter)
|
||||
public static void SetColorFilter(this ADrawable drawable, Color color, AColorFilter defaultColorFilter, PorterDuff.Mode mode)
|
||||
{
|
||||
if (drawable == null)
|
||||
return;
|
||||
|
@ -38,7 +38,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
return;
|
||||
}
|
||||
|
||||
drawable.SetColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn);
|
||||
drawable.SetColorFilter(color.ToAndroid(), mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
void UpdateThumbColor()
|
||||
{
|
||||
Control.Thumb.SetColorFilter(Element.ThumbColor, defaultthumbcolorfilter);
|
||||
Control.Thumb.SetColorFilter(Element.ThumbColor, defaultthumbcolorfilter, PorterDuff.Mode.SrcIn);
|
||||
}
|
||||
|
||||
void UpdateThumbImage()
|
||||
|
|
|
@ -138,7 +138,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
if (Element == null)
|
||||
return;
|
||||
|
||||
Control.ThumbDrawable.SetColorFilter(Element.ThumbColor, _defaultThumbColorFilter);
|
||||
Control.ThumbDrawable.SetColorFilter(Element.ThumbColor, _defaultThumbColorFilter, PorterDuff.Mode.Multiply);
|
||||
}
|
||||
|
||||
void HandleToggled(object sender, EventArgs e)
|
||||
|
|
Загрузка…
Ссылка в новой задаче