using System;
|
using Shared.Common;
|
|
namespace Shared.Phone.Device.CommonForm
|
{
|
public class SceneMainView : FrameLayout
|
{
|
/// <summary>
|
/// name
|
/// </summary>
|
public Button TimeButton;
|
/// <summary>
|
/// collect
|
/// </summary>
|
public Button CollectButton;
|
/// <summary>
|
/// SceneIcon
|
/// </summary>
|
public Button SceneIcon;
|
/// <summary>
|
/// statu
|
/// </summary>
|
public Button SceneNameButton;
|
/// <summary>
|
/// CardBG
|
/// </summary>
|
private Button CardBG;
|
/// <summary>
|
/// v_Selected
|
/// </summary>
|
private bool v_Selected;
|
|
/// <summary>
|
/// IsSelected
|
/// </summary>
|
public bool IsSelected
|
{
|
set
|
{
|
try
|
{
|
v_Selected = value;
|
//SetStatu(v_Selected);
|
}
|
catch { };
|
}
|
get
|
{
|
return v_Selected;
|
}
|
}
|
|
public SceneMainView(int x, int y)
|
{
|
X = Application.GetRealWidth(x);
|
Y = Application.GetRealHeight(y);
|
Width = Application.GetMinRealAverage(487);
|
Height = Application.GetMinRealAverage(348);
|
}
|
|
/// <summary>
|
/// init
|
/// </summary>
|
public void Init()
|
{
|
|
CardBG = new Button
|
{
|
Width = Application.GetMinRealAverage(487),
|
Height = Application.GetMinRealAverage(348),
|
UnSelectedImagePath = "Item/FunctionCardView.png",
|
Gravity = Gravity.CenterHorizontal
|
};
|
AddChidren(CardBG);
|
|
SceneIcon = new Button
|
{
|
X = Application.GetMinRealAverage(14),
|
Width = Application.GetMinRealAverage(458),
|
Height = Application.GetRealHeight(305),
|
Gravity = Gravity.CenterHorizontal
|
};
|
AddChidren(SceneIcon);
|
|
var sceneBG = new Button
|
{
|
Width = Application.GetMinRealAverage(487),
|
Height = Application.GetMinRealAverage(348),
|
UnSelectedImagePath = "Item/SceneCard.png",
|
Gravity = Gravity.CenterHorizontal
|
};
|
AddChidren(sceneBG);
|
|
TimeButton = new Button()
|
{
|
X = Application.GetMinRealAverage(40),
|
Y = Application.GetMinRealAverage(17),
|
Width = Application.GetMinRealAverage(320),
|
Height = Application.GetMinRealAverage(63),
|
TextColor = ZigbeeColor.Current.GXCTextSelectedColor3,
|
TextAlignment = TextAlignment.CenterLeft,
|
Text="58s"
|
};
|
AddChidren(TimeButton);
|
|
CollectButton = new Button
|
{
|
X = Application.GetMinRealAverage(366),
|
Y = Application.GetMinRealAverage(14),
|
Width = Application.GetMinRealAverage(107),
|
Height = Application.GetMinRealAverage(107),
|
UnSelectedImagePath = "Item/Collection1.png",
|
SelectedImagePath = "Item/CollectionSelected1.png"
|
};
|
AddChidren(CollectButton);
|
|
SceneNameButton = new Button()
|
{
|
X = Application.GetMinRealAverage(46),
|
Y = Application.GetMinRealAverage(239),
|
Width = Application.GetMinRealAverage(279),
|
Height = Application.GetMinRealAverage(60),
|
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
|
SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
|
TextAlignment = TextAlignment.CenterLeft,
|
Text="起床"
|
};
|
AddChidren(SceneNameButton);
|
|
}
|
|
|
/// <summary>
|
/// SetTimeText
|
/// </summary>
|
/// <param name="name"></param>
|
public void SetTimeText(string name)
|
{
|
TimeButton.Width = Application.GetMinRealAverage(320);
|
TimeButton.Height = Application.GetMinRealAverage(63);
|
TimeButton.UnSelectedImagePath = string.Empty;
|
TimeButton.Text = name;
|
}
|
|
/// <summary>
|
/// SetTimeImage
|
/// </summary>
|
public void SetTimeImage()
|
{
|
TimeButton.Width = Application.GetMinRealAverage(63);
|
TimeButton.Height = Application.GetMinRealAverage(63);
|
TimeButton.UnSelectedImagePath = "Item/Time.png";
|
TimeButton.Text = string.Empty;
|
}
|
|
/// <summary>
|
/// SetStatu
|
/// </summary>
|
/// <param name="statu"></param>
|
public void SetSceneNameText(string statu)
|
{
|
SceneNameButton.Text = statu;
|
}
|
|
/// <summary>
|
/// SetIcon
|
/// </summary>
|
/// <param name="iconPath"></param>
|
public void SetIcon(string iconPath)
|
{
|
SceneIcon.UnSelectedImagePath = iconPath;
|
}
|
|
/// <summary>
|
/// SetCollect
|
/// </summary>
|
/// <param name="collect"></param>
|
public void SetCollect(bool collect)
|
{
|
CollectButton.IsSelected = collect;
|
}
|
}
|
}
|