Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        /// <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);
            }
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
 public Toast(ToastStyle toastStyle) : base(toastStyle)
 {
 }
Exemplo n.º 6
0
 public ToastStyle(ToastStyle style) : base(style)
 {
     InitSubStyle();
     this.CopyFrom(style);
 }
Exemplo n.º 7
0
 /// <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();
 }
Exemplo n.º 8
0
 public ToastStyle(ToastStyle style) : base(style)
 {
 }
Exemplo n.º 9
0
 public Toast(ToastStyle style) : base(style)
 {
     Initialize();
 }