Merge remote-tracking branch 'origin/dev-tzy' into NewFilePath
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorWheelTip.png" /> |
| | | <AndroidAsset Include="Assets\Phone\LogicIcon\time.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\ClearIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\ErrorIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\oRobot.png" /> |
| | | <AndroidAsset Include="Assets\Phone\RoomListBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorTemperatrueQuick.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorTemperatrueQuickBack.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorTemperatureBar.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\CozyIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\MeetingGuestsIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ReadIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\PopupDialog.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> |
| | |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\AppUnlockSetting\FingerIconBlue.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\ClearIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\time.png" /> |
| | | <BundleResource Include="Resources\Phone\ErrorIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorTemperatrueQuick.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorTemperatrueQuickBack.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorTemperatureBar.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\CozyIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\MeetingGuestsIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\ReadIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\PopupDialog.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
New file |
| | |
| | | using HDL_ON.Entity;
|
| | | using Shared;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace HDL_ON
|
| | | {
|
| | | /// <summary>
|
| | | /// 楼层及房间的选择界面
|
| | | /// </summary>
|
| | | public class FloorRoomSelectPopupView
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 当前选择显示的UID(楼层,或者房间,或者全部)
|
| | | /// </summary>
|
| | | private string nowShowSelectId = DiySelectPopupDialog.ALLSELECT;
|
| | | /// <summary>
|
| | | /// 全部的功能(设备显示分支使用)
|
| | | /// </summary>
|
| | | private List<Function> listAllFun = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 场景显示___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 显示选择场景的界面
|
| | | /// </summary>
|
| | | /// <param name="btnFloor">楼层名字显示的控件,选择后,内部会自动变更显示文字,可以设置为null</param>
|
| | | /// <param name="SelectEvent">根据选择的条件,筛选之后的场景列表(第一个参数是选择的UID,不管有没有用,总之先返回)</param>
|
| | | /// <param name="i_defultSelectId">默认哪个为选择状态</param>
|
| | | public void ShowSceneView(Button btnFloor, Action<string, List<Scene>> SelectEvent, string i_defultSelectId = null)
|
| | | {
|
| | | //清缓存
|
| | | this.ClearMemory();
|
| | |
|
| | | if (string.IsNullOrEmpty(i_defultSelectId) == true)
|
| | | {
|
| | | i_defultSelectId = DiySelectPopupDialog.ALLSELECT;
|
| | | }
|
| | |
|
| | | //返回的id是UID
|
| | | new FloorSelectPopupDialog().ShowView((selectValue) =>
|
| | | {
|
| | | this.nowShowSelectId = selectValue;
|
| | | //刷新楼层的显示名字
|
| | | this.RefreshFloorShowName(btnFloor);
|
| | |
|
| | | //获取可以显示的场景列表
|
| | | var listScene = this.GetCanShowListScene();
|
| | | SelectEvent?.Invoke(this.nowShowSelectId, listScene);
|
| | | SelectEvent = null;
|
| | |
|
| | | }, i_defultSelectId);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取能够显示的场景
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public List<Scene> GetCanShowListScene()
|
| | | {
|
| | | var listScene = new List<Scene>();
|
| | |
|
| | | //先看看当前选择的显示类型 1:全部 2:楼层 3:房间
|
| | | var selectType = this.CheckSelectFloorIdType();
|
| | | if (selectType == 1)
|
| | | {
|
| | | return FunctionList.List.scenes;
|
| | | }
|
| | |
|
| | | //房间的UID (key:uid value:roomId)
|
| | | var dicRoomUid = new Dictionary<string, string>();
|
| | | foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
|
| | | {
|
| | | dicRoomUid[roomInfo.uid] = roomInfo.roomId;
|
| | | }
|
| | | //房间
|
| | | if (selectType == 3)
|
| | | {
|
| | | //用UID转换为roomId
|
| | | string roomId = dicRoomUid.ContainsKey(this.nowShowSelectId) == true ? dicRoomUid[this.nowShowSelectId] : string.Empty;
|
| | | foreach (var scene in FunctionList.List.scenes)
|
| | | {
|
| | | //判断这个场景是否是这个房间的
|
| | | if (scene.roomIds.Contains(roomId) == true)
|
| | | {
|
| | | listScene.Add(scene);
|
| | | }
|
| | | }
|
| | | }
|
| | | //楼层
|
| | | else if (selectType == 2)
|
| | | {
|
| | | //获取这个楼层下面的全部房间ID
|
| | | var listRoomId = new List<string>();
|
| | | foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
|
| | | {
|
| | | //判断是不是这个楼层的
|
| | | if (roomInfo.parentId == this.nowShowSelectId)
|
| | | {
|
| | | listRoomId.Add(roomInfo.roomId);
|
| | | }
|
| | | }
|
| | | foreach (var scene in FunctionList.List.scenes)
|
| | | {
|
| | | //判断这个场景是否是这个房间的
|
| | | foreach (var roomid in listRoomId)
|
| | | {
|
| | | if (scene.roomIds.Contains(roomid) == true)
|
| | | {
|
| | | listScene.Add(scene);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return listScene;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 设备显示___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 显示选择场景的界面
|
| | | /// </summary>
|
| | | /// <param name="btnFloor">楼层名字显示的控件,选择后,内部会自动变更显示文字,可以设置为null</param>
|
| | | /// <param name="i_listAllFun">全部的设备列表,需要手动指定</param>
|
| | | /// <param name="SelectEvent">根据选择的条件,筛选之后的设备列表(第一个参数是选择的UID,不管有没有用,总之先返回)</param>
|
| | | /// <param name="i_defultSelectId">默认哪个为选择状态</param>
|
| | | public void ShowDeviceFunctionView(Button btnFloor, List<Function> i_listAllFun, Action<string, List<Function>> SelectEvent, string i_defultSelectId = null)
|
| | | {
|
| | | //清缓存
|
| | | this.ClearMemory();
|
| | | this.listAllFun = new List<Function>();
|
| | | this.listAllFun.AddRange(i_listAllFun);
|
| | |
|
| | | if (string.IsNullOrEmpty(i_defultSelectId) == true)
|
| | | {
|
| | | i_defultSelectId = DiySelectPopupDialog.ALLSELECT;
|
| | | }
|
| | |
|
| | | //返回的id是UID
|
| | | new FloorSelectPopupDialog().ShowView((selectValue) =>
|
| | | {
|
| | | this.nowShowSelectId = selectValue;
|
| | | //刷新楼层的显示名字
|
| | | this.RefreshFloorShowName(btnFloor);
|
| | |
|
| | | //获取可以显示的设备列表
|
| | | var listDevice = this.GetCanShowListDevice();
|
| | | SelectEvent?.Invoke(this.nowShowSelectId, listDevice);
|
| | | SelectEvent = null;
|
| | |
|
| | | }, i_defultSelectId);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取能够显示的设备
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public List<Function> GetCanShowListDevice()
|
| | | {
|
| | | var listFunction = new List<Function>();
|
| | |
|
| | | //先看看当前选择的显示类型 1:全部 2:楼层 3:房间
|
| | | var selectType = this.CheckSelectFloorIdType();
|
| | | if (selectType == 1)
|
| | | {
|
| | | return this.listAllFun;
|
| | | }
|
| | |
|
| | | //房间的UID (key:uid value:roomId)
|
| | | var dicRoomUid = new Dictionary<string, string>();
|
| | | foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
|
| | | {
|
| | | dicRoomUid[roomInfo.uid] = roomInfo.roomId;
|
| | | }
|
| | | //房间
|
| | | if (selectType == 3)
|
| | | {
|
| | | //用UID转换为roomId
|
| | | string roomId = dicRoomUid.ContainsKey(this.nowShowSelectId) == true ? dicRoomUid[this.nowShowSelectId] : string.Empty;
|
| | | foreach (var func in this.listAllFun)
|
| | | {
|
| | | //判断这个场景是否是这个房间的
|
| | | if (func.roomIds.Contains(roomId) == true)
|
| | | {
|
| | | listFunction.Add(func);
|
| | | }
|
| | | }
|
| | | }
|
| | | //楼层
|
| | | else if (selectType == 2)
|
| | | {
|
| | | //获取这个楼层下面的全部房间ID
|
| | | var listRoomId = new List<string>();
|
| | | foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
|
| | | {
|
| | | //判断是不是这个楼层的
|
| | | if (roomInfo.parentId == this.nowShowSelectId)
|
| | | {
|
| | | listRoomId.Add(roomInfo.roomId);
|
| | | }
|
| | | }
|
| | | foreach (var func in this.listAllFun)
|
| | | {
|
| | | //判断这个场景是否是这个房间的
|
| | | foreach (var roomid in listRoomId)
|
| | | {
|
| | | if (func.roomIds.Contains(roomid) == true)
|
| | | {
|
| | | listFunction.Add(func);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return listFunction;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 刷新楼层的显示名字
|
| | | /// </summary>
|
| | | /// <param name="btnFloorName"></param>
|
| | | private void RefreshFloorShowName(Button btnFloorName)
|
| | | {
|
| | | if (btnFloorName == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //先看看当前选择的显示类型 1:全部 2:楼层 3:房间
|
| | | var selectType = this.CheckSelectFloorIdType();
|
| | | if (selectType == 1)
|
| | | {
|
| | | //全部
|
| | | btnFloorName.Text = Language.StringByID(StringId.All);
|
| | | }
|
| | | //房间
|
| | | else if (selectType == 3)
|
| | | {
|
| | | foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
|
| | | {
|
| | | if (roomInfo.uid == this.nowShowSelectId)
|
| | | {
|
| | | btnFloorName.Text = roomInfo.floorName + roomInfo.roomName;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | //楼层
|
| | | else if (selectType == 2)
|
| | | {
|
| | | foreach (var floorInfo in SpatialInfo.CurrentSpatial.FloorList)
|
| | | {
|
| | | if (floorInfo.uid == this.nowShowSelectId)
|
| | | {
|
| | | btnFloorName.Text = floorInfo.roomName;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 判断当前所选的ID的类型 1:全部 2:楼层 3:房间
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private int CheckSelectFloorIdType()
|
| | | {
|
| | | if (this.nowShowSelectId == DiySelectPopupDialog.ALLSELECT)
|
| | | {
|
| | | //全部
|
| | | return 1;
|
| | | }
|
| | | foreach (var floorInfo in SpatialInfo.CurrentSpatial.FloorList)
|
| | | {
|
| | | if (floorInfo.uid == this.nowShowSelectId)
|
| | | {
|
| | | //当前选择的是楼层ID
|
| | | return 2;
|
| | | }
|
| | | }
|
| | | //不出意外,应该是房间了
|
| | | return 3;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 清除缓存
|
| | | /// </summary>
|
| | | public void ClearMemory()
|
| | | {
|
| | | //初始值
|
| | | this.nowShowSelectId = DiySelectPopupDialog.ALLSELECT;
|
| | | this.listAllFun = null;
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | mFirstList.Clear(); |
| | | foreach (var room in roomList) |
| | | { |
| | | mFirstList.Add(new RoomCellInfo() { Title = room.roomName, TagId = room.roomId }); |
| | | mFirstList.Add(new RoomCellInfo() { Title = room.roomName, TagId = room.uid }); |
| | | } |
| | | var roomSelectPopupDialog = new DiySelectPopupDialog(); |
| | | roomSelectPopupDialog.ShowView(mFirstList, null, selectAction, selectTag); |
| | |
| | | //一级数组为楼层 |
| | | foreach (var floor in floorList) |
| | | { |
| | | mFirstList.Add(new RoomCellInfo() { Title = floor.roomName, TagId = floor.roomId }); |
| | | mFirstList.Add(new RoomCellInfo() { Title = floor.roomName, TagId = floor.uid }); |
| | | var mList = new List<RoomCellInfo>(); |
| | | var allRoom = roomList.FindAll((room) => room.parentId == floor.roomId); |
| | | var allRoom = roomList.FindAll((room) => room.parentId == floor.uid); |
| | | foreach (var mRoom in allRoom) |
| | | { |
| | | mList.Add(new RoomCellInfo() { Title = mRoom.roomName, TagId = mRoom.roomId }); |
| | | mList.Add(new RoomCellInfo() { Title = mRoom.roomName, TagId = mRoom.uid }); |
| | | } |
| | | |
| | | if(mList == null) |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\DiySelectPopupDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\ColorTureLampPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\ColorTureLampPageBLL.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Common\Utlis\FloorRoomSelectPopupView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Common\Utlis\FloorSelectPopupDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\DiySelectPopupDialog.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\" />
|
| | |
| | | /// </summary> |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(110), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(45 * 2), |
| | | ScrollEnabled = false |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (SpatialInfo.CurrentSpatial.RoomList.Count < 2) |
| | | { |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(200), |
| | | BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 4); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(245), |
| | | BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 5); |
| | | contentView.ScrollEnabled = true; |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | |
| | | |
| | | List<Room> roomList = new List<Room>(); |
| | | roomList.Add(new Room() { roomName = Language.StringByID(StringId.All) }); |
| | | roomList.AddRange(SpatialInfo.CurrentSpatial.RoomList); |
| | | foreach (var tempRoom in roomList) |
| | | { |
| | | var roomName = tempRoom.roomName; |
| | | if (roomName != Language.StringByID(StringId.All)) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.BackgroundColor |
| | | }); |
| | | } |
| | | var btnHomeName = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | Text = roomName, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsSelected = btnFloor.Text == roomName, |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnHomeName); |
| | | |
| | | btnHomeName.MouseUpEventHandler += (senderH, en) => |
| | | { |
| | | dialog.Close(); |
| | | btnFloor.Text = roomName; |
| | | if (roomName == Language.StringByID(StringId.All)) |
| | | { |
| | | ShowFunctionRow(functionList); |
| | | } |
| | | else |
| | | { |
| | | var showList = new List<Function>(); |
| | | foreach (var sf in functionList) |
| | | { |
| | | if(sf.roomIds.Contains(tempRoom.roomId)) |
| | | { |
| | | showList.Add(sf); |
| | | } |
| | | } |
| | | ShowFunctionRow(showList); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | dialog.Show(); |
| | | string nowSelectId = null; |
| | | btnFloor.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | //显示下拉列表
|
| | | var form = new FloorRoomSelectPopupView();
|
| | | form.ShowDeviceFunctionView(btnFloor, this.functionList, (selectId, listFunc) =>
|
| | | {
|
| | | nowSelectId = selectId;
|
| | | //重新加载界面
|
| | | ShowFunctionRow(listFunc);
|
| | | }, nowSelectId);
|
| | | }; |
| | | |
| | | btnFloor.MouseUpEventHandler = eventHandler; |
| | | btnFloorDownIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic;
|
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | |
| | | /// 场景内容显示区域 |
| | | /// </summary> |
| | | FrameLayout floorChangeView; |
| | | /// <summary>
|
| | | /// 楼层房间选择的下拉对象
|
| | | /// </summary> |
| | | FloorRoomSelectPopupView floorRoomSelectView = null; |
| | | Button btnSceneTilte; |
| | | |
| | | #region 场景底部切换显示区域 |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = DB_ResidenceData.Instance.CurFloor.roomName, |
| | | }; |
| | | floorChangeView.AddChidren(btnFloor); |
| | | floorChangeView.AddChidren(btnFloor);
|
| | |
|
| | | string nowSelectId = null;
|
| | | btnFloor.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | if (this.floorRoomSelectView == null)
|
| | | {
|
| | | //先初始化
|
| | | this.floorRoomSelectView = new FloorRoomSelectPopupView();
|
| | | }
|
| | | //显示下拉列表
|
| | | this.floorRoomSelectView.ShowSceneView(btnFloor, (selectId, listScene) =>
|
| | | {
|
| | | nowSelectId = selectId;
|
| | | //重新刷新场景列表
|
| | | this.LoadSceneFunctionControlZone(listScene);
|
| | | }, nowSelectId);
|
| | | }; |
| | | |
| | | #endregion |
| | | |
| | |
|
| | | sceneFunctionView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = floorChangeView.Bottom, |
| | | Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30), |
| | | }; |
| | | scenePageView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(); |
| | | LoadSceneFunctionControlZone(null); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载场景功能显示区域 |
| | | /// </summary> |
| | | void LoadSceneFunctionControlZone() |
| | | void LoadSceneFunctionControlZone(List<Scene> listScene) |
| | | { |
| | | //topView.AddChidren(btnAddIcon); |
| | | |
| | |
| | | try |
| | | { |
| | | int index = 0; |
| | | foreach (var scene in FunctionList.List.scenes) |
| | | //获取能够显示的场景 |
| | | if (listScene == null)
|
| | | {
|
| | | //初始值
|
| | | if (this.floorRoomSelectView == null)
|
| | | {
|
| | | //先初始化
|
| | | this.floorRoomSelectView = new FloorRoomSelectPopupView();
|
| | | }
|
| | | listScene = this.floorRoomSelectView.GetCanShowListScene();
|
| | | } |
| | | foreach (var scene in listScene) |
| | | { |
| | | //if (scene.roomIds.Count == 0)//如何在房间已经移除了这个功能,则收藏界面也不会再显示 |
| | | //{ |
| | |
| | | LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene); |
| | | btnSettingIcon.MouseUpEventHandler = (sender, e) => { |
| | | Action backAction = () => { |
| | | LoadSceneFunctionControlZone(); |
| | | LoadSceneFunctionControlZone(null); |
| | | }; |
| | | Action refreshAction = () => { |
| | | btnName.Text = scene.name; |
| | |
| | | contentPageView.AddChidren(automationPage); |
| | | UI2.Intelligence.Automation.MainView.automationPage = automationPage; |
| | | UI2.Intelligence.Automation.MainView.MainShow(); |
| | | } |
| | | }
|
| | | #endregion |
| | | } |
| | | |
| | |
| | | |
| | | Action action = () => |
| | | { |
| | | LoadSceneFunctionControlZone(); |
| | | LoadSceneFunctionControlZone(null); |
| | | }; |
| | | var aep = new NewSceneMenuListPage(action); |
| | | MainPage.BasePageView.AddChidren(aep); |
| | |
| | | /// 筛选文本显示 |
| | | /// </summary> |
| | | Button btnScreenText; |
| | | /// <summary> |
| | | /// 筛选条件1 |
| | | /// </summary> |
| | | string screen1; |
| | | /// <summary> |
| | | /// 筛选条件2 |
| | | /// </summary> |
| | | string screen2; |
| | | |
| | | VerticalScrolViewLayout functionListView; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | LoadFunctionListRow(); |
| | | LoadFunctionListRow(null); |
| | | |
| | | LoadEventList(); |
| | | } |
| | |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | /// <param name="showUnallocated">是否是显示未分配</param> |
| | | void LoadFunctionListRow() |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | { |
| | | functionListView.RemoveAll(); |
| | | List<Function> functions = new List<Function>(); |
| | | functions.AddRange(unallocatedList); |
| | | functions.AddRange(allocatedList); |
| | | if (functions == null)
|
| | | {
|
| | | //初始值
|
| | | functions = new List<Function>();
|
| | | functions.AddRange(unallocatedList);
|
| | | functions.AddRange(allocatedList);
|
| | | } |
| | | foreach (var function in functions) |
| | | { |
| | | if (function.functionCategory != FunctionCategory.Light && |
| | |
| | | ) |
| | | { |
| | | continue; |
| | | } |
| | | //按楼层筛选 |
| | | if (!string.IsNullOrEmpty(screen1)) |
| | | { |
| | | if (!function.roomIds.Contains(screen1)) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | //按类型筛选 |
| | | if (!string.IsNullOrEmpty(screen2)) |
| | | { |
| | | //if (!function.functionType!= screen2) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | } |
| | | functionListView.AddChidren(new Button() |
| | | { |
| | |
| | | /// 住宅列表点击事件 |
| | | /// </summary> |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(110), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(45 * 2), |
| | | ScrollEnabled = false |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (SpatialInfo.CurrentSpatial.FloorList.Count < 2) |
| | | { |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.FloorList.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.FloorList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(200), |
| | | BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 4); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(245), |
| | | BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 5); |
| | | contentView.ScrollEnabled = true; |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | |
| | | |
| | | List<string> chooseList = new List<string>(); |
| | | chooseList.Add(Language.StringByID(StringId.All)); |
| | | foreach (var f in SpatialInfo.CurrentSpatial.FloorList) |
| | | { |
| | | chooseList.Add(f.roomName); |
| | | } |
| | | |
| | | foreach (var floor in chooseList) |
| | | { |
| | | if (floor != Language.StringByID(StringId.All)) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.BackgroundColor |
| | | }); |
| | | } |
| | | var btnHomeName = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS.CSS_Color.MainColor, |
| | | Text = floor, |
| | | TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | IsSelected = btnFloor.Text == floor, |
| | | IsMoreLines = true, |
| | | Tag = floor |
| | | }; |
| | | contentView.AddChidren(btnHomeName); |
| | | |
| | | btnHomeName.MouseUpEventHandler += (senderH, en) => |
| | | { |
| | | dialog.Close(); |
| | | btnFloor.Text = floor; |
| | | }; |
| | | } |
| | | |
| | | dialog.Show(); |
| | | {
|
| | | string nowSelectId = null;
|
| | | btnFloor.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | var listAllFun = new List<Function>();
|
| | | listAllFun.AddRange(unallocatedList);
|
| | | listAllFun.AddRange(allocatedList);
|
| | |
|
| | | //显示下拉界面
|
| | | var form = new FloorRoomSelectPopupView();
|
| | | form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) =>
|
| | | {
|
| | | nowSelectId = selectId;
|
| | | //重新刷新设备列表
|
| | | this.LoadFunctionListRow(listFun);
|
| | | }, nowSelectId);
|
| | | }; |
| | | |
| | | btnFloor.MouseUpEventHandler = eventHandler; |
| | | btnFloorDownIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | } |
| | | |
| | | //--------------------------------------- |