using System;
|
using Shared.Common;
|
using ZigBee.Device;
|
|
namespace Shared.Phone.UserCenter.DoorLock
|
{
|
public class TimeSettignPage : DoorLockCommonLayout, ZigBee.Common.IStatus
|
{
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="doorLock"></param>
|
public TimeSettignPage(ZigBee.Device.DoorLock doorLock, string timeType)
|
{
|
this.doorLock = doorLock;
|
setTimeType = timeType;
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
|
ZigBee.Device.ZbGateway.StatusList.Add(this);
|
}
|
|
#region ◆ 变量申明__________________________
|
ZigBee.Device.DoorLock doorLock;
|
string setTimeType = "";
|
Action<string> dateAction; //日期通知
|
Action<string> timeAction; //时间通知
|
#endregion
|
|
/// <summary>
|
/// UI显示
|
/// </summary>
|
public void Show()
|
{
|
if (setTimeType == "ValidTime")
|
{
|
this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.ValidTime));
|
}
|
else
|
{
|
this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.InValidTime));
|
|
}
|
|
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
|
{
|
RemoveFromParent();
|
};
|
this.btnBack.MouseUpEventHandler += eHandlerBack;
|
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
|
this.MidFrameLayout(this);
|
|
MidFrameLayoutContent();
|
}
|
|
public void MidFrameLayoutContent()
|
{
|
var MidTopFrameLayout = new FrameLayout()
|
{
|
BackgroundColor = ZigbeeColor.Current.XMWhite,
|
};
|
this.midFrameLayout.AddChidren(MidTopFrameLayout);
|
|
for (int i = 0; i < 2; i++)
|
{
|
var btnDateTime = new Button()
|
{
|
Width = Application.GetRealWidth(743 - 300),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(58),
|
TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
|
TextAlignment = TextAlignment.CenterLeft,
|
TextSize = 12,
|
};
|
MidTopFrameLayout.AddChidren(btnDateTime);
|
|
var textDisplay = new Button()
|
{
|
Width = Application.GetRealWidth(300),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(580),
|
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
|
TextAlignment = TextAlignment.CenterRight,
|
TextSize = 12,
|
};
|
MidTopFrameLayout.AddChidren(textDisplay);
|
|
var btnNext = new Button()
|
{
|
Width = Application.GetRealWidth(58),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(956),
|
Y = Application.GetRealHeight(204),
|
//BackgroundColor = ZigbeeColor.Current.XMOrange,
|
UnSelectedImagePath = "Item/Next.png",
|
SelectedImagePath = "Item/Down.png",
|
};
|
MidTopFrameLayout.AddChidren(btnNext);
|
|
var btnLine = new FrameLayout()
|
{
|
Width = Application.GetRealWidth(965),
|
Height = Application.GetRealHeight(5),
|
X = Application.GetRealWidth(58),
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
|
|
};
|
MidTopFrameLayout.AddChidren(btnLine);
|
|
if (i == 0)
|
{
|
btnDateTime.Y = Application.GetRealHeight(50);
|
btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Date);
|
btnLine.Y = Application.GetRealHeight(23 + 127);
|
textDisplay.Text = "8月6日";
|
textDisplay.Y = btnNext.Y = btnDateTime.Y;
|
|
EventHandler<MouseEventArgs> stattimeclick = (sender1, e1) =>
|
{
|
var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
|
this.midFrameLayout.AddChidren(flMain);
|
|
flMain.MouseUpEventHandler += (sender11, e11) =>
|
{
|
flMain.RemoveFromParent();
|
};
|
|
var timeview = new DateView
|
{
|
Y = Application.GetRealHeight(1920 - 800),
|
Height = Application.GetRealHeight(800),
|
BackgroundColor = ZigbeeColor.Current.LogicTimeViewColor,
|
Width = Application.GetRealWidth(1080),
|
};
|
flMain.AddChidren(timeview);
|
|
var btnSave = new Button
|
{
|
Y = Application.GetRealHeight(1920 - 800),
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(150),
|
Text = "完成",
|
TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton,
|
X = Application.GetRealWidth(1080 - 200),
|
};
|
flMain.AddChidren(btnSave);
|
};
|
btnNext.MouseDownEventHandler += stattimeclick;
|
}
|
else if (i == 1)
|
{
|
btnDateTime.Y = Application.GetRealHeight(200);
|
btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Time);
|
btnLine.Y = Application.GetRealHeight(40 + 127 + 127);
|
textDisplay.Text = "12 : 00";
|
textDisplay.Y = btnNext.Y = btnDateTime.Y;
|
|
EventHandler<MouseEventArgs> endtimeclick = (sender, e) =>
|
{
|
var flMain = new FrameLayout { BackgroundColor = 0x00000000 };
|
this.midFrameLayout.AddChidren(flMain);
|
flMain.MouseUpEventHandler += (sender11, e11) =>
|
{
|
flMain.RemoveFromParent();
|
};
|
|
var timeview = new TimeView()
|
{
|
Y = Application.GetRealHeight(1920 - 800),
|
Height = Application.GetRealHeight(800),
|
BackgroundColor = ZigbeeColor.Current.LogicTimeViewColor,
|
Width = Application.GetRealWidth(1080),
|
};
|
flMain.AddChidren(timeview);
|
|
var btnSave = new Button
|
{
|
Y = Application.GetRealHeight(1920 - 800),
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(150),
|
Text = "完成",
|
TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton,
|
X = Application.GetRealWidth(1080 - 200),
|
};
|
flMain.AddChidren(btnSave);
|
|
btnSave.MouseUpEventHandler += (sender2, e2) =>
|
{
|
flMain.RemoveFromParent();
|
};
|
};
|
|
btnNext.MouseDownEventHandler += endtimeclick;
|
}
|
}
|
}
|
|
#region ◆ 接口实现__________________________
|
/// <summary>
|
/// 处理变化事件 --将弃用 改用DeviceInfoChange()
|
/// </summary>
|
/// <returns>The changed.</returns>
|
/// <param name="common">Common.</param>
|
public void Changed(CommonDevice common)
|
{
|
|
}
|
/// <summary>
|
/// 处理变化事件
|
/// </summary>
|
/// <param name="common"></param>
|
/// <param name="typeTag"></param>
|
public void DeviceInfoChange(CommonDevice common, string typeTag)
|
{
|
}
|
/// <summary>
|
/// Changeds the IL ogic status.
|
/// </summary>
|
/// <param name="logic">Logic.</param>
|
public void ChangedILogicStatus(ZigBee.Device.Logic logic)
|
{
|
}
|
/// <summary>
|
/// Changeds the IS cene status.
|
/// </summary>
|
/// <param name="scene">Scene.</param>
|
public void ChangedISceneStatus(Scene scene)
|
{
|
}
|
#endregion
|
}
|
}
|