| | |
| | | |
| | | Button btnTempValues; |
| | | Button btnHumiValues; |
| | | Button btnTempValuesUint; |
| | | Button btnHumiValuesUint; |
| | | |
| | | Button btnSetTempValues; |
| | | DiyImageSeekBar tempBar; |
| | | Button btnPowerControl; |
| | | Button btnSetTempUnit; |
| | | |
| | | Function function; |
| | | |
| | |
| | | Application.RunOnMainThread(() => { |
| | | bodyView.btnTempValues.Text = temp.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()); |
| | | bodyView.btnHumiValues.Text = temp.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()); |
| | | |
| | | bodyView.btnHumiValuesUint.X = (bodyView.btnHumiValues.GetTextWidth() + bodyView.btnHumiValues.Width) / 2; |
| | | bodyView.btnTempValuesUint.X = (bodyView.btnTempValues.GetTextWidth() + bodyView.btnTempValues.Width) / 2; |
| | | |
| | | int setTempValue = 0; |
| | | double dd = 0; |
| | |
| | | if (setTempValue != 0) |
| | | bodyView.btnSetTempValues.Text = setTempValue.ToString(); |
| | | |
| | | //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | bodyView.btnSetTempUnit.X = bodyView.btnSetTempValues.Right; |
| | | |
| | | //int progress = 0; |
| | | //int.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString()), out progress); |
| | |
| | | break; |
| | | } |
| | | bodyView = this; |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | } |
| | | |
| | | public void LoadPage(Action action) |
| | |
| | | IsBold = true, |
| | | TextSize = 30, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString(),"---"), |
| | | Width = Application.GetRealWidth(130), |
| | | }; |
| | | #if __IOS__ |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | #endif |
| | | btnTempValues.Gravity = Gravity.CenterHorizontal; |
| | | tempValuesView.AddChidren(btnTempValues); |
| | | var btnTempValuesUint = new Button() |
| | | |
| | | btnTempValuesUint = new Button() |
| | | { |
| | | X = btnTempValues.Right, |
| | | X = (btnTempValues.GetTextWidth() + btnTempValues.Width) / 2, |
| | | //Y = Application.GetRealWidth(48), |
| | | Y = Application.GetRealWidth(45), |
| | | Height = Application.GetRealWidth(66), |
| | |
| | | TextSize = 30, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | Text = function.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString(),"---"), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | Width = Application.GetRealWidth(130), |
| | | }; |
| | | |
| | | #if __IOS__ |
| | | btnHumiValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | btnHumiValues.Width = btnTempValues.GetTextWidth(); |
| | | #endif |
| | | btnHumiValues.Gravity = Gravity.CenterHorizontal; |
| | | humiValuesView.AddChidren(btnHumiValues); |
| | | var btnHumiValuesUint = new Button() |
| | | btnHumiValuesUint = new Button() |
| | | { |
| | | X = btnTempValues.Right, |
| | | X = (btnHumiValues.GetTextWidth() + btnHumiValues.Width) / 2, |
| | | Y = Application.GetRealWidth(45), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | Width = Application.GetRealWidth(30), |
| | |
| | | }; |
| | | contentView.AddChidren(btnSetTempValues); |
| | | #if __IOS__ |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | btnSetTempValues.Width = btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(5); |
| | | btnSetTempValues.Width = btnSetTempValues.GetTextWidth() + Application.GetRealWidth(5); |
| | | #endif |
| | | |
| | | |
| | | var btnSetTempUnit = new Button() |
| | | btnSetTempUnit = new Button() |
| | | { |
| | | X = btnSetTempValues.Right + Application.GetRealWidth(3), |
| | | Y = Application.GetRealHeight(267), |
| | |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | }; |
| | | contentView.AddChidren(btnSetTempUnit); |
| | | |
| | | |
| | | |
| | | var btnMinValuesText = new Button() |
| | | { |
| | |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | contentView.AddChidren(btnMinValuesText); |
| | | |
| | | |
| | | //int progress = 0; |
| | | //int.TryParse(function.GetAttrState(FunctionAttributeKey.SetTemp),out progress); |
| | | |
| | | tempBar = new DiyImageSeekBar() |
| | | { |
| | |
| | | contentView.AddChidren(tempBar); |
| | | tempBar.OnProgressChangedEvent = (sender, e) => { |
| | | btnSetTempValues.Text = (e + 16).ToString(); |
| | | #if __IOS__ |
| | | btnSetTempValues.Width = btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | btnSetTempValues.Width = btnSetTempValues.GetTextWidth() + Application.GetRealWidth(5); |
| | | #endif |
| | | btnSetTempUnit.X = btnSetTempValues.Right; |
| | | }; |
| | | tempBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | new System.Threading.Thread(() => { |