| | |
| | | int attrViewHight = Application.GetRealHeight(18 + 22); |
| | | |
| | | |
| | | //只有继电器 |
| | | if (!hadDimming && !hadCCT && !hadRGB) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(50); |
| | | attrView.Height = attrViewHight; |
| | | contentView.AddChidren(attrView); |
| | | attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); |
| | | |
| | | var view = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | attrView.AddChidren(view); |
| | | |
| | | |
| | | var btnClose = new Button() |
| | | { |
| | | X = Application.GetRealWidth(50), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(98), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | TextID = StringId.OFF, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | IsSelected = true, |
| | | //BorderWidth = 1, |
| | | //BorderColor = 0x00000000 |
| | | }; |
| | | view.AddChidren(btnClose); |
| | | |
| | | var btnOpen = new Button() |
| | | { |
| | | X = Application.GetRealWidth(100 + 98), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(98), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | TextID = StringId.On, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | }; |
| | | view.AddChidren(btnOpen); |
| | | |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = true; |
| | | btnOpen.IsSelected = false; |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | group.Control(d); |
| | | }; |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = true; |
| | | |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | group.Control(d); |
| | | }; |
| | | |
| | | } |
| | | |
| | | else |
| | | { |
| | | if (hadRGB) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(248); |
| | |
| | | } |
| | | if (hadCCT) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(54 + 11); |
| | | attrViewHight += Application.GetRealHeight(75 + 11); |
| | | hadDimming = true; |
| | | } |
| | | if (hadDimming) |
| | |
| | | { |
| | | LoadRgbAttrView(attrView); |
| | | } |
| | | } |
| | | |
| | | var view = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | attrView.AddChidren(view); |
| | | |
| | | |
| | | var btnClose = new Button() |
| | | { |
| | | X = Application.GetRealWidth(50), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(98), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | TextID = StringId.OFF, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | }; |
| | | view.AddChidren(btnClose); |
| | | |
| | | var btnOpen = new Button() |
| | | { |
| | | X = Application.GetRealWidth(100 + 98), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(98), |
| | | Height = Application.GetRealHeight(40), |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | TextID = StringId.On, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | }; |
| | | view.AddChidren(btnOpen); |
| | | |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = true; |
| | | btnOpen.IsSelected = false; |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | group.Control(d); |
| | | }; |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = true; |
| | | |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | group.Control(d); |
| | | }; |
| | | |
| | | |
| | | |
| | | contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight; |
| | | contentView.Gravity = Gravity.Center; |
| | |
| | | { |
| | | btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%"; |
| | | |
| | | var d = new Dictionary<string, object>(); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, e.ToString()); |
| | | group.Control(d); |
| | | }; |
| | |
| | | #region 色温 |
| | | var cctView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(54 + 11) |
| | | Height = Application.GetRealHeight(75 + 11) |
| | | }; |
| | | attrView.AddChidren(cctView); |
| | | |
| | |
| | | btnTempClolor.X = Application.GetRealWidth(35); |
| | | btnTempClolor.Y = Application.GetRealHeight(1); |
| | | btnTempClolor.Width = Application.GetRealWidth(224); |
| | | btnTempClolor.Height = Application.GetRealHeight(21); |
| | | btnTempClolor.Height = Application.GetRealHeight(42); |
| | | btnTempClolor.TextAlignment = TextAlignment.CenterLeft; |
| | | btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor; |
| | | btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | |
| | | }; |
| | | barColorTemplatrue.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString()); |
| | | group.Control(d); |
| | | }; |
| | |
| | | var rgbTemp = new Light(); |
| | | colorPicker.MouseUpEventHandler = (sender2, e2) => |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, rgbString); |
| | | group.Control(d); |
| | | }; |
| | |
| | | { |
| | | rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); |
| | | btnCurColor.BackgroundColor = (uint)(0xFF000000 + rgbTemp.GetRGBcolor(rgbString)); |
| | | var d = new Dictionary<string, object>(); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, rgbString); |
| | | group.Control(d); |
| | | }; |