void UpdateEnableRipple() { var oldValue = _useRipple; var newValue = AddCommand.GetEnableRipple(Element); _useRipple = newValue; if (newValue == oldValue) { return; } var color = AddCommand.GetEffectColor(Element); if (color == Xamarin.Forms.Color.Default) { return; } if (!oldValue && newValue) { AddRipple(); } if (oldValue && !newValue) { RemoveRipple(); } UpdateEffectColor(); }
void UpdateEffectColor() { _view.Touch -= View_Touch; if (_layer != null) { _layer.Dispose(); _layer = null; } var color = AddCommand.GetEffectColor(Element); if (color == Xamarin.Forms.Color.Default) { return; } if (_useRipple) { _ripple.SetColor(getPressedColorSelector(color.ToAndroid())); } else { _layer = new FrameLayout(Container.Context); _layer.LayoutParameters = new ViewGroup.LayoutParams(-1, -1); _layer.SetBackgroundColor(color.ToAndroid()); _view.Touch += View_Touch; } }
void UpdateEffectColor() { if (_useRipple) { var color = AddCommand.GetEffectColor(Element); if (color == Xamarin.Forms.Color.Default) { color = Xamarin.Forms.Color.Accent; } _ripple?.SetColor(getPressedColorSelector(color.ToAndroid())); } }
void UpdateEffectColor() { if (_layer != null) { _layer.Dispose(); _layer = null; } var color = AddCommand.GetEffectColor(Element); if (color == Xamarin.Forms.Color.Default) { return; } _alpha = color.A < 1.0 ? 1 : 0.3; _layer = new UIView(); _layer.BackgroundColor = color.ToUIColor(); }
void UpdateEnableRipple() { _useRipple = AddCommand.GetEnableRipple(Element); var color = AddCommand.GetEffectColor(Element); if (color == Xamarin.Forms.Color.Default) { return; } if (_useRipple) { AddRipple(); } else { RemoveRipple(); } UpdateEffectColor(); }
protected override Color GetEffectColor() { return(AddCommand.GetEffectColor(Element)); }