public void Activate() { Window window = NUIApplication.GetDefaultWindow(); TextLabelStyle attr = new TextLabelStyle { Size = new Size(300, 39), BackgroundColor = Color.Black, TextColor = Color.White, }; /** * The title inherits textlabel. * Refer to textlabel. */ title = new Title(attr); title.Text = "The title can has a fadeOut effect."; /** * The title has a fadeout effect. * The default width is 32. You can change the value through FadeOutWidth. * ex) title.FadeOutWidth = 10; * The default color is BackgroundColor. You can change the color value through FadeOutColor. * ex) title.FadeOutColor = Color.Red; */ window.Add(title); }
public TabStyle(TabStyle style) : base(style) { UnderLine = new ViewStyle(); Text = new TextLabelStyle(); if (null == style) { return; } if (style.UnderLine != null) { UnderLine?.CopyFrom(style.UnderLine); } if (style.Text != null) { Text?.CopyFrom(style.Text); } if (style.ItemPadding != null) { ItemPadding = new Extents(style.ItemPadding.Start, style.ItemPadding.End, style.ItemPadding.Top, style.ItemPadding.Bottom); } else { ItemPadding = new Extents(0, 0, 0, 0); } ItemSpace = style.ItemSpace; UseTextNaturalSize = style.UseTextNaturalSize; }
protected virtual TextLabel CreateLabel(TextLabelStyle textStyle) { return(new TextLabel(textStyle) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }); }
protected virtual TextLabel CreateLabel(TextLabelStyle style) { return(new TextLabel(style) { HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, AccessibilityHidden = true, }); }
public TabStyle() : base() { ItemPadding = new Extents(0, 0, 0, 0); UseTextNaturalSize = false; ItemSpace = 0; UnderLine = new ViewStyle(); Text = new TextLabelStyle(); }
public override void ApplyStyle(ViewStyle viewStyle) { base.ApplyStyle(viewStyle); var pickerStyle = viewStyle as PickerStyle; if (pickerStyle == null) { return; } pickerScroller?.SetPickerStyle(pickerStyle); //Apply StartScrollOffset style. if (pickerStyle.StartScrollOffset != null) { startScrollOffset = (int)pickerStyle.StartScrollOffset.Height; } //Apply ItemTextLabel style. if (pickerStyle.ItemTextLabel != null) { if (itemTextLabel == null) { itemTextLabel = (TextLabelStyle)pickerStyle.ItemTextLabel.Clone(); } else { itemTextLabel.MergeDirectly(pickerStyle.ItemTextLabel); } itemHeight = (int)(pickerStyle.ItemTextLabel.Size?.Height ?? 0); if (itemList != null) { foreach (TextLabel textLabel in itemList) { textLabel.ApplyStyle(pickerStyle.ItemTextLabel); } } } //Apply PickerCenterLine style. if (pickerStyle.Divider != null && upLine != null && downLine != null) { upLine.ApplyStyle(pickerStyle.Divider); downLine.ApplyStyle(pickerStyle.Divider); downLine.PositionY = (int)pickerStyle.Divider.PositionY + itemHeight; } startScrollY = (itemHeight * dummyItemsForLoop) + startScrollOffset; startY = startScrollOffset; }
private void InitSubStyle() { 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 = Tizen.NUI.Color.White, }; }
private void InitSubStyle() { // TODO Apply proper shadow as a default for a Popup BoxShadow = new Shadow() { BlurRadius = 5, Offset = new Vector2(5, 5), }; Title = new TextLabelStyle() { Size = new Size(0, 0), PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, PivotPoint = Tizen.NUI.PivotPoint.TopLeft, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Bottom }; Buttons = new ButtonStyle() { Size = new Size(0, 0), PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, Overlay = new ImageViewStyle() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, WidthResizePolicy = ResizePolicyType.FillToParent, HeightResizePolicy = ResizePolicyType.FillToParent }, Text = new TextLabelStyle() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, WidthResizePolicy = ResizePolicyType.FillToParent, HeightResizePolicy = ResizePolicyType.FillToParent, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center } }; }
public void TabStyleText() { tlog.Debug(tag, $"TabStyleText START"); var testingTarget = new TabStyle(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <TabStyle>(testingTarget, "Should return TabStyle instance."); TextLabelStyle text = new TextLabelStyle() { Size = new Size(2, 18), PointSize = 15.0f }; testingTarget.Text = text; tlog.Debug(tag, "Text : " + testingTarget.Text); tlog.Debug(tag, $"TabStyleText END (OK)"); }
/// <summary> /// Constructor /// </summary> public OverlayAnimationButtonStyle() : base() { CornerRadius = 10; BackgroundColor = new Selector <Color> { All = new Color(0.3f, 0.3f, 0.3f, 0.5f) }; // PositionUsesPivotPoint = true; IconRelativeOrientation = Button.IconOrientation.Top; Text = new TextLabelStyle { FontFamily = "SamsungOne 700", PixelSize = 20, TextColor = new Selector <Color> { Normal = new Color(1, 1, 1, 0.70f), Pressed = new Color(1, 1, 1, 0.60f), Disabled = new Color(1, 1, 1, 0.40f), }, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; Icon = new ImageViewStyle { WidthResizePolicy = ResizePolicyType.SizeRelativeToParent, HeightResizePolicy = ResizePolicyType.SizeRelativeToParent, SizeModeFactor = new Vector3(0.35f, 0.35f, 0.35f), Opacity = new Selector <float?> { Normal = 0.7f, Pressed = 0.5f } }; Opacity = new Selector <float?> { Disabled = 0.3f, Other = 1.0f }; }
public Title(TextLabelStyle textLabelStyle) : base(textLabelStyle) { Initialize(); }
public PopupStyle(PopupStyle style) : base(style) { Title = new TextLabelStyle(); Buttons = new ButtonStyle(); this.CopyFrom(style); }