using System;
|
using Shared;
|
namespace HDL_ON.UI.UI2.Intelligence.Automation
|
{
|
public class Weather : FrameLayout
|
{
|
public Weather()
|
{
|
Tag = "Logic";
|
}
|
|
public void Show()
|
{
|
#region 界面布局
|
LogicView.TopView topView = new LogicView.TopView();
|
this.AddChidren(topView.FLayoutView());
|
topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
|
{
|
RemoveFromParent();
|
};
|
topView.topNameBtn.TextID = StringId.xuanzeshiwaibianhuatiaojian;
|
|
FrameLayout viewLayout = new FrameLayout
|
{
|
Y = Application.GetRealHeight(64),
|
Width = Application.GetRealWidth(LogicView.TextSize.view375),
|
Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64),
|
BackgroundColor = CSS.CSS_Color.viewMiddle,
|
};
|
this.AddChidren(viewLayout);
|
//室外温、湿度、PM2.5变化
|
LogicView.SelectTypeView airqualityView = new LogicView.SelectTypeView();
|
airqualityView.btnIcon.Visible = false;
|
airqualityView.btnText.X = Application.GetRealWidth(16);
|
airqualityView.btnLine.X = Application.GetRealWidth(16);
|
airqualityView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
|
airqualityView.btnText.TextID =StringId.shuwaigongneng;
|
viewLayout.AddChidren(airqualityView.FLayoutView());
|
//天气变化(城市天气)
|
LogicView.SelectTypeView weatherView = new LogicView.SelectTypeView();
|
weatherView.frameLayout.Y = airqualityView.frameLayout.Bottom;
|
weatherView.btnIcon.Visible = false;
|
weatherView.btnText.X = Application.GetRealWidth(16);
|
weatherView.btnLine.X = Application.GetRealWidth(16);
|
weatherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
|
weatherView.btnText.TextID = StringId.tianqibianhua;
|
viewLayout.AddChidren(weatherView.FLayoutView());
|
|
//空气质量
|
LogicView.SelectTypeView kongqiViewk = new LogicView.SelectTypeView();
|
kongqiViewk.frameLayout.Y = weatherView.frameLayout.Bottom;
|
kongqiViewk.btnIcon.Visible = false;
|
kongqiViewk.btnText.X = Application.GetRealWidth(16);
|
kongqiViewk.btnLine.X = Application.GetRealWidth(16);
|
kongqiViewk.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
|
kongqiViewk.btnText.TextID = StringId.kongqizhiliang;
|
viewLayout.AddChidren(kongqiViewk.FLayoutView());
|
#endregion
|
|
#region 所有点击事件
|
//室外温、湿度、PM2.5变化
|
airqualityView.btnClick.MouseUpEventHandler += (sen, e) => {
|
OutdoorEnvironment outdoorEnvironment = new OutdoorEnvironment();
|
MainPage.BasePageView.AddChidren(outdoorEnvironment);
|
outdoorEnvironment.Show();
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
|
};
|
//天气变化(城市天气)
|
weatherView.btnClick.MouseUpEventHandler += (sen, e) => {
|
WeatherCondition weatherCondition = new WeatherCondition();
|
MainPage.BasePageView.AddChidren(weatherCondition);
|
weatherCondition.Show();
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
};
|
//空气质量
|
kongqiViewk.btnClick.MouseUpEventHandler += (sen, e) => {
|
AirQuality airQuality = new AirQuality();
|
MainPage.BasePageView.AddChidren(airQuality);
|
airQuality.Show();
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
};
|
|
#endregion
|
}
|
}
|
}
|