| | |
| | | int attrViewHight = Application.GetRealHeight(18 + 22); |
| | | |
| | | |
| | | //只有继电器 |
| | | if (!hadDimming && !hadCCT && !hadRGB) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(50); |
| | | if (hadRGB) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(248); |
| | | hadDimming = true; |
| | | } |
| | | if (hadCCT) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(75 + 11); |
| | | hadDimming = true; |
| | | } |
| | | if (hadDimming) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(54 + 11); |
| | | } |
| | | attrView.Height = attrViewHight; |
| | | contentView.AddChidren(attrView); |
| | | attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); |
| | | |
| | | |
| | | if (hadDimming) |
| | | { |
| | | LoadDimmingAttrView(attrView); |
| | | } |
| | | if (hadCCT) |
| | | { |
| | | LoadCctAttrView(attrView); |
| | | } |
| | | if (hadRGB) |
| | | { |
| | | LoadRgbAttrView(attrView); |
| | | } |
| | | |
| | | var view = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | btnClose.IsSelected = true; |
| | | btnOpen.IsSelected = false; |
| | | var d = new Dictionary<string, object>(); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | group.Control(d); |
| | | }; |
| | |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = true; |
| | | |
| | | var d = new Dictionary<string, object>(); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | group.Control(d); |
| | | }; |
| | | |
| | | } |
| | | |
| | | else |
| | | { |
| | | if (hadRGB) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(248); |
| | | hadDimming = true; |
| | | } |
| | | if (hadCCT) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(54 + 11); |
| | | hadDimming = true; |
| | | } |
| | | if (hadDimming) |
| | | { |
| | | attrViewHight += Application.GetRealHeight(54 + 11); |
| | | } |
| | | attrView.Height = attrViewHight; |
| | | contentView.AddChidren(attrView); |
| | | attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); |
| | | |
| | | |
| | | if (hadDimming) |
| | | { |
| | | LoadDimmingAttrView(attrView); |
| | | } |
| | | if (hadCCT) |
| | | { |
| | | LoadCctAttrView(attrView); |
| | | } |
| | | if (hadRGB) |
| | | { |
| | | LoadRgbAttrView(attrView); |
| | | } |
| | | } |
| | | |
| | | 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); |
| | | }; |