| | |
| | | var contentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(550), |
| | | Height = Application.GetRealHeight(667-64), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | Button btnGroupNameTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(78), |
| | | Width = Application.GetRealWidth(178), |
| | | TextID = StringId.GroupNmae, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.SelectedAll, |
| | | }; |
| | | if (groupControlLightList.Count > 0) |
| | | if (groupControlLightList.Count == lightList.Count) |
| | | { |
| | | btnChooseAll.TextID = StringId.Cancel; |
| | | } |
| | | roomFloorChangeView.AddChidren(btnChooseAll); |
| | | btnChooseAll.MouseUpEventHandler = (sender, e) => { |
| | | if (groupControlLightList.Count > 0) |
| | | if (groupControlLightList.Count == lightList.Count) |
| | | { |
| | | groupControlLightList.Clear(); |
| | | btnChooseAll.TextID = StringId.SelectAll; |
| | |
| | | } |
| | | else |
| | | { |
| | | groupControlLightList.Clear(); |
| | | groupControlLightList.AddRange(lightList); |
| | | btnChooseAll.TextID = StringId.Cancel; |
| | | btnConfrim.IsSelected = true; |
| | | } |
| | | LoadLightRow(lightList); |
| | | |
| | | for (int i = 0; i < functionListView.ChildrenCount; i++) |
| | | { |
| | | var view = functionListView.GetChildren(i); |
| | | if (view.GetType() == typeof(LightRow)) |
| | | { |
| | | if (view.Tag != null && view.Tag.ToString() == "row") |
| | | { |
| | | for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | { |
| | | var btn = (view as FrameLayout).GetChildren(j); |
| | | if (btn.GetType() == typeof(Button)) |
| | | { |
| | | if (btn.Tag != null && btn.Tag.ToString() == "ChooseIcon") |
| | | { |
| | | (btn as Button).IsSelected = groupControlLightList.Count == lightList.Count; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | |
| | | { |
| | | try |
| | | { |
| | | var addTemp = Newtonsoft.Json.JsonConvert.DeserializeObject<GroupControl>(pack.Data.ToString()); |
| | | FunctionList.List.groupControls.Add(addTemp); |
| | | var addTemp = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(addTemp); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var temp = FunctionList.List.groupControls.Find((obj) => obj.userDeviceGroupControlId == groupControl.userDeviceGroupControlId); |
| | | if(temp!= null) |
| | | { |
| | | temp = groupControl; |
| | | } |
| | | backActon?.Invoke(); |
| | | this.RemoveFromParent(); |
| | | } |
| | |
| | | groupControl = groupControlTemps[0]; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (groupControl.sids.Count == lightList.Count) |
| | | { |
| | | btnChooseAll.TextID = StringId.Cancel; |
| | | } |
| | | LoadLightRow(lightList); |
| | | }); |
| | | } |
| | |
| | | showCount = 0; |
| | | functionListView.RemoveAll(); |
| | | } |
| | | int i = 0; |
| | | foreach (var function in functions) |
| | | for(var i =0;i<100;i++) |
| | | //foreach (var function in functions) |
| | | { |
| | | i++; |
| | | if (i > 100) |
| | | showCount++; |
| | | if (showCount >= functions.Count) |
| | | { |
| | | break; |
| | | } |
| | | showCount++; |
| | | var function = functions[showCount]; |
| | | |
| | | var functionDiv = new LightRow(function) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = function.spk + function.sid |
| | | Tag = "row" |
| | | }; |
| | | functionDiv.AddChidren(new Button() |
| | | { |
| | |
| | | |
| | | Action setAction = () => |
| | | { |
| | | if (groupControlLightList.Count > 0) |
| | | if (groupControlLightList.Count > 1) |
| | | { |
| | | btnConfrim.IsSelected = true; |
| | | } |
| | |
| | | { |
| | | btnConfrim.IsSelected = false; |
| | | } |
| | | if (groupControlLightList.Count == functions.Count) |
| | | { |
| | | if (!btnChooseAll.IsSelected) |
| | | { |
| | | btnChooseAll.IsSelected = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (btnChooseAll.IsSelected) |
| | | { |
| | | btnChooseAll.IsSelected = false; |
| | | } |
| | | } |
| | | }; |
| | | if (groupControl.sids.Find((obj) => obj.sid == function.sid) != null) |
| | | { |