| | |
| | | private SmartSound.Room CurrentRoom = null; |
| | | |
| | | private FrameLayout ContentLayout = null; |
| | | |
| | | private BottomClickButton bottomClickButton = null; |
| | | |
| | | |
| | | private VerticalListControl listView = null; |
| | | |
| | | /// <summary> |
| | | /// 没有数据的时候,提示用 |
| | | /// </summary> |
| | |
| | | { |
| | | |
| | | //设置标题信息 |
| | | base.SetTitleText("设备选择"); |
| | | base.SetTitleText(CurrentRoom.RoomName); |
| | | |
| | | //初始化中部控件 |
| | | this.InitMiddleFrame(); |
| | |
| | | switchContr.Gravity = Gravity.CenterVertical;
|
| | | switchContr.Width = Application.GetRealWidth(650);
|
| | | switchContr.Y = Application.GetRealHeight(40); |
| | | |
| | | |
| | | ContentLayout = new FrameLayout(); |
| | | this.bodyFrameLayout.AddChidren(ContentLayout); |
| | |
| | | listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction)); |
| | | |
| | | //设置初始值 |
| | | switchContr.SetDefultIndex(1);
|
| | | switchContr.SetDefultIndex(0);
|
| | |
|
| | | //选择事件
|
| | | switchContr.SelectTabEvent += (selectIndex) =>
|
| | |
| | | else |
| | | {
|
| | | LoadFunction();
|
| | | }
|
| | | } |
| | | }; |
| | | |
| | | //开始初始化 |
| | | switchContr.InitControl(listTitle);
|
| | | switchContr.InitControl(listTitle); |
| | | |
| | | //添加确认按钮 |
| | | BottomClickButton bottomClickButton = new BottomClickButton(); |
| | | this.bodyFrameLayout.AddChidren(bottomClickButton); |
| | | bottomClickButton.Text = "确认"; |
| | | bottomClickButton.ButtonClickEvent += (sender, e) => |
| | | { |
| | | //保存数据 |
| | | base.CloseForm(); |
| | | };
|
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | listView = new VerticalListControl(); |
| | | ContentLayout.AddChidren(listView); |
| | | listView.Y = Application.GetRealHeight(90); |
| | | listView.Y = Application.GetRealHeight(40); |
| | | listView.RemoveAll(); |
| | | |
| | | for (int i = 0; i < CurrentRoom.SceneList.Count; i++) |
| | |
| | | listView.AddChidren(roomRowLayout); |
| | | roomRowLayout.InitControl(); |
| | | } |
| | | |
| | | bottomClickButton = new BottomClickButton(); |
| | | ContentLayout.AddChidren(bottomClickButton); |
| | | bottomClickButton.Text = "确认"; |
| | | bottomClickButton.ButtonClickEvent += (sender, e) => |
| | | { |
| | | this.CloseForm(); |
| | | }; |
| | | |
| | | bottomClickButton.Visible = false; |
| | | |
| | | if (listView.ChildrenCount == 0) |
| | | { |
| | |
| | | ContentLayout.AddChidren(listView); |
| | | listView.Y= tab_layout.Height; |
| | | listView.Height=ContentLayout.Height- tab_layout.Height; |
| | | |
| | | |
| | | |
| | | Buttons.Clear(); |
| | | |
| | |
| | | for (int i = 0; i < CurrentRoom.DeviceList.Count; i++) |
| | | { |
| | | SmartSound.Device device = CurrentRoom.DeviceList[i]; |
| | | //灯光 |
| | | // |
| | | if (device.DeviceType == 4 || device.DeviceType == 5 || device.DeviceType == 6) |
| | | { |
| | | var deviceRowLayout = new DeviceRowLayout(this, device); |
| | |
| | | };
|
| | | layout.AddChidren(noFunctionTip);
|
| | | } |
| | | |
| | | |
| | | //为了方便更新状态,存起来 |
| | | private List<Button> Buttons = new List<Button>(); |
| | |
| | | { |
| | | string error = e.Message; |
| | | } |
| | | } |
| | | //frameBack.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | //frameBack.BackgroundImagePath = "Item/RoomIconBackground.png"; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | #region ■ 自定义场景选择控件_____________________
|
| | | |
| | |
| | | private class SceneRowLayout : FrameRowControl
|
| | | { |
| | | private SmartSoundContentForDevice smartSoundControlForDevice = null; |
| | | |
| | | private SmartSound.Scene scene = null; |
| | | /// <summary>
|
| | | /// 房间名称
|
| | |
| | | Right_icon.SelectedImagePath = "SmartSound/CheckBoxDef.png"; |
| | | Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxDef.png"; |
| | | } |
| | | |
| | | bool isShow = false; |
| | | |
| | | if (smartSoundControlForDevice == null) return; |
| | | |
| | | for (int i = 0; i < smartSoundControlForDevice.CurrentRoom.SceneList.Count; i++) |
| | | { |
| | | SmartSound.Scene _scene = smartSoundControlForDevice.CurrentRoom.SceneList[i]; |
| | | if (_scene.Checked) |
| | | { |
| | | isShow = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | smartSoundControlForDevice.bottomClickButton.Visible = isShow; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | private class DeviceRowLayout : FrameRowControl
|
| | | { |
| | | private SmartSoundContentForDevice smartSoundControlForDevice = null; |
| | | |
| | | private SmartSound.Device device = null; |
| | | /// <summary>
|
| | | /// 房间名称
|
| | |
| | | { |
| | | Right_icon.SelectedImagePath = "SmartSound/CheckBoxDef.png"; |
| | | Right_icon.UnSelectedImagePath = "SmartSound/CheckBoxDef.png"; |
| | | } |
| | | |
| | | bool isShow = false; |
| | | |
| | | if (smartSoundControlForDevice == null) return; |
| | | |
| | | for (int i = 0; i < smartSoundControlForDevice.CurrentRoom.SceneList.Count; i++) |
| | | { |
| | | SmartSound.Scene _scene = smartSoundControlForDevice.CurrentRoom.SceneList[i]; |
| | | if (_scene.Checked) |
| | | { |
| | | isShow = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | smartSoundControlForDevice.bottomClickButton.Visible = isShow; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | string error = e.Message; |
| | | } |
| | | }
|
| | |
|
| | | }
|
| | | #endregion |
| | | } |