using System;
|
using Shared.Common;
|
|
namespace Shared.Phone.Device.CommonForm
|
{
|
public class RoomMainView : FrameLayout
|
{
|
/// <summary>
|
/// SceneIcon
|
/// </summary>
|
public ImageView Icon;
|
/// <summary>
|
/// RoomNameButton
|
/// </summary>
|
public Button RoomNameButton;
|
/// <summary>
|
/// CardBG
|
/// </summary>
|
private Button CardBG;
|
|
/// <summary>
|
/// RoomMainView
|
/// </summary>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
public RoomMainView(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(495),
|
Height = Application.GetMinRealAverage(354),
|
UnSelectedImagePath = "Room/RoomCardView.png",
|
Gravity = Gravity.CenterHorizontal
|
};
|
AddChidren(CardBG);
|
|
Icon = new ImageView
|
{
|
X = Application.GetMinRealAverage(14),
|
Width = Application.GetMinRealAverage(467),
|
Height = Application.GetMinRealAverage(311),
|
Gravity = Gravity.CenterHorizontal,
|
Radius=(uint)Application.GetMinRealAverage(29)
|
};
|
AddChidren(Icon);
|
|
var nameBG = new Button
|
{
|
X=Application.GetMinRealAverage(14),
|
Width = Application.GetMinRealAverage(141),
|
Height = Application.GetMinRealAverage(84),
|
UnSelectedImagePath = "Room/RoomCardView_Name.png",
|
};
|
AddChidren(nameBG);
|
|
RoomNameButton = new Button()
|
{
|
X = Application.GetMinRealAverage(14),
|
Width = Application.GetMinRealAverage(141),
|
Height = Application.GetMinRealAverage(84),
|
TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
|
TextSize=14,
|
IsBold=true
|
};
|
AddChidren(RoomNameButton);
|
}
|
|
/// <summary>
|
/// SetRoomName
|
/// </summary>
|
/// <param name="name"></param>
|
public void SetRoomName(string name)
|
{
|
RoomNameButton.Text = name;
|
}
|
|
/// <summary>
|
/// SetRoomIcon
|
/// </summary>
|
/// <param name="imagePath"></param>
|
public void SetRoomIcon(string imagePath)
|
{
|
Icon.ImagePath = imagePath;
|
}
|
|
|
}
|
}
|