| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | |
| | | /// </summary> |
| | | public class AcstParentPage : FrameLayout |
| | | { |
| | | static AcstParentPage basePage; |
| | | |
| | | VerticalScrolViewLayout bodyView; |
| | | |
| | | #region 天气控件 |
| | | Button btnOutdoorTemp; |
| | | Button btnWeather; |
| | | TextButton btnHumidityValues; |
| | | TextButton btnPm25Values; |
| | | #endregion |
| | | |
| | | #region 传感器、耗电量组件 |
| | | SensorDiyView sensorDiyView_Temp; |
| | | SensorDiyView sensorDiyView_Humi; |
| | | SensorDiyView sensorDiyView_Pm25; |
| | | SensorDiyView sensorDiyView_Co2; |
| | | SensorDiyView sensorDiyView_Tvoc; |
| | | SensorDiyView sensorDiyView_EleDay; |
| | | SensorDiyView sensorDiyView_EleMonth; |
| | | SensorDiyView sensorDiyView_EleTotal; |
| | | #endregion |
| | | /// <summary> |
| | | /// 子控区域列表 |
| | | /// </summary> |
| | | Dictionary<string, AcstSubControlView> subViewList; |
| | | |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | base.RemoveFromParent(); |
| | | basePage = null; |
| | | } |
| | | |
| | | Function function; |
| | | /// <summary> |
| | | /// 当前时段颜色 |
| | | /// </summary> |
| | | uint curColor = CSS.CSS_Color.MainColor; |
| | | |
| | | string imageFolder = "blue"; |
| | | |
| | | public AcstParentPage() |
| | | { |
| | | basePage = this; |
| | | this.function = FunctionList.List.GetAcstParentList()[0]; |
| | | this.BackgroundColor = CSS.CSS_Color.BackgroundColor; |
| | | bodyView = new VerticalScrolViewLayout(); |
| | | this.AddChidren(bodyView); |
| | | |
| | | |
| | | |
| | | |
| | | subViewList = new Dictionary<string, AcstSubControlView>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新天气信息 |
| | | /// </summary> |
| | | public void InitGetWeatherAction() |
| | | { |
| | | MainPage.CityWeatherAction = () => { |
| | | |
| | | MainPage.CityWeatherAction = () => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnOutdoorTemp.Text = MainPage.cityInfo.temperature + "°"; |
| | | btnWeather.Text = MainPage.cityInfo.weather; |
| | | btnHumidityValues.Text = MainPage.cityInfo.humidity + "%"; |
| | | btnHumidityValues.Width = btnHumidityValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | btnPm25Values.Text = MainPage.cityInfo.pm25; |
| | | btnPm25Values.Width = btnPm25Values.GetTextWidth() + Application.GetRealWidth(10); |
| | | }); |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// 传感器、耗电量组件 |
| | | /// </summary> |
| | | public static void UpdateAcstParentInfo(Function temp) |
| | | { |
| | | if (basePage == null) |
| | | { |
| | | return; |
| | | } |
| | | if (basePage.sensorDiyView_Temp != null) |
| | | basePage.sensorDiyView_Temp.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.room_temp.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_Humi != null) |
| | | basePage.sensorDiyView_Humi.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.room_humidity.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_Pm25 != null) |
| | | basePage.sensorDiyView_Pm25.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.pm25.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_Co2 != null) |
| | | basePage.sensorDiyView_Co2.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.co2.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_Tvoc != null) |
| | | basePage.sensorDiyView_Tvoc.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.tvoc.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_EleDay != null) |
| | | basePage.sensorDiyView_EleDay.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.day_electricity.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_EleMonth != null) |
| | | basePage.sensorDiyView_EleMonth.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.month_electricity.ToString()).curValue.ToString()); |
| | | if (basePage.sensorDiyView_EleTotal != null) |
| | | basePage.sensorDiyView_EleTotal.UpdateValue(temp.GetAttribute(AcstParent_AttrEnum.total_electricity.ToString()).curValue.ToString()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新子控信息 |
| | | /// </summary> |
| | | /// <param name="temp"></param> |
| | | public static void UpdateAcstSubInfo(Function temp) |
| | | { |
| | | if(basePage == null) |
| | | { |
| | | return; |
| | | } |
| | | Application.RunOnMainThread(() => { |
| | | var view = basePage.subViewList[temp.sid]; |
| | | if(view!= null) |
| | | { |
| | | view.btnSubHumidityValues.Text = temp.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()) + "%"; |
| | | view.btnSubTempValues.Text = temp.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()) + "%"; |
| | | view.btnSubPower.IsSelected = temp.GetAttrState(AcstSub_AttrEnum.on_off.ToString()) == "on"; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | var curTime = DateTime.Now; |
| | | string helloText = "上午好"; |
| | | if (curTime.Hour >= 8 && curTime.Hour < 12) |
| | | { |
| | | helloText = "上午好"; |
| | | curColor = CSS.CSS_Color.MainColor; |
| | | imageFolder = "blue"; |
| | | } |
| | | else if (curTime.Hour >= 12 && curTime.Hour < 18) |
| | | { |
| | | helloText = "下午好"; |
| | | curColor = 0xFFE7914F; |
| | | imageFolder = "orange"; |
| | | } |
| | | else |
| | | { |
| | | helloText = "晚上好"; |
| | | curColor = 0xFF9175F3; |
| | | imageFolder = "purple"; |
| | | } |
| | | |
| | | #region 头部信息区域 |
| | | FrameLayout topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(181), |
| | | BackgroundColor = 0xFFb0eafa, |
| | | BackgroundImagePath = $"FunctionIcon/Acst/{imageFolder}/TopViewBg.png", |
| | | }; |
| | | bodyView.AddChidren(topView); |
| | | |
| | |
| | | Y = Application.GetRealHeight(32), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(34), |
| | | BackgroundColor = 0x33333333, |
| | | }; |
| | | topView.AddChidren(backView); |
| | | |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(38), |
| | | TextSize = 20, |
| | | Text = helloText, |
| | | TextColor = 0xFFFFFFFF, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | topView.AddChidren(btnHelloText); |
| | | var curTime = DateTime.Now; |
| | | if (curTime.Hour >= 8 && curTime.Hour < 12) |
| | | { |
| | | btnHelloText.Text = "上午好"; |
| | | } |
| | | else if (curTime.Hour >= 12 && curTime.Hour < 18) |
| | | { |
| | | btnHelloText.Text = "下午好"; |
| | | } |
| | | else |
| | | { |
| | | btnHelloText.Text = "晚上好"; |
| | | } |
| | | |
| | | var btnOutdoorTemp = new Button() |
| | | |
| | | btnOutdoorTemp = new Button() |
| | | { |
| | | X = Application.GetRealWidth(25), |
| | | Y = Application.GetRealHeight(90), |
| | |
| | | }; |
| | | topView.AddChidren(btnOutdoorTemp); |
| | | |
| | | var btnWeather = new Button() |
| | | btnWeather = new Button() |
| | | { |
| | | X = btnOutdoorTemp.Right, |
| | | Y = Application.GetRealHeight(95), |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | topView.AddChidren(btnWeather); |
| | | |
| | | |
| | | |
| | | |
| | | var environmentalView = new FrameLayout() |
| | |
| | | }; |
| | | environmentalView.AddChidren(btnHumidityIcon); |
| | | |
| | | var btnHumidityValues = new TextButton() |
| | | btnHumidityValues = new TextButton() |
| | | { |
| | | X = btnHumidityIcon.Right + Application.GetRealWidth(4), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | }; |
| | | environmentalView.AddChidren(btnPm25Icon); |
| | | |
| | | var btnPm25Values = new TextButton() |
| | | btnPm25Values = new TextButton() |
| | | { |
| | | X = btnPm25Icon.Right + Application.GetRealWidth(4), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(72), |
| | | BackgroundColor = 0x22222222, |
| | | BackgroundImagePath = $"FunctionIcon/Acst/{imageFolder}/MsgViewBg.png", |
| | | }; |
| | | infoView.AddChidren(infoContentView); |
| | | |
| | |
| | | }; |
| | | infoContentView.AddChidren(sensorListView); |
| | | |
| | | |
| | | if (tempObj != null) |
| | | { |
| | | new SensorDiyView(sensorListView, curColor, tempObj.curValue.ToString() + "°", "温度"); |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempObj.curValue.ToString() + "°", "温度"); |
| | | } |
| | | if (humiObj != null) |
| | | { |
| | | new SensorDiyView(sensorListView, curColor, humiObj.curValue.ToString() + "%", "湿度"); |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiObj.curValue.ToString() + "%", "湿度"); |
| | | } |
| | | if (pm25Obj != null) |
| | | { |
| | | new SensorDiyView(sensorListView, curColor, pm25Obj.curValue.ToString(), "PM2.5"); |
| | | sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.curValue.ToString(), "PM2.5"); |
| | | } |
| | | if (co2Obj != null) |
| | | { |
| | | new SensorDiyView(sensorListView, curColor, co2Obj.curValue.ToString(), "CO2"); |
| | | sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.curValue.ToString(), "CO2"); |
| | | } |
| | | if (tvocObj != null) |
| | | { |
| | | new SensorDiyView(sensorListView, curColor, tvocObj.curValue.ToString(), "TVOC"); |
| | | sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.curValue.ToString(), "TVOC"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | infoContentView.AddChidren(energyListView); |
| | | if (dayObj != null) |
| | | { |
| | | new SensorDiyView(energyListView, curColor, dayObj.curValue.ToString(), "今日耗电"); |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.curValue.ToString(), "今日耗电"); |
| | | } |
| | | if (monthObj != null) |
| | | { |
| | | new SensorDiyView(energyListView, curColor, monthObj.curValue.ToString(), "本月耗电"); |
| | | sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.curValue.ToString(), "本月耗电"); |
| | | } |
| | | if (totalObj != null) |
| | | { |
| | | new SensorDiyView(energyListView, curColor, totalObj.curValue.ToString(), "总耗电量"); |
| | | sensorDiyView_EleTotal = new SensorDiyView(energyListView, curColor, totalObj.curValue.ToString(), "总耗电量"); |
| | | } |
| | | |
| | | var btnChangeClick = new Button(); |
| | |
| | | |
| | | var subTitleView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(54), |
| | | Height = Application.GetRealHeight(54-11), |
| | | }; |
| | | bodyView.AddChidren(subTitleView); |
| | | |
| | | var btnCollection = new Button() |
| | | { |
| | | X = Application.GetRealWidth(6), |
| | | Gravity = Gravity.CenterVertical, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(39), |
| | | Height = Application.GetRealHeight(39), |
| | | UnSelectedImagePath = "Function/Acst/CollectionIcon_bule.png", |
| | | Height = Application.GetRealWidth(39), |
| | | IsSelected = function.collect, |
| | | UnSelectedImagePath = "FunctionIcon/Acst/grey/CollectionIcon.png", |
| | | SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/CollectionIcon.png", |
| | | }; |
| | | subTitleView.AddChidren(btnCollection); |
| | | |
| | |
| | | TextColor = 0xFF242424, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | IsBold = true, |
| | | Height = Application.GetRealHeight(54), |
| | | }; |
| | | subTitleView.AddChidren(btnTitleText); |
| | | |
| | |
| | | }; |
| | | bodyView.AddChidren(subFunctionListView); |
| | | |
| | | foreach(var sub in FunctionList.List.GetAcstSubList()) |
| | | |
| | | subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(9) }); |
| | | foreach (var sub in FunctionList.List.GetAcstSubList()) |
| | | { |
| | | if(subFunctionCount > 0 && subFunctionCount % 2 == 0) |
| | | if (subViewList.ContainsKey(sub.sid)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (subFunctionCount > 0 && subFunctionCount % 2 == 0) |
| | | { |
| | | subFunctionListView = new HorizontalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(88), |
| | | Height = Application.GetRealHeight(93), |
| | | }; |
| | | bodyView.AddChidren(subFunctionListView); |
| | | subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(9) }); |
| | | } |
| | | |
| | | subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(16) }); |
| | | AcstSubControlView subFunctionView = new AcstSubControlView(sub, subFunctionListView,imageFolder); |
| | | |
| | | var subFunctionView = new FrameLayout() { |
| | | Width = Application.GetRealWidth(164), |
| | | Height = Application.GetRealHeight(72), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | subFunctionListView.AddChidren(subFunctionView); |
| | | |
| | | var btnRoomInfo = new Button() |
| | | { |
| | | X = Application.GetRealWidth(18), |
| | | Height = Application.GetRealHeight(40), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = 0xFF1b3053, |
| | | TextSize = 13, |
| | | Text = sub.GetRoomListName(), |
| | | }; |
| | | subFunctionView.AddChidren(btnRoomInfo); |
| | | |
| | | |
| | | var btnSubTempIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(47), |
| | | Width = Application.GetMinRealAverage(11), |
| | | Height = Application.GetMinRealAverage(11), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacTempIcon.png", |
| | | }; |
| | | subFunctionView.AddChidren(btnSubTempIcon); |
| | | var btnSubTempValues = new TextButton() |
| | | { |
| | | X = btnSubTempIcon.Right, |
| | | Y = Application.GetRealHeight(45), |
| | | Height = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(22), |
| | | TextColor =0xFF1b3035, |
| | | TextSize = 10, |
| | | Text = sub.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()) + "°C", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | subFunctionView.AddChidren(btnSubTempValues); |
| | | |
| | | Button btnSubHumidityIcon = new Button() |
| | | { |
| | | X = btnSubTempValues.Right + Application.GetRealWidth(5), |
| | | Y = Application.GetRealHeight(47), |
| | | Width = Application.GetMinRealAverage(11), |
| | | Height = Application.GetMinRealAverage(11), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacHumidityIcon.png", |
| | | }; |
| | | subFunctionView.AddChidren(btnSubHumidityIcon); |
| | | |
| | | var btnSubHumidityValues = new TextButton() |
| | | { |
| | | X = btnSubHumidityIcon.Right, |
| | | Y = Application.GetRealHeight(45), |
| | | Height = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(22), |
| | | TextColor = 0xFF1b3053, |
| | | TextSize = 10, |
| | | Text = sub.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | subFunctionView.AddChidren(btnSubHumidityValues); |
| | | |
| | | |
| | | var btnSubPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(121), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | BackgroundColor = curColor, |
| | | Text = "开关", |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | subFunctionView.AddChidren(btnSubPower); |
| | | subViewList.Add(sub.sid, subFunctionView); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | bodyView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(72), |
| | | }); |
| | | |
| | | |
| | | #region 底部控制栏 |
| | | var bottomView = new FrameLayout() |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealWidth(38), |
| | | BackgroundColor = curColor, |
| | | Text = "模式", |
| | | UnSelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/ModeCoolIcon2.png", |
| | | SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/ModeCoolIcon2.png", |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnModeControl); |
| | | btnModeControl.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var dialogView = new FrameLayout(); |
| | | dialog.AddChidren(dialogView); |
| | | dialogView.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var dialogContentView = new FrameLayout() { |
| | | X = Application.GetRealWidth(34), |
| | | Y = Application.GetRealHeight(291), |
| | | Width = Application.GetRealWidth(144), |
| | | Height = Application.GetRealHeight(291), |
| | | BackgroundImagePath = "FunctionIcon/Acst/BgChooseMode.png", |
| | | }; |
| | | dialogView.AddChidren(dialogContentView); |
| | | |
| | | var titleView = new FrameLayout() { |
| | | X = Application.GetRealWidth(2), |
| | | Y = Application.GetRealHeight(3), |
| | | Width = Application.GetRealWidth(144), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | dialogContentView.AddChidren(titleView); |
| | | var btnTitleText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(100), |
| | | Text = "选择模式", |
| | | TextSize = 16, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | titleView.AddChidren(btnTitleText); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | dialog.Show(); |
| | | }; |
| | | |
| | | var btnPowerControl = new Button() |
| | |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealWidth(38), |
| | | BackgroundColor = curColor, |
| | | Text = "开关", |
| | | UnSelectedImagePath = "FunctionIcon/Acst/grey/PowerOffIcon.png", |
| | | SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/PowerOnIcon.png", |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnPowerControl); |
| | |
| | | X = Application.GetRealWidth(249), |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealWidth(38), |
| | | BackgroundColor = curColor, |
| | | Text = "场景", |
| | | UnSelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneSleepIcon2.png", |
| | | SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneSleepIcon2.png", |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnWorkSceneControl); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 传感器数据组件 |
| | | /// </summary> |
| | | public class SensorDiyView |
| | | { |
| | | private FrameLayout contentView; |
| | |
| | | |
| | | public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string text) |
| | | { |
| | | ///默认Tag 为传进来的Text |
| | | Tag = text; |
| | | |
| | | contentView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(60), |
| | |
| | | btnText.Text = value; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 子控卡片组件 |
| | | /// </summary> |
| | | public class AcstSubControlView |
| | | { |
| | | public TextButton btnSubTempValues; |
| | | public TextButton btnSubHumidityValues; |
| | | public Button btnSubPower; |
| | | |
| | | public AcstSubControlView(Function sub, HorizontalScrolViewLayout subFunctionListView,string imageFolder) |
| | | { |
| | | var subFunctionView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(177), |
| | | Height = Application.GetRealHeight(93), |
| | | BackgroundImagePath = "FunctionIcon/Acst/grey/BgSubControlView.png", |
| | | }; |
| | | subFunctionListView.AddChidren(subFunctionView); |
| | | |
| | | var btnRoomInfo = new Button() |
| | | { |
| | | X = Application.GetRealWidth(18 + 7), |
| | | Y = Application.GetRealHeight(11), |
| | | Height = Application.GetRealHeight(40), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = 0xFF1b3053, |
| | | TextSize = 13, |
| | | Text = sub.GetRoomListName(), |
| | | }; |
| | | subFunctionView.AddChidren(btnRoomInfo); |
| | | |
| | | var btnSubTempIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16 + 7), |
| | | Y = Application.GetRealHeight(47 + 11), |
| | | Width = Application.GetMinRealAverage(11), |
| | | Height = Application.GetMinRealAverage(11), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacTempIcon.png", |
| | | }; |
| | | subFunctionView.AddChidren(btnSubTempIcon); |
| | | |
| | | btnSubTempValues = new TextButton() |
| | | { |
| | | X = btnSubTempIcon.Right, |
| | | Y = Application.GetRealHeight(45 + 11), |
| | | Height = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(22), |
| | | TextColor = 0xFF1b3035, |
| | | TextSize = 10, |
| | | Text = sub.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()) + "°C", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | subFunctionView.AddChidren(btnSubTempValues); |
| | | |
| | | Button btnSubHumidityIcon = new Button() |
| | | { |
| | | X = btnSubTempValues.Right + Application.GetRealWidth(5), |
| | | Y = Application.GetRealHeight(47 + 11), |
| | | Width = Application.GetMinRealAverage(11), |
| | | Height = Application.GetMinRealAverage(11), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacHumidityIcon.png", |
| | | }; |
| | | subFunctionView.AddChidren(btnSubHumidityIcon); |
| | | |
| | | btnSubHumidityValues = new TextButton() |
| | | { |
| | | X = btnSubHumidityIcon.Right, |
| | | Y = Application.GetRealHeight(45 + 11), |
| | | Height = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(22), |
| | | TextColor = 0xFF1b3053, |
| | | TextSize = 10, |
| | | Text = sub.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | subFunctionView.AddChidren(btnSubHumidityValues); |
| | | |
| | | btnSubPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(121 + 7), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/grey/PowerOffIcon.png", |
| | | SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/PowerIcon.png", |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | subFunctionView.AddChidren(btnSubPower); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | public class IconButton : FrameLayout |
| | | { |
| | | FrameLayout view; |
| | | |
| | | public Button btnIcon; |
| | | |
| | | public Button btnText; |
| | | |
| | | public IconButton(string iconPath,string iconPath2,string text,uint color,bool isSelect) |
| | | { |
| | | view = this; |
| | | view.Width = Application.GetRealWidth(144); |
| | | view.Height = Application.GetRealHeight(44); |
| | | |
| | | btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = iconPath, |
| | | SelectedImagePath = iconPath2, |
| | | IsSelected = isSelect, |
| | | }; |
| | | view.AddChidren(btnIcon); |
| | | |
| | | btnText = new Button() |
| | | { |
| | | X = btnIcon.Right + Application.GetRealWidth(12), |
| | | Width = Application.GetRealWidth(90), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = text, |
| | | TextSize = 14, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = color, |
| | | IsSelected = isSelect, |
| | | }; |
| | | view.AddChidren(btnText); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |