using System;
|
using Shared.Common;
|
namespace Shared.Phone.Device.CommonForm
|
{
|
public class SceneTargetFunctionRow : FrameLayout
|
{
|
/// <summary>
|
/// TipBtn
|
/// </summary>
|
public Button Icon;
|
/// <summary>
|
/// TitleBtn
|
/// </summary>
|
public Button StatuBtn;
|
/// <summary>
|
/// NameBtn
|
/// </summary>
|
private Button NameBtn;
|
/// <summary>
|
/// ZoneBtn
|
/// </summary>
|
private Button ZoneBtn;
|
/// <summary>
|
/// line
|
/// </summary>
|
private Button line;
|
/// <summary>
|
/// SceneTargetRow
|
/// </summary>
|
/// <param name="y"></param>
|
public SceneTargetFunctionRow(int y)
|
{
|
X = Application.GetRealWidth(0);
|
Y = Application.GetRealHeight(y);
|
Width = Application.GetRealWidth(1080);
|
Height = Application.GetRealHeight(127 - 2);
|
}
|
|
/// <summary>
|
/// Init
|
/// </summary>
|
public void Init()
|
{
|
Icon = new Button
|
{
|
X = Application.GetRealWidth(104),
|
Width = Application.GetMinRealAverage(80),
|
Height = Application.GetMinRealAverage(80),
|
Gravity = Gravity.CenterVertical
|
};
|
AddChidren(Icon);
|
|
NameBtn = new Button
|
{
|
X = Application.GetRealWidth(219),
|
Y = Application.GetRealHeight(14),
|
Width = Application.GetRealWidth(400),
|
Height = Application.GetRealHeight(58),
|
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = R.MyInternationalizationString.Delay,
|
TextSize = 14
|
};
|
AddChidren(NameBtn);
|
|
ZoneBtn = new Button
|
{
|
X = Application.GetRealWidth(219),
|
Y = Application.GetRealHeight(72),
|
Width = Application.GetRealWidth(400),
|
Height = Application.GetRealHeight(49),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
|
TextSize = 12
|
};
|
AddChidren(ZoneBtn);
|
|
StatuBtn = new Button
|
{
|
X = Application.GetRealWidth(650),
|
Width = Application.GetRealWidth(350),
|
Height = Application.GetRealHeight(100),
|
Gravity = Gravity.CenterVertical,
|
TextAlignment = TextAlignment.CenterRight,
|
TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
|
TextSize = 14
|
};
|
AddChidren(StatuBtn);
|
|
line = new Button()
|
{
|
X = Application.GetRealWidth(222),
|
Y = Height - 1,
|
Width = Application.GetRealWidth(800),
|
Height = 1,
|
BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
|
};
|
AddChidren(line);
|
}
|
|
/// <summary>
|
/// SetStatuText
|
/// </summary>
|
/// <param name="title"></param>
|
public void SetStatuText(string title)
|
{
|
StatuBtn.Text = title;
|
}
|
|
/// <summary>
|
/// SetIcon
|
/// </summary>
|
/// <param name="imagePath"></param>
|
public void SetIcon(string imagePath)
|
{
|
Icon.UnSelectedImagePath = imagePath;
|
}
|
|
/// <summary>
|
/// SetZoneText
|
/// </summary>
|
/// <param name="title"></param>
|
public void SetZoneText(string title)
|
{
|
ZoneBtn.Text = title;
|
}
|
|
/// <summary>
|
/// SetNameText
|
/// </summary>
|
/// <param name="title"></param>
|
public void SetNameText(string title)
|
{
|
NameBtn.Text = title;
|
}
|
|
/// <summary>
|
/// HideLine
|
/// </summary>
|
/// <param name="hiden"></param>
|
public void HideLine(bool hiden)
|
{
|
line.Visible = !hiden;
|
}
|
}
|
}
|