using System; using System.Collections.Generic; namespace Shared.SimpleControl.Phone { public class UserSensorPage : FrameLayout { List updateTextThreadList = new List (); public UserSensorPage () { } public override void RemoveFromParent () { //if(this != null) //{ // this.RemoveFromParent (); //} foreach (var thread in updateTextThreadList) { thread.Abort (); } updateTextThreadList.Clear (); base.RemoveFromParent (); } void InitText (Common sensor, out string titleText, out string contentText, out uint unitBackColor, out string unitText) { titleText = ""; contentText = ""; unitBackColor = SkinStyle.Current.SensorLevel1; unitText = ""; switch (sensor.Type) { case DeviceType.SensorPM25: titleText = "PM2.5"; contentText = (sensor as SensorPM25).CurrentPM25.ToString (); if ((sensor as SensorPM25).CurrentPM25 < 35) { unitBackColor = SkinStyle.Current.SensorLevel1; } else if (75 >= (sensor as SensorPM25).CurrentPM25) { unitBackColor = SkinStyle.Current.SensorLevel2; } else if (115 >= (sensor as SensorPM25).CurrentPM25) { unitBackColor = SkinStyle.Current.SensorLevel3; } else if (115 < (sensor as SensorPM25).CurrentPM25) { unitBackColor = SkinStyle.Current.SensorLevel4; } unitText = @"μg/m³"; Control.ControlBytesSend (Command.ReadAnalogValue, sensor.SubnetID, sensor.DeviceID, new byte [] { 9, sensor.LoopID }, SendCount.Zero); break; case DeviceType.SensorCO2: titleText = "CO2"; contentText = (sensor as SensorCO2).CurrentCO2.ToString (); if ((sensor as SensorCO2).CurrentCO2 < 1000) { unitBackColor = SkinStyle.Current.SensorLevel1; } else if (2000 >= (sensor as SensorCO2).CurrentCO2) { unitBackColor = SkinStyle.Current.SensorLevel2; } else if (5000 >= (sensor as SensorCO2).CurrentCO2) { unitBackColor = SkinStyle.Current.SensorLevel3; } else if (5000 < (sensor as SensorCO2).CurrentCO2) { unitBackColor = SkinStyle.Current.SensorLevel4; } unitText = "ppm"; break; case DeviceType.SensorTVOC: titleText = "TVOC"; contentText = (sensor as SensorTVOC).CurrentTVOC.ToString (); if ((sensor as SensorTVOC).CurrentTVOC < 0.6) { unitBackColor = SkinStyle.Current.SensorLevel1; } else if (2 > (sensor as SensorTVOC).CurrentTVOC) { unitBackColor = SkinStyle.Current.SensorLevel2; } else if (5 >= (sensor as SensorTVOC).CurrentTVOC) { unitBackColor = SkinStyle.Current.SensorLevel3; } else if (5 < (sensor as SensorTVOC).CurrentTVOC) { unitBackColor = SkinStyle.Current.SensorLevel4; } unitText = "mg/m3"; break; case DeviceType.SensorTemperature: titleText = Language.StringByID (R.MyInternationalizationString.Temp); contentText = (sensor as SensorTemperature).CurrentTemperature.ToString (); if ((sensor as SensorTemperature).CurrentTemperature >= 25 && (sensor as SensorTemperature).CurrentTemperature < 27) { unitBackColor = SkinStyle.Current.SensorLevel1; } else if ((30 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 27) || (25 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 20)) { unitBackColor = SkinStyle.Current.SensorLevel2; } else if ((33 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 30) || (20 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 18)) { unitBackColor = SkinStyle.Current.SensorLevel3; } else if ((sensor as SensorTemperature).CurrentTemperature >= 33 || 18 > (sensor as SensorTemperature).CurrentTemperature) { unitBackColor = SkinStyle.Current.SensorLevel4; } unitText = "°C"; break; case DeviceType.SensorHumidity: titleText = Language.StringByID (R.MyInternationalizationString.Humidity); contentText = (sensor as SensorHumidity).CurrentHumidity.ToString (); if (30 >= (sensor as SensorHumidity).CurrentHumidity) { unitBackColor = SkinStyle.Current.SensorLevel4; } else if ((sensor as SensorHumidity).CurrentHumidity > 30 && 50 >= (sensor as SensorHumidity).CurrentHumidity) { unitBackColor = SkinStyle.Current.SensorLevel1; } else if ((sensor as SensorHumidity).CurrentHumidity > 50 && 70 >= (sensor as SensorHumidity).CurrentHumidity) { unitBackColor = SkinStyle.Current.SensorLevel1; } else if (70 < (sensor as SensorHumidity).CurrentHumidity) { unitBackColor = SkinStyle.Current.SensorLevel3; } unitText = "%"; break; } } void UpdateText (Common sensor, Button bntTitle, Button bntContent, Button btnUnit, FrameLayout view) { System.Threading.Thread thread = new System.Threading.Thread (() => { while (true) { Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, sensor.SubnetID, sensor.DeviceID, new byte [] { sensor.BigClass, sensor.MinClass, sensor.LoopID }); Application.RunOnMainThread (() => { switch (sensor.Type) { case DeviceType.SensorPM25: bntTitle.Text = "PM2.5"; bntContent.Text = (sensor as SensorPM25).CurrentPM25.ToString (); if ((sensor as SensorPM25).CurrentPM25 < 36) { view.BorderColor = SkinStyle.Current.SensorLevel1; } else if (75 >= (sensor as SensorPM25).CurrentPM25) { view.BorderColor = SkinStyle.Current.SensorLevel2; } else if (115 >= (sensor as SensorPM25).CurrentPM25) { view.BorderColor = SkinStyle.Current.SensorLevel3; } else if (115 < (sensor as SensorPM25).CurrentPM25) { view.BorderColor = SkinStyle.Current.SensorLevel4; } btnUnit.Text = @"μg/m³"; break; case DeviceType.SensorCO2: bntTitle.Text = "CO2"; bntContent.Text = (sensor as SensorCO2).CurrentCO2.ToString (); if ((sensor as SensorCO2).CurrentCO2 < 1000) { view.BorderColor = SkinStyle.Current.SensorLevel1; } else if (2000 >= (sensor as SensorCO2).CurrentCO2) { view.BorderColor = SkinStyle.Current.SensorLevel2; } else if (5000 >= (sensor as SensorCO2).CurrentCO2) { view.BorderColor = SkinStyle.Current.SensorLevel3; } else if (5000 < (sensor as SensorCO2).CurrentCO2) { view.BorderColor = SkinStyle.Current.SensorLevel4; } btnUnit.Text = "ppm"; break; case DeviceType.SensorTVOC: bntTitle.Text = "TVOC"; bntContent.Text = (sensor as SensorTVOC).CurrentTVOC.ToString (); if ((sensor as SensorTVOC).CurrentTVOC < 0.61) { view.BorderColor = SkinStyle.Current.SensorLevel1; } else if (2 >= (sensor as SensorTVOC).CurrentTVOC) { view.BorderColor = SkinStyle.Current.SensorLevel2; } else if (5 >= (sensor as SensorTVOC).CurrentTVOC) { view.BorderColor = SkinStyle.Current.SensorLevel3; } else if (5 < (sensor as SensorTVOC).CurrentTVOC) { view.BorderColor = SkinStyle.Current.SensorLevel4; } btnUnit.Text = "mg/m3"; break; case DeviceType.SensorTemperature: bntTitle.Text = Language.StringByID (R.MyInternationalizationString.Temp); bntContent.Text = (sensor as SensorTemperature).CurrentTemperature.ToString (); if ((sensor as SensorTemperature).CurrentTemperature >= 25 && (sensor as SensorTemperature).CurrentTemperature < 27) { view.BorderColor = SkinStyle.Current.SensorLevel1; } else if ((30 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 27) || (25 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 20)) { view.BorderColor = SkinStyle.Current.SensorLevel2; } else if ((33 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 30) || (20 > (sensor as SensorTemperature).CurrentTemperature && (sensor as SensorTemperature).CurrentTemperature >= 18)) { view.BorderColor = SkinStyle.Current.SensorLevel3; } else if ((sensor as SensorTemperature).CurrentTemperature >= 33 || 18 > (sensor as SensorTemperature).CurrentTemperature) { view.BorderColor = SkinStyle.Current.SensorLevel4; } btnUnit.Text = "°C"; break; case DeviceType.SensorHumidity: bntTitle.Text = Language.StringByID (R.MyInternationalizationString.Humidity); bntContent.Text = (sensor as SensorHumidity).CurrentHumidity.ToString (); if ((sensor as SensorHumidity).CurrentHumidity < 40) { view.BorderColor = SkinStyle.Current.SensorLevel4; } else if (60 > (sensor as SensorHumidity).CurrentHumidity) { view.BorderColor = SkinStyle.Current.SensorLevel1; } else if (70 > (sensor as SensorHumidity).CurrentHumidity) { view.BorderColor = SkinStyle.Current.SensorLevel2; } else if (80 < (sensor as SensorHumidity).CurrentHumidity) { view.BorderColor = SkinStyle.Current.SensorLevel3; } btnUnit.Text = "%"; break; } }); System.Threading.Thread.Sleep (10000); } }); updateTextThreadList.Add (thread); thread.Start (); EventHandler eventHandler = (dd, ff) => { UserSensorHistoryPage usp = new UserSensorHistoryPage (); UserMiddle.DevicePageView.AddChidren (usp); usp.ShowPage (sensor); UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1; }; btnUnit.MouseUpEventHandler += eventHandler; bntTitle.MouseUpEventHandler += eventHandler; bntContent.MouseUpEventHandler += eventHandler; } public void ShowUserSensorPage (Room room) { #region 标题 var topView = new FrameLayout () { Y = Application.GetRealHeight (36), Height = Application.GetRealHeight (90), BackgroundColor = SkinStyle.Current.MainColor }; AddChidren (topView); var title = new Button () { TextAlignment = TextAlignment.Center, Text = room.Name, TextColor = SkinStyle.Current.TextColor1, TextSize = 19, }; topView.AddChidren (title); var logo = new Button () { Y = Application.GetRealHeight(10), Width = Application.GetRealWidth (80), Height = Application.GetRealHeight (70), X = Application.GetRealWidth (550), UnSelectedImagePath = "Item/Item.png", SelectedImagePath = "Item/ItemSelected.png" }; topView.AddChidren (logo); //var logo = new Button () { // Width = Application.GetRealWidth (154), // Height = Application.GetRealHeight (90), // X = Application.GetRealWidth (486), // UnSelectedImagePath = MainPage.LogoString, //}; //topView.AddChidren (logo); var back = new Button () { Height = Application.GetRealHeight (90), Width = Application.GetRealWidth (85), UnSelectedImagePath = "Item/Back.png", SelectedImagePath = "Item/BackSelected.png", }; topView.AddChidren (back); back.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent (); //(Parent as PageLayout).PageIndex -= 1; }; #endregion FrameLayout bodyMainView = new FrameLayout () { Height = Application.GetRealHeight (Application.DesignHeight) - topView.Bottom, Y = topView.Bottom, }; AddChidren (bodyMainView); PageLayout contenPageView = new PageLayout () { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight (10), Height = Application.GetMinRealAverage (600), IsShowPoint = false, }; bodyMainView.AddChidren (contenPageView); #region sensorList var sensorList = room.DeviceList.FindAll ((obj) => { return obj.Type == DeviceType.SensorPM25; }); sensorList.AddRange (room.DeviceList.FindAll ((obj) => { return obj.Type == DeviceType.SensorCO2; })); sensorList.AddRange (room.DeviceList.FindAll ((obj) => { return obj.Type == DeviceType.SensorTVOC; })); sensorList.AddRange (room.DeviceList.FindAll ((obj) => { return obj.Type == DeviceType.SensorTemperature; })); sensorList.AddRange (room.DeviceList.FindAll ((obj) => { return obj.Type == DeviceType.SensorHumidity; })); logo.MouseUpEventHandler += (ad, cg) => { //return; //UserSensorSettingPage usp = new UserSensorSettingPage (); //UserMiddle.DevicePageView.AddChidren (usp); //usp.ShowUserSensorSettingPage (sensorList); //UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1; }; #endregion if (sensorList.Count > 5) { contenPageView.IsShowPoint = true; } int sensorContentPageCount = sensorList.Count / 5 + 1; int sensorIndex = 0; while (sensorContentPageCount-- >= 1) { string titleText = ""; string contentText = ""; string unitText = ""; var unitBackColor = SkinStyle.Current.Transparent; if (sensorIndex >= sensorList.Count) { break; } FrameLayout contentView = new FrameLayout (); contenPageView.AddChidren (contentView); if (sensorContentPageCount == 0) { if (sensorList.Count % 5 == 1) { var sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView = new FrameLayout () { Gravity = Gravity.Center, Width = Application.GetMinRealAverage (400), Height = Application.GetMinRealAverage (400), BackgroundColor = SkinStyle.Current.SensorContentView, BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (15), Radius = (uint)Application.GetMinRealAverage (200), }; contentView.AddChidren (sensorView); Button btnTitle = new Button () { Height = Application.GetMinRealAverage (144), TextAlignment = TextAlignment.Center, Text = titleText, TextColor = SkinStyle.Current.TextColor1, TextSize = 22, }; sensorView.AddChidren (btnTitle); Button btnContent = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (114), TextSize = 55, TextColor = SkinStyle.Current.TextColor1, Text = contentText, }; sensorView.AddChidren (btnContent); Button btnUnit = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (144), TextAlignment = TextAlignment.Center, Text = unitText, TextColor = SkinStyle.Current.TextColor1, TextSize = 22, }; sensorView.AddChidren (btnUnit); UpdateText (sensor, btnTitle, btnContent, btnUnit, sensorView); } else if (sensorList.Count % 5 == 2) { var sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView = new FrameLayout () { X = Application.GetMinRealAverage (47), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (250), Height = Application.GetRealWidth (250), BackgroundColor = SkinStyle.Current.SensorContentView, BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (10), Radius = (uint)Application.GetRealWidth (125), }; contentView.AddChidren (sensorView); Button btnTitle = new Button () { Height = Application.GetMinRealAverage (91), TextAlignment = TextAlignment.Center, Text = titleText, TextColor = SkinStyle.Current.TextColor1, TextSize = 18, }; sensorView.AddChidren (btnTitle); Button btnContent = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (70), TextSize = 35, Text = contentText, }; sensorView.AddChidren (btnContent); Button btnUnit = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (91), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, TextSize = 18, }; sensorView.AddChidren (btnUnit); UpdateText (sensor, btnTitle, btnContent, btnUnit, sensorView); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView1 = new FrameLayout () { X = sensorView.Right + Application.GetRealWidth (47), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (250), Height = Application.GetRealWidth (250), BackgroundColor = SkinStyle.Current.SensorContentView, BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (10), Radius = (uint)Application.GetRealWidth (125), }; contentView.AddChidren (sensorView1); Button btnTitle1 = new Button () { Height = Application.GetMinRealAverage (91), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView1.AddChidren (btnTitle1); Button btnContent1 = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (70), TextSize = 35, TextColor = SkinStyle.Current.TextColor1, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView1.AddChidren (btnContent1); Button btnUnit1 = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (91), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, TextSize = 18, }; sensorView1.AddChidren (btnUnit1); UpdateText (sensor, btnTitle1, btnContent1, btnUnit1, sensorView1); } else if (sensorList.Count % 5 == 3) { var sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView = new FrameLayout () { Y = Application.GetRealHeight (50), Gravity = Gravity.CenterHorizontal, Width = Application.GetMinRealAverage (220), Height = Application.GetMinRealAverage (220), BackgroundColor = SkinStyle.Current.SensorContentView, BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetMinRealAverage (110), }; contentView.AddChidren (sensorView); Button btnTitle = new Button () { Height = Application.GetMinRealAverage (74), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView.AddChidren (btnTitle); Button btnContent = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (74), TextColor = SkinStyle.Current.TextColor1, TextSize = 35, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView.AddChidren (btnContent); Button btnUnit = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (74), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = unitText, TextSize = 18, }; sensorView.AddChidren (btnUnit); UpdateText (sensor, btnTitle, btnContent, btnUnit, sensorView); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView1 = new FrameLayout () { X = Application.GetRealWidth (67), Y = Application.GetRealHeight (300), Width = Application.GetRealWidth (220), Height = Application.GetRealWidth (220), BackgroundColor = SkinStyle.Current.SensorContentView, BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth (110), }; contentView.AddChidren (sensorView1); Button btnTitle1 = new Button () { Height = Application.GetMinRealAverage (74), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView1.AddChidren (btnTitle1); Button btnContent1 = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (74), TextColor = SkinStyle.Current.TextColor1, TextSize = 35, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView1.AddChidren (btnContent1); Button btnUnit1 = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (74), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, TextSize = 18, }; sensorView1.AddChidren (btnUnit1); UpdateText (sensor, btnTitle1, btnContent1, btnUnit1, sensorView1); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView2 = new FrameLayout () { X = sensorView1.Right + Application.GetRealWidth (67), Y = Application.GetRealHeight (300), Width = Application.GetRealWidth (220), Height = Application.GetRealWidth (220), BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth (110), }; contentView.AddChidren (sensorView2); Button btnTitle2 = new Button () { Height = Application.GetMinRealAverage (81), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView2.AddChidren (btnTitle2); Button btnContent2 = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (65), TextColor = SkinStyle.Current.TextColor1, TextSize = 35, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView2.AddChidren (btnContent2); Button btnUnit2 = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (74), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, TextSize = 18, }; sensorView2.AddChidren (btnUnit2); UpdateText (sensor, btnTitle2, btnContent2, btnUnit2, sensorView2); } else if (sensorList.Count % 5 == 4) { var sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView = new FrameLayout () { X = Application.GetRealWidth (67), Y = Application.GetRealHeight (30), Width = Application.GetRealWidth (220), Height = Application.GetRealWidth (220), BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (5), BackgroundColor = SkinStyle.Current.SensorContentView, Radius = (uint)Application.GetRealWidth (110), }; contentView.AddChidren (sensorView); Button btnTitle = new Button () { Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView.AddChidren (btnTitle); Button btnContent = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (65), TextSize = 30, TextColor = SkinStyle.Current.TextColor1, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView.AddChidren (btnContent); Button btnUnit = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.TopCenter, Text = unitText, TextSize = 18, }; sensorView.AddChidren (btnUnit); UpdateText (sensor, btnTitle, btnContent, btnUnit, sensorView); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView0 = new FrameLayout () { X = sensorView.Right + Application.GetRealWidth (67), Y = Application.GetRealHeight (30), Width = Application.GetRealWidth (220), Height = Application.GetRealWidth (220), BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (5), BackgroundColor = SkinStyle.Current.SensorContentView, Radius = (uint)Application.GetRealWidth (110), }; contentView.AddChidren (sensorView0); Button btnTitle0 = new Button () { Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView0.AddChidren (btnTitle0); Button btnContent0 = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (64), TextSize = 30, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView0.AddChidren (btnContent0); Button btnUnit0 = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, //BackgroundColor = unitBackColor, TextSize = 18, }; sensorView0.AddChidren (btnUnit0); UpdateText (sensor, btnTitle0, btnContent0, btnUnit0, sensorView0); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView1 = new FrameLayout () { X = Application.GetRealWidth (67), Y = Application.GetRealHeight (300), Width = Application.GetRealWidth (220), Height = Application.GetRealWidth (220), BorderColor = unitBackColor, BorderWidth = (uint)Application.GetMinRealAverage (5), BackgroundColor = SkinStyle.Current.SensorContentView, Radius = (uint)Application.GetRealWidth (110), }; contentView.AddChidren (sensorView1); Button btnTitle1 = new Button () { Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView1.AddChidren (btnTitle1); Button btnContent1 = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (64), TextSize = 30, TextColor = SkinStyle.Current.TextColor1, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView1.AddChidren (btnContent1); Button btnUnit1 = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, //BackgroundColor = unitBackColor, TextSize = 18, }; sensorView1.AddChidren (btnUnit1); UpdateText (sensor, btnTitle1, btnContent1, btnUnit1, sensorView1); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView2 = new FrameLayout () { X = sensorView1.Right + Application.GetRealWidth (67), Y = Application.GetRealHeight (300), Width = Application.GetRealWidth (220), Height = Application.GetRealWidth (220), BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth (110), }; contentView.AddChidren (sensorView2); Button btnTitle2 = new Button () { Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 18, }; sensorView2.AddChidren (btnTitle2); Button btnContent2 = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (64), TextSize = 30, TextColor = SkinStyle.Current.TextColor1, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView2.AddChidren (btnContent2); Button btnUnit2 = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (79), TextAlignment = TextAlignment.TopCenter, TextColor = SkinStyle.Current.TextColor1, Text = unitText, TextSize = 18, }; sensorView2.AddChidren (btnUnit2); UpdateText (sensor, btnTitle2, btnContent2, btnUnit2, sensorView2); } } else { var sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView = new FrameLayout () { Y = Application.GetMinRealAverage (30), Gravity = Gravity.CenterHorizontal, Width = Application.GetMinRealAverage (280), Height = Application.GetMinRealAverage (280), BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (10), Radius = (uint)Application.GetMinRealAverage (140), }; contentView.AddChidren (sensorView); Button btnTitle = new Button () { Height = Application.GetMinRealAverage (98), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, TextSize = 20, }; sensorView.AddChidren (btnTitle); Button btnContent = new Button () { Y = btnTitle.Bottom, Height = Application.GetMinRealAverage (83), TextSize = 35, Text = contentText, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; sensorView.AddChidren (btnContent); Button btnUnit = new Button () { Y = btnContent.Bottom, Height = Application.GetMinRealAverage (98), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, TextSize = 20, Text = unitText, }; sensorView.AddChidren (btnUnit); UpdateText (sensor, btnTitle, btnContent, btnUnit, sensorView); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView0 = new FrameLayout () { X = Application.GetRealWidth (10), Y = sensorView.Bottom + Application.GetRealHeight (50), #if wallon Width = Application.GetMinRealAverage (130), Height = Application.GetMinRealAverage (130), #else Width = Application.GetRealWidth ((640 - 50) / 4), Height = Application.GetRealWidth ((640-50)/4), #endif BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth ((640 - 50) / 4 / 2), }; contentView.AddChidren (sensorView0); Button btnTitle0 = new Button () { Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Text = titleText, }; sensorView0.AddChidren (btnTitle0); Button btnContent0 = new Button () { Y = btnTitle0.Bottom, Height = Application.GetMinRealAverage (47), TextColor = SkinStyle.Current.TextColor1, TextSize = 20, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView0.AddChidren (btnContent0); Button btnUnit0 = new Button () { TextColor = SkinStyle.Current.TextColor1, Y = btnContent0.Bottom, Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.TopCenter, Text = unitText, }; sensorView0.AddChidren (btnUnit0); UpdateText (sensor, btnTitle0, btnContent0, btnUnit0, sensorView0); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView1 = new FrameLayout () { X = sensorView0.Right + Application.GetMinRealAverage (10), Y = sensorView0.Y, #if wallon Width = Application.GetMinRealAverage (130), Height = Application.GetMinRealAverage (130), #else Width = Application.GetRealWidth ((640 - 50) / 4), Height = Application.GetRealWidth ((640 - 50) / 4), #endif BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth ((640 - 50) / 4 / 2), }; contentView.AddChidren (sensorView1); Button btnTitle1 = new Button () { Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.Center, Text = titleText, TextColor = SkinStyle.Current.TextColor1, }; sensorView1.AddChidren (btnTitle1); Button btnContent1 = new Button () { Y = btnTitle1.Bottom, Height = Application.GetMinRealAverage (47), TextColor = SkinStyle.Current.TextColor1, TextSize = 20, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView1.AddChidren (btnContent1); Button btnUnit1 = new Button () { Y = btnContent1.Bottom, TextColor = SkinStyle.Current.TextColor1, Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.TopCenter, Text = unitText, }; sensorView1.AddChidren (btnUnit1); UpdateText (sensor, btnTitle1, btnContent1, btnUnit1, sensorView1); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView2 = new FrameLayout () { X = sensorView1.Right + Application.GetMinRealAverage (10), Y = sensorView0.Y, #if wallon Width = Application.GetMinRealAverage (130), Height = Application.GetMinRealAverage (130), #else Width = Application.GetRealWidth ((640 - 50) / 4), Height = Application.GetRealWidth ((640 - 50) / 4), #endif BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth ((640 - 50) / 4/2), }; contentView.AddChidren (sensorView2); Button btnTitle2 = new Button () { Height = Application.GetMinRealAverage (47), TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, Text = titleText, }; sensorView2.AddChidren (btnTitle2); Button btnContent2 = new Button () { Y = btnTitle2.Bottom, TextColor = SkinStyle.Current.TextColor1, Height = Application.GetMinRealAverage (47), TextSize = 20, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView2.AddChidren (btnContent2); Button btnUnit2 = new Button () { Y = btnContent2.Bottom, TextColor = SkinStyle.Current.TextColor1, Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.TopCenter, Text = unitText, }; sensorView2.AddChidren (btnUnit2); UpdateText (sensor, btnTitle2, btnContent2, btnUnit2, sensorView2); sensor = sensorList [sensorIndex++]; InitText (sensor, out titleText, out contentText, out unitBackColor, out unitText); FrameLayout sensorView3 = new FrameLayout () { X = sensorView2.Right + Application.GetMinRealAverage (10), Y = sensorView0.Y, #if wallon Width = Application.GetMinRealAverage (130), Height = Application.GetMinRealAverage (130), #else Width = Application.GetRealWidth ((640 - 50) / 4), Height = Application.GetRealWidth ((640 - 50) / 4), #endif BorderColor = unitBackColor, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), Radius = (uint)Application.GetRealWidth ((640 - 50) / 4 / 2), }; contentView.AddChidren (sensorView3); Button btnTitle3 = new Button () { TextColor = SkinStyle.Current.TextColor1, Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.Center, Text = titleText, }; sensorView3.AddChidren (btnTitle3); Button btnContent3 = new Button () { TextColor = SkinStyle.Current.TextColor1, Y = btnTitle3.Bottom, Height = Application.GetMinRealAverage (47), TextSize = 20, Text = contentText, TextAlignment = TextAlignment.Center, }; sensorView3.AddChidren (btnContent3); Button btnUnit3 = new Button () { TextColor = SkinStyle.Current.TextColor1, Y = btnContent3.Bottom, Height = Application.GetMinRealAverage (47), TextAlignment = TextAlignment.TopCenter, Text = unitText, }; sensorView3.AddChidren (btnUnit3); UpdateText (sensor, btnTitle3, btnContent3, btnUnit3, sensorView3); } } FrameLayout middleView = new FrameLayout () { Y = contenPageView.Bottom, Height = Application.GetRealHeight (20), BackgroundColor = SkinStyle.Current.MainColor, }; bodyMainView.AddChidren (middleView); PageLayout bottomPageView = new PageLayout () { Y = middleView.Bottom, Height = Application.GetRealHeight (Application.DesignHeight - 126 - 20) - Application.GetMinRealAverage (620), IsShowPoint = true, }; bodyMainView.AddChidren (bottomPageView); //PM2.5 if (sensorList.FindAll ((obj) => { return obj.Type == DeviceType.SensorPM25; }).Count != 0) { FrameLayout bottomMianView = new FrameLayout (); bottomPageView.AddChidren (bottomMianView); FrameLayout bottomView = new FrameLayout () { X = Application.GetRealWidth (55), Width = Application.GetRealWidth (530), }; bottomMianView.AddChidren (bottomView); Button btn1 = new Button () { Height = Application.GetRealHeight (60), TextID = R.MyInternationalizationString.SensorReferenceTipPM25Title, TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, }; bottomView.AddChidren (btn1); Button btn2 = new Button () { Y = btn1.Bottom, Height = Application.GetRealHeight (40), TextID = R.MyInternationalizationString.SensorReferenceTipPM25SubTitle, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn2); FrameLayout view3 = new FrameLayout () { Y = btn2.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel1, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view3); Button btn3_0 = new Button () { X = view3.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"0≤x≤35", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn3_0); Button btn3_1 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = btn3_0.Right, Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTipPM25Level1, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn3_1); FrameLayout view4 = new FrameLayout () { Y = btn3_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel2, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view4); Button btn4_0 = new Button () { X = view4.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"36≤x≤75", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn4_0); Button btn4_1 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = btn4_0.Right, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTipPM25Level2, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn4_1); FrameLayout view5 = new FrameLayout () { Y = btn4_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel3, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view5); Button btn5_0 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = view5.Right + Application.GetRealWidth (10), Y = btn4_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"75 { return obj.Type == DeviceType.SensorCO2; }).Count != 0) { FrameLayout bottomMianView = new FrameLayout (); bottomPageView.AddChidren (bottomMianView); FrameLayout bottomView = new FrameLayout () { X = Application.GetRealWidth (55), Width = Application.GetRealWidth (530), }; bottomMianView.AddChidren (bottomView); Button btn1 = new Button () { Height = Application.GetRealHeight (60), TextID = R.MyInternationalizationString.SensorReferenceTipCO2Title, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn1); Button btn2 = new Button () { Y = btn1.Bottom, Height = Application.GetRealHeight (40), TextID = R.MyInternationalizationString.SensorReferenceTipCO2SubTitle, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn2); FrameLayout view3 = new FrameLayout () { Y = btn2.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel1, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), //BackgroundColor = SkinStyle.Current.SensorLevel1, }; bottomView.AddChidren (view3); Button btn3_0 = new Button () { X = view3.Right + Application.GetRealWidth (10), Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), TextColor = SkinStyle.Current.TextColor1, Text = @"0≤x≤1000", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn3_0); Button btn3_1 = new Button () { X = btn3_0.Right, Y = btn2.Bottom, Height = Application.GetRealHeight (60), TextColor = SkinStyle.Current.TextColor1, Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTipCO2Level1, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn3_1); FrameLayout view4 = new FrameLayout () { Y = btn3_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel2, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view4); Button btn4_0 = new Button () { X = view4.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"1000 { return obj.Type == DeviceType.SensorTVOC; }).Count != 0) { FrameLayout bottomMianView = new FrameLayout (); bottomPageView.AddChidren (bottomMianView); FrameLayout bottomView = new FrameLayout () { X = Application.GetRealWidth (55), Width = Application.GetRealWidth (530), }; bottomMianView.AddChidren (bottomView); Button btn1 = new Button () { Height = Application.GetRealHeight (60), TextID = R.MyInternationalizationString.SensorReferenceTipTVOCTitle, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn1); Button btn2 = new Button () { Y = btn1.Bottom, Height = Application.GetRealHeight (40), TextID = R.MyInternationalizationString.SensorReferenceTipTVOCSubTitle, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn2); FrameLayout view3 = new FrameLayout () { Y = btn2.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel1, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), //BackgroundColor = SkinStyle.Current.SensorLevel1, }; bottomView.AddChidren (view3); Button btn3_0 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = view3.Right + Application.GetRealWidth (10), Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"0≤x≤0.6", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn3_0); Button btn3_1 = new Button () { X = btn3_0.Right, Y = btn2.Bottom, TextColor = SkinStyle.Current.TextColor1, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel1, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn3_1); FrameLayout view4 = new FrameLayout () { Y = btn3_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel2, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view4); Button btn4_0 = new Button () { X = view4.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"0.61≤x≤2", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn4_0); Button btn4_1 = new Button () { X = btn4_0.Right, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), TextColor = SkinStyle.Current.TextColor1, Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel2, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn4_1); FrameLayout view5 = new FrameLayout () { Y = btn4_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel3, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view5); Button btn5_0 = new Button () { X = view5.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn4_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"2.01≤x≤5", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn5_0); Button btn5_1 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = btn5_0.Right, Y = btn4_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel3, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn5_1); FrameLayout view6 = new FrameLayout () { Y = btn5_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel4, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view6); Button btn6_0 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = view6.Right + Application.GetRealWidth (10), Y = btn5_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"5 { return obj.Type == DeviceType.SensorTemperature; }).Count != 0) { FrameLayout bottomMianView = new FrameLayout (); bottomPageView.AddChidren (bottomMianView); FrameLayout bottomView = new FrameLayout () { X = Application.GetRealWidth (55), Width = Application.GetRealWidth (530), }; bottomMianView.AddChidren (bottomView); Button btn1 = new Button () { TextColor = SkinStyle.Current.TextColor1, Height = Application.GetRealHeight (60), TextID = R.MyInternationalizationString.SensorReferenceTempTipTitle, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn1); Button btn2 = new Button () { TextColor = SkinStyle.Current.TextColor1, Y = btn1.Bottom, Height = Application.GetRealHeight (40), TextID = R.MyInternationalizationString.SensorReferenceTempTipSubTitle, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn2); FrameLayout view3 = new FrameLayout () { Y = btn2.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel1, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), //BackgroundColor = SkinStyle.Current.SensorLevel1, }; bottomView.AddChidren (view3); Button btn3_0 = new Button () { X = view3.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"25≤x<27°", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn3_0); Button btn3_1 = new Button () { X = btn3_0.Right, TextColor = SkinStyle.Current.TextColor1, Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTempTipLevel1, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn3_1); FrameLayout view4 = new FrameLayout () { Y = btn3_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel2, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view4); Button btn4_0 = new Button () { X = view4.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"20≤x<25°/27≤x<30°", TextSize = 10, TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn4_0); Button btn4_1 = new Button () { X = btn4_0.Right, TextColor = SkinStyle.Current.TextColor1, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTempTipLevel2, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn4_1); FrameLayout view5 = new FrameLayout () { Y = btn4_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel3, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view5); Button btn5_0 = new Button () { X = view5.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn4_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"18≤x<20°/30≤x<33°", TextSize = 10, TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn5_0); Button btn5_1 = new Button () { X = btn5_0.Right, Y = btn4_0.Bottom, TextColor = SkinStyle.Current.TextColor1, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTempTipLevel3, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn5_1); FrameLayout view6 = new FrameLayout () { Y = btn5_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel4, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view6); Button btn6_0 = new Button () { X = view6.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn5_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"x<18°/x≤33°", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn6_0); Button btn6_1 = new Button () { X = btn6_0.Right, Y = btn5_0.Bottom, TextColor = SkinStyle.Current.TextColor1, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceTempTipLevel4, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn6_1); } //湿度 if (sensorList.FindAll ((obj) => { return obj.Type == DeviceType.SensorHumidity; }).Count != 0) { FrameLayout bottomMianView = new FrameLayout (); bottomPageView.AddChidren (bottomMianView); FrameLayout bottomView = new FrameLayout () { X = Application.GetRealWidth (55), Width = Application.GetRealWidth (530), }; bottomMianView.AddChidren (bottomView); Button btn1 = new Button () { Height = Application.GetRealHeight (60), TextID = R.MyInternationalizationString.SensorReferenceHumidityTipTitle, TextColor = SkinStyle.Current.TextColor1, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn1); Button btn2 = new Button () { TextColor = SkinStyle.Current.TextColor1, Y = btn1.Bottom, Height = Application.GetRealHeight (40), TextID = R.MyInternationalizationString.SensorReferenceHumidityTipSubTitle, TextAlignment = TextAlignment.Center, }; bottomView.AddChidren (btn2); FrameLayout view3 = new FrameLayout () { Y = btn2.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel4, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view3); Button btn3_0 = new Button () { X = view3.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"x≤30%", TextAlignment = TextAlignment.CenterLeft, }; bottomView.AddChidren (btn3_0); Button btn3_1 = new Button () { TextColor = SkinStyle.Current.TextColor1, X = btn3_0.Right, Y = btn2.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (280), TextID = R.MyInternationalizationString.SensorReferenceHumidityTipLevel3, TextAlignment = TextAlignment.CenterRight }; bottomView.AddChidren (btn3_1); FrameLayout view4 = new FrameLayout () { Y = btn3_0.Bottom + Application.GetMinRealAverage (10), Width = Application.GetMinRealAverage (40), Height = Application.GetMinRealAverage (40), Radius = (uint)Application.GetMinRealAverage (20), BorderColor = SkinStyle.Current.SensorLevel1, BackgroundColor = SkinStyle.Current.SensorContentView, BorderWidth = (uint)Application.GetMinRealAverage (5), }; bottomView.AddChidren (view4); Button btn4_0 = new Button () { X = view4.Right + Application.GetRealWidth (10), TextColor = SkinStyle.Current.TextColor1, Y = btn3_0.Bottom, Height = Application.GetRealHeight (60), Width = Application.GetRealWidth (240) - Application.GetMinRealAverage (50), Text = @"30