/// Button's icon part.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageView ButtonIcon
+ public ImageView Icon
{
get
{
/// Button's overlay image part.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageView ButtonOverlay
+ public ImageView OverlayImage
{
get
{
/// Button's text part.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextLabel ButtonText
+ public TextLabel TextLabel
{
get
{
{
Extension?.OnDispose(this);
- if (ButtonIcon != null)
+ if (Icon != null)
{
- Utility.Dispose(ButtonIcon);
+ Utility.Dispose(Icon);
}
- if (ButtonText != null)
+ if (TextLabel != null)
{
- Utility.Dispose(ButtonText);
+ Utility.Dispose(TextLabel);
}
- if (ButtonOverlay != null)
+ if (OverlayImage != null)
{
- Utility.Dispose(ButtonOverlay);
+ Utility.Dispose(OverlayImage);
}
}
Extension = buttonStyle.CreateExtension();
if (buttonStyle.Overlay != null)
{
- ButtonOverlay?.ApplyStyle(buttonStyle.Overlay);
+ OverlayImage?.ApplyStyle(buttonStyle.Overlay);
}
if (buttonStyle.Text != null)
{
- ButtonText?.ApplyStyle(buttonStyle.Text);
+ TextLabel?.ApplyStyle(buttonStyle.Text);
}
if (buttonStyle.Icon != null)
{
- ButtonIcon?.ApplyStyle(buttonStyle.Icon);
+ Icon?.ApplyStyle(buttonStyle.Icon);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void MeasureText()
{
- if (Style.IconRelativeOrientation == null || ButtonIcon == null || ButtonText == null)
+ if (Style.IconRelativeOrientation == null || Icon == null || TextLabel == null)
{
return;
}
- ButtonText.WidthResizePolicy = ResizePolicyType.Fixed;
- ButtonText.HeightResizePolicy = ResizePolicyType.Fixed;
+ TextLabel.WidthResizePolicy = ResizePolicyType.Fixed;
+ TextLabel.HeightResizePolicy = ResizePolicyType.Fixed;
int textPaddingStart = Style.TextPadding.Start;
int textPaddingEnd = Style.TextPadding.End;
int textPaddingTop = Style.TextPadding.Top;
if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom)
{
- ButtonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
- ButtonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - ButtonIcon.SizeHeight;
+ TextLabel.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
+ TextLabel.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - Icon.SizeHeight;
}
else
{
- ButtonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - ButtonIcon.SizeWidth;
- ButtonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
+ TextLabel.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - Icon.SizeWidth;
+ TextLabel.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
}
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void LayoutChild()
{
- if (Style.IconRelativeOrientation == null || ButtonIcon == null || ButtonText == null)
+ if (Style.IconRelativeOrientation == null || Icon == null || TextLabel == null)
{
return;
}
- var buttonIcon = ButtonIcon;
- var buttonText = ButtonText;
+ var buttonIcon = Icon;
+ var buttonText = TextLabel;
int textPaddingStart = Style.TextPadding.Start;
int textPaddingEnd = Style.TextPadding.End;
[EditorBrowsable(EditorBrowsableState.Never)]
public TextLabel GetCurrentText(ButtonExtension extension)
{
- return (extension == Extension) ? ButtonText : null;
+ return (extension == Extension) ? TextLabel : null;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageView GetCurrentIcon(ButtonExtension extension)
{
- return (extension == Extension) ? ButtonIcon : null;
+ return (extension == Extension) ? Icon : null;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public ImageView GetCurrentOverlayImage(ButtonExtension extension)
{
- return (extension == Extension) ? ButtonOverlay : null;
+ return (extension == Extension) ? OverlayImage : null;
}
}
}
textButton.BackgroundImage = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
textButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
textButton.Size = new Size(300, 80);
- textButton.ButtonText.Text = "Button";
+ textButton.TextLabel.Text = "Button";
parent1.Add(textButton);
//Only show an icon button.
iconButton.BackgroundImage = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
iconButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
iconButton.Size = new Size(80, 80);
- iconButton.ButtonIcon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
+ iconButton.Icon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
parent2.Add(iconButton);
iconButton.ClickEvent += (ojb, e) => {
- var btn = iconButton.ButtonIcon.GetParent() as Button;
+ var btn = iconButton.Icon.GetParent() as Button;
string name = btn.Name;
};
iconTextButton.BackgroundImage = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
iconTextButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
iconTextButton.IconRelativeOrientation = Button.IconOrientation.Left;
- iconTextButton.ButtonIcon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
+ iconTextButton.Icon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
iconTextButton.IconPadding = new Extents(20, 20, 20, 20);
iconTextButton.TextPadding = new Extents(20, 50, 20, 20);
iconTextButton.Size = new Size(500, 300);
Url = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
Border = new Rectangle(5, 5, 5, 5)
};
- utilityToggleButton.ButtonOverlay.Border = new Rectangle(5, 5, 5, 5);
+ utilityToggleButton.OverlayImage.Border = new Rectangle(5, 5, 5, 5);
utilityToggleButton.Size = new Size(300, 80);
parent1.Add(utilityToggleButton);
Url = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_shadow.png",
Border = new Rectangle(5, 5, 5, 5)
};
- utilityOvalButton.ButtonOverlay.Border = new Rectangle(5, 5, 5, 5);
+ utilityOvalButton.OverlayImage.Border = new Rectangle(5, 5, 5, 5);
utilityOvalButton.Size = new Size(104, 104);
- utilityOvalButton.ButtonText.PointSize = 20;
+ utilityOvalButton.TextLabel.PointSize = 20;
parent1.Add(utilityOvalButton);
///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
iconTextButton.IconRelativeOrientation = Button.IconOrientation.Left;
break;
case "5":
- iconTextButton.ButtonIcon.Padding.Start = 50;
+ iconTextButton.Icon.Padding.Start = 50;
break;
case "6":
- iconTextButton.ButtonIcon.Padding.End = 50;
+ iconTextButton.Icon.Padding.End = 50;
break;
case "7":
iconTextButton.LayoutDirection = ViewLayoutDirectionType.RTL;
utilityCheckBox[i].Size = new Size(48, 48);
utilityCheckBox[i].Margin = new Extents(76, 76, 25, 25);
- utilityCheckBox[i].ButtonIcon.Size = new Size(48, 48);
+ utilityCheckBox[i].Icon.Size = new Size(48, 48);
group[0].Add(utilityCheckBox[i]);
//Create family radio button.
familyCheckBox[i].Size = new Size(48, 48);
familyCheckBox[i].Margin = new Extents(76, 76, 25, 25);
- familyCheckBox[i].ButtonIcon.Size = new Size(48, 48);
+ familyCheckBox[i].Icon.Size = new Size(48, 48);
group[1].Add(familyCheckBox[i]);
//Create food radio button.
foodCheckBox[i] = new CheckBox();
foodCheckBox[i].ApplyStyle(foodStyle);
foodCheckBox[i].Size = new Size(48, 48);
familyCheckBox[i].Margin = new Extents(76, 76, 25, 25);
- foodCheckBox[i].ButtonIcon.Size = new Size(48, 48);
+ foodCheckBox[i].Icon.Size = new Size(48, 48);
group[2].Add(foodCheckBox[i]);
//Create kitchen radio button.
kitchenCheckBox[i].WidthSpecification = 48;
kitchenCheckBox[i].HeightSpecification = 48;
kitchenCheckBox[i].Margin = new Extents(76, 76, 25, 25);
- kitchenCheckBox[i].ButtonIcon.Size = new Size(48, 48);
+ kitchenCheckBox[i].Icon.Size = new Size(48, 48);
group[3].Add(kitchenCheckBox[i]);
dropDown.HeaderText.PointSize = 28;
dropDown.HeaderText.FontFamily = "SamsungOneUI 500C";
dropDown.HeaderText.PositionX = 50;
- dropDown.Button.ButtonText.Text = "DropDown Text";
- dropDown.Button.ButtonIcon.Size = new Size(48, 48);
+ dropDown.Button.TextLabel.Text = "DropDown Text";
+ dropDown.Button.Icon.Size = new Size(48, 48);
dropDown.Button.IconRelativeOrientation = Button.IconOrientation.Right;
dropDown.Button.ParentOrigin = ParentOrigin.CenterLeft;
dropDown.Button.PivotPoint = PivotPoint.CenterLeft;
button.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
button.WidthSpecification = 580;
button.HeightSpecification = 80;
- button.ButtonText.Text = "LayoutDirection is left to right";
+ button.TextLabel.Text = "LayoutDirection is left to right";
button.ClickEvent += ButtonClickEvent;
parent1.Add(parent2);
{
popup.LayoutDirection = ViewLayoutDirectionType.RTL;
popup2.LayoutDirection = ViewLayoutDirectionType.RTL;
- button.ButtonText.Text = "LayoutDirection is right to left";
+ button.TextLabel.Text = "LayoutDirection is right to left";
}
else
{
popup.LayoutDirection = ViewLayoutDirectionType.LTR;
popup2.LayoutDirection = ViewLayoutDirectionType.LTR;
- button.ButtonText.Text = "LayoutDirection is left to right";
+ button.TextLabel.Text = "LayoutDirection is left to right";
}
}
};
utilityRadioButton[i].ApplyStyle(utilityStyle);
utilityRadioButton[i].Size = new Size(48, 48);
- utilityRadioButton[i].ButtonIcon.Size = new Size(48, 48);
+ utilityRadioButton[i].Icon.Size = new Size(48, 48);
group[0].Add(utilityRadioButton[i]);
// create family radio button.
};
familyRadioButton[i].ApplyStyle(familyStyle);
familyRadioButton[i].Size = new Size(48, 48);
- familyRadioButton[i].ButtonIcon.Size = new Size(48, 48);
+ familyRadioButton[i].Icon.Size = new Size(48, 48);
group[1].Add(familyRadioButton[i]);
};
foodRadioButton[i].ApplyStyle(foodStyle);
foodRadioButton[i].Size = new Size(150, 48);
- foodRadioButton[i].ButtonIcon.Size = new Size(48, 48);
+ foodRadioButton[i].Icon.Size = new Size(48, 48);
group[2].Add(foodRadioButton[i]);
};
kitchenRadioButton[i].ApplyStyle(kitchenStyle);
kitchenRadioButton[i].Size = new Size(48, 48);
- kitchenRadioButton[i].ButtonIcon.Size = new Size(48, 48);
+ kitchenRadioButton[i].Icon.Size = new Size(48, 48);
group[3].Add(kitchenRadioButton[i]);
// Button of switching mode
button = new Button(buttonStyle);
button.Size = new Size(500, 80);
- button.ButtonText.Text = mode[index];
+ button.TextLabel.Text = mode[index];
button.ClickEvent += ButtonClickEvent;
parentView[2].Add(button);
// Button of LayoutDirection
button2 = new Button(buttonStyle);
button2.Size = new Size(500, 80);
- button2.ButtonText.Text = "LayoutDirection is left to right";
+ button2.TextLabel.Text = "LayoutDirection is left to right";
button2.ClickEvent += ButtonClickEvent2;
parentView[2].Add(button2);
}
private void ButtonClickEvent(object sender, Button.ClickEventArgs e)
{
index = (index + 1) % 4;
- button.ButtonText.Text = mode[index];
+ button.TextLabel.Text = mode[index];
tab.Underline.BackgroundColor = color[index];
tab.TextColorSelector = new ColorSelector
{
{
tab.LayoutDirection = ViewLayoutDirectionType.RTL;
tab2.LayoutDirection = ViewLayoutDirectionType.RTL;
- button2.ButtonText.Text = "LayoutDirection is right to left";
+ button2.TextLabel.Text = "LayoutDirection is right to left";
}
else
{
tab.LayoutDirection = ViewLayoutDirectionType.LTR;
tab2.LayoutDirection = ViewLayoutDirectionType.LTR;
- button2.ButtonText.Text = "LayoutDirection is left to right";
+ button2.TextLabel.Text = "LayoutDirection is left to right";
}
}
}