public override void ApplyStyle(ViewStyle viewStyle) { base.ApplyStyle(viewStyle); ToastStyle toastStyle = viewStyle as ToastStyle; if (null != toastStyle) { if (null == textLabel) { textLabel = new TextLabel() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, WidthResizePolicy = ResizePolicyType.UseNaturalSize, HeightResizePolicy = ResizePolicyType.UseNaturalSize, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; this.Add(textLabel); } textLabel.ApplyStyle(toastStyle.Text); } }
public override void CopyFrom(BindableObject bindableObject) { base.CopyFrom(bindableObject); ToastStyle toastStyle = bindableObject as ToastStyle; if (toastStyle != null) { if (null != toastStyle.Text) { Text?.CopyFrom(toastStyle.Text); } Duration = toastStyle.Duration; } }
/// <summary> /// Apply style to toast. /// </summary> /// <param name="viewStyle">The style to apply.</param> /// <since_tizen> 8 </since_tizen> public override void ApplyStyle(ViewStyle viewStyle) { base.ApplyStyle(viewStyle); ToastStyle toastStyle = viewStyle as ToastStyle; if (null != toastStyle) { if (null == textLabel) { textLabel = new TextLabel(); this.Add(textLabel); } textLabel.ApplyStyle(toastStyle.Text); } }
/// <summary> /// Return default Toast style /// </summary> internal protected override ViewStyle GetAttributes() { ToastStyle style = new ToastStyle { WidthResizePolicy = ResizePolicyType.FitToChildren, HeightResizePolicy = ResizePolicyType.FitToChildren, BackgroundColor = new Color(0, 0, 0, 0.8f), Text = new TextLabelStyle() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, WidthResizePolicy = ResizePolicyType.UseNaturalSize, HeightResizePolicy = ResizePolicyType.UseNaturalSize, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, TextColor = Color.White, Padding = new Extents(12, 12, 8, 8), } }; return(style); }
public Toast(ToastStyle toastStyle) : base(toastStyle) { }
public ToastStyle(ToastStyle style) : base(style) { InitSubStyle(); this.CopyFrom(style); }
/// <summary> /// The constructor of the Toast class with specific Style. /// </summary> /// <param name="toastStyle">Construct Style</param> /// <since_tizen> 8 </since_tizen> public Toast(ToastStyle toastStyle) : base(toastStyle) { Initialize(); }
public ToastStyle(ToastStyle style) : base(style) { }
public Toast(ToastStyle style) : base(style) { Initialize(); }