New file |
| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 温控器历史数据显示选择界面 |
| | | /// </summary> |
| | | public class CacHistoryChoosePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | Function device; |
| | | public CacHistoryChoosePage(Function function) |
| | | { |
| | | device = function; |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void InitView() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Data)).LoadTopView(); |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | FrameLayout tempView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(tempView); |
| | | |
| | | Button btnTempRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | tempView.AddChidren(btnTempRight); |
| | | |
| | | Button btnTempLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(49), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor |
| | | }; |
| | | tempView.AddChidren(btnTempLine); |
| | | |
| | | Button btnTempName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.TemperatureStatistics |
| | | }; |
| | | tempView.AddChidren(btnTempName); |
| | | btnTempName.MouseUpEventHandler = (sender, e) => { |
| | | var page = new CacWeekHistoryPage(device, "room_temp"); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.InitView(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | |
| | | |
| | | FrameLayout humidityView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64 + 50), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(humidityView); |
| | | |
| | | Button btnHumidityRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | humidityView.AddChidren(btnHumidityRight); |
| | | |
| | | Button btnHumidityName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.HumidityStatistics |
| | | }; |
| | | humidityView.AddChidren(btnHumidityName); |
| | | btnHumidityName.MouseUpEventHandler = (sender, e) => { |
| | | var page = new CacWeekHistoryPage(device, "room_humidity"); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.InitView(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | |
| | | } |
| | | } |
| | | } |