| | |
| | | controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Y = Application.GetRealHeight(88 + 10), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | |
| | | // btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | // function.CollectFunction(); |
| | | //}; |
| | | |
| | | |
| | | |
| | | |
| | | //回退刷新信息事件 |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView_SettingIcon( () => { |
| | |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | //UnSelectedImagePath = "Public/PowerClose.png", |
| | | UnSelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "FunctionIcon/Light/LightScene/gp_all_on.png", |
| | | }; |
| | | controlView.AddChidren(btnOn); |
| | | var btnOnText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(100-9), |
| | | Y = Application.GetRealHeight(495), |
| | | Width = Application.GetMinRealAverage(50), |
| | | Height = Application.GetMinRealAverage(32), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.Open, |
| | | }; |
| | | controlView.AddChidren(btnOnText); |
| | | |
| | | |
| | | var btnOff = new Button() |
| | | { |
| | |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | //UnSelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "FunctionIcon/Light/LightScene/gp_all_off.png", |
| | | }; |
| | | controlView.AddChidren(btnOff); |
| | | var btnOffText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(180 - 9), |
| | | Y = Application.GetRealHeight(495), |
| | | Width = Application.GetMinRealAverage(50), |
| | | Height = Application.GetMinRealAverage(32), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.Close, |
| | | }; |
| | | controlView.AddChidren(btnOffText); |
| | | |
| | | |
| | | |
| | | btnOn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | function.Control(d); |
| | | }; |
| | | btnOnText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | function.Control(d); |
| | | }; |
| | | |
| | | btnOffText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | function.Control(d); |
| | | }; |
| | | |
| | | |
| | | if (hadRGB) |
| | | { |
| | | LoadRgbAttrView(hadCCT,hadColorful); |
| | | LoadRgbAttrView(hadCCT,hadColorful,btnOn,btnOff); |
| | | } |
| | | else if (hadCCT) |
| | | { |
| | | LoadCctAttrView(attrView); |
| | | LoadCctAttrView(attrView, btnOn, btnOff); |
| | | } |
| | | else if (hadDimming) |
| | | { |
| | | LoadDimmingAttrView(attrView); |
| | | LoadDimmingAttrView(attrView, btnOn, btnOff); |
| | | } |
| | | else |
| | | { |
| | |
| | | attrView.AddChidren(btnSwitchIcon); |
| | | |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | if (btnSwitchIcon.IsSelected) |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | function.Control(d); |
| | | } |
| | | }; |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | btnSwitchIcon.IsSelected = true; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | btnSwitchIcon.IsSelected = false; |
| | | }; |
| | | } |
| | | |
| | |
| | | /// 加载调光属性设置控件 |
| | | /// </summary> |
| | | /// <param name="attrView"></param> |
| | | void LoadDimmingAttrView(VerticalScrolViewLayout attrView) |
| | | void LoadDimmingAttrView(VerticalScrolViewLayout attrView,Button btnOn,Button btnOff) |
| | | { |
| | | |
| | | |
| | |
| | | |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | return; |
| | | if (e == 0 && lastBrightness != 0) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 100; |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 0; |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | |
| | | |
| | | } |
| | | int lastBrightness = 0; |
| | |
| | | /// 加载cct属性设置控件 |
| | | /// </summary> |
| | | /// <param name="attrView"></param> |
| | | void LoadCctAttrView(VerticalScrolViewLayout attrView) |
| | | void LoadCctAttrView(VerticalScrolViewLayout attrView,Button btnOn,Button btnOff) |
| | | { |
| | | attrView.AddChidren(new Button |
| | | { |
| | |
| | | |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | return; |
| | | if (e == 0 && lastBrightness != 0) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | |
| | | |
| | |
| | | cctView.AddChidren(btnTempClolorMax); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 100; |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 0; |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载rgb属性设置控件 |
| | | /// </summary> |
| | | /// <param name="attrView"></param> |
| | | void LoadRgbAttrView(bool hadCCT,bool hadColorful) |
| | | void LoadRgbAttrView(bool hadCCT,bool hadColorful,Button btnOn,Button btnOff) |
| | | { |
| | | Light lightTemp = new Light(); |
| | | int magriHeight = 0; |
| | |
| | | |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | //btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | return; |
| | | if (e == 0 && lastBrightness != 0) |
| | | { |
| | |
| | | #endregion |
| | | } |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 100; |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | //btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 0; |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | //btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | |
| | | |
| | | |
| | | } |