using System;
|
using System.Collections.Generic;
|
using Shared;
|
using Shared.Common;
|
using Shared.Phone;
|
using Shared.R;
|
using ZigBee.Device;
|
|
|
|
namespace Shared.Phone.Device.Logic
|
{
|
public class DelayTime : FrameLayout
|
{
|
public DelayTime()
|
{
|
Tag = "Logic";
|
}
|
Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>();
|
|
public void Show()
|
{
|
this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
|
var topFrameLayout = new FrameLayout
|
{
|
Height = Application.GetRealHeight(140),
|
Y = Application.GetRealHeight(80),
|
};
|
AddChidren(topFrameLayout);
|
|
var titleName = new Button
|
{
|
Text = "添加延时",
|
TextSize = 17,
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
};
|
topFrameLayout.AddChidren(titleName);
|
|
|
var back = new Button
|
{
|
Width = Application.GetRealWidth(110),
|
Height = Application.GetRealHeight(110),
|
X = Application.GetRealWidth(20),
|
Gravity = Gravity.CenterVertical,
|
UnSelectedImagePath = "ZigeeLogic/Back.png",
|
};
|
topFrameLayout.AddChidren(back);
|
back.MouseDownEventHandler += (sender, e) =>
|
{
|
RemoveFromParent();
|
};
|
|
var middle = new FrameLayout();
|
middle.Y = topFrameLayout.Bottom;
|
middle.Height = Application.GetRealHeight(1920 - 220 - 174);
|
middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
|
this.AddChidren(middle);
|
|
|
|
|
var timeview = new TimeView
|
{
|
Y = Application.GetRealHeight(400),
|
Height = Application.GetRealHeight(600),
|
BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor,
|
Width = Application.GetRealWidth(1080),
|
};
|
middle.AddChidren(timeview);
|
|
var btnComplete = new Button
|
{
|
Y = middle.Bottom,
|
Height = Application.GetRealHeight(174),
|
TextID = MyInternationalizationString.complete,
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
TextSize = 16,
|
};
|
AddChidren(btnComplete);
|
|
|
///完成点击事件
|
btnComplete.MouseUpEventHandler += (sender, e) =>
|
{
|
Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
|
actionsInfo.Add("LinkType", 10);
|
actionsInfo.Add("DelayTime", 5);
|
Common.Logic.CurrentLogic.Actions.Add(actionsInfo);
|
var logicCommunalPage = new LogicCommunalPage { };
|
UserView.HomePage.Instance.AddChidren(logicCommunalPage);
|
UserView.HomePage.Instance.PageIndex += 1;
|
logicCommunalPage.Show(() => { });
|
};
|
}
|
}
|
}
|