public PopupEntryRenderer() { DefaultColor = new EColor(40, 40, 40, 255); //editfield bg default color RegisterPropertyHandler(PopupEntry.PopupBackgroundColorProperty, UpdatePopupBackgroundColor); RegisterPropertyHandler(PopupEntry.IsPopupOpenedProperty, UpdateIsPopupOpened); }
void ApplyBarItemColors(EToolbarItem item, BarItemColorType type, EColor color) { if (color.IsDefault) { ClearBarItemColors(item, type); } else { switch (type) { case BarItemColorType.Background: item.SetPartColor("bg", color); break; case BarItemColorType.Text: if (string.IsNullOrEmpty(item.Icon)) { item.SetPartColor("text", color); item.SetPartColor("text_pressed", color); item.SetPartColor("text_selected", color); } else { item.SetPartColor("text_under_icon", color); item.SetPartColor("text_under_icon_pressed", color); item.SetPartColor("text_under_icon_selected", color); } item.SetPartColor("underline", color); break; case BarItemColorType.SelectedTab: if (string.IsNullOrEmpty(item.Icon)) { item.SetPartColor("text_selected", color); } else { item.SetPartColor("text_under_icon_selected", color); item.SetPartColor("icon_selected", color); } item.SetPartColor("underline", color); break; case BarItemColorType.UnselectedTab: if (string.IsNullOrEmpty(item.Icon)) { item.SetPartColor("text", color); item.SetPartColor("text_pressed", color); } else { item.SetPartColor("text_under_icon", color); item.SetPartColor("text_under_icon_pressed", color); item.SetPartColor("icon", color); item.SetPartColor("icon_pressed", color); } break; default: break; } } }
public void HandleTouch(TouchStatus status, TouchInteractionStatus?touchInteractionStatus = null) { if (IsCanceled || effect == null) { return; } if (effect?.IsDisabled ?? true) { return; } if (touchInteractionStatus == TouchInteractionStatus.Started) { effect?.HandleUserInteraction(TouchInteractionStatus.Started); touchInteractionStatus = null; } effect.HandleTouch(status); if (touchInteractionStatus.HasValue) { effect.HandleUserInteraction(touchInteractionStatus.Value); } if (!effect.NativeAnimation) { return; } if (longTapStarted && !tapCompleted) { return; } var control = effect.Element; if (!(Platform.GetOrCreateRenderer(control)?.NativeView is Widget nativeView)) { return; } if (status == TouchStatus.Started) { var startColor = nativeView.BackgroundColor; if (startColor.IsDefault) { return; } var endColor = effect.NativeAnimationColor.ToNative(); if (endColor.IsDefault) { startColor = EColor.FromRgba(startColor.R, startColor.G, startColor.B, startColor.A / 2); endColor = startColor; } var transit = new Transit { Repeat = 1, Duration = .2 }; var colorEffect = new ColorEffect(startColor, endColor); colorEffect.EffectEnded += (s, e) => { transit?.Dispose(); }; transit.Objects.Add(nativeView); transit.AddEffect(colorEffect); transit.Go(.2); } }
protected override void ApplyTitleColor(EColor color) { _popupLayout.SetPartColor("text_title", color); }
protected virtual void ApplyTitleColor(EColor color) { this.SetTitleColor(color); }
public static void SetBackgroundColor(this ESlider slider, EColor color) { slider.SetPartColor(ThemeConstants.Slider.ColorClass.Background, color); }
public static void SetHandlerColor(this ESlider slider, EColor color) { slider.SetPartColor(ThemeConstants.Slider.ColorClass.Handler, color); slider.SetPartColor(ThemeConstants.Slider.ColorClass.HandlerPressed, color); }
public static void SetBottomlineColor(this GenListItem item, EColor color) { item.SetPartColor(ThemeConstants.GenListItem.ColorClass.BottomLine, color); }
public static void SetBackgroundColor(this GenListItem item, EColor color) { item.SetPartColor(ThemeConstants.GenListItem.ColorClass.Background, color); }
public static void SetBackgroundColor(this EToolbarItem item, EColor color) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Background, color); }
public static void SetUnderlineColor(this EToolbarItem item, EColor color) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Underline, color); }
public static void SetContentBackgroundColor(this Popup popup, EColor color) { popup.SetPartColor(ThemeConstants.Popup.ColorClass.ContentBackground, color); }
public static void SetTitleColor(this Popup popup, EColor color) { popup.SetPartColor(Device.Idiom == TargetIdiom.TV ? ThemeConstants.Popup.ColorClass.TV.Title : ThemeConstants.Popup.ColorClass.Title, color); }
public void SetClearButtonColor(EColor color) { ClearButtonColor = color; }
public void SetTitleColor(EColor color) { SetPartColor(Parts.Colors.Title, color); }
public static void SetTitleColor(this Popup popup, EColor color) { popup.SetPartColor(DeviceInfo.IsTV ? ThemeConstants.Popup.ColorClass.TV.Title : ThemeConstants.Popup.ColorClass.Title, color); }