| | |
| | | /// </summary> |
| | | Button btnChangeScene; |
| | | /// <summary> |
| | | /// 切换显示场组控按钮 |
| | | /// </summary> |
| | | Button btnChangeGroupControl; |
| | | /// <summary> |
| | | /// 功能显示区域 |
| | | /// </summary> |
| | | PageLayout contentView; |
| | |
| | | /// </summary> |
| | | VerticalScrolViewLayout sceneFunctionView; |
| | | /// <summary> |
| | | /// 组控控制区域 |
| | | /// </summary> |
| | | VerticalScrolViewLayout gcFunctionView; |
| | | /// <summary> |
| | | /// 功能区域集合 |
| | | /// </summary> |
| | | List<FrameLayout> functionViews; |
| | |
| | | #region 区域变量 |
| | | /// <summary> |
| | | /// 当前显示对控制类型是否是设备功能控制 |
| | | /// 0 功能 |
| | | /// 1 场景 |
| | | /// 2 群控 |
| | | /// </summary> |
| | | bool CurShowTypeIsFunction = true; |
| | | int CurShowTypeContent = 0; |
| | | #endregion |
| | | |
| | | #region 报警信息 |
| | |
| | | bodyView.EndHeaderRefreshing(); |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | LoadContentView(); |
| | | if (!CurShowTypeIsFunction) |
| | | { |
| | | contentView.PageIndex = 1; |
| | | } |
| | | contentView.PageIndex = CurShowTypeContent; |
| | | }; |
| | | topView = new FrameLayout() |
| | | { |
| | |
| | | refreshLayout.EndHeaderRefreshing(); |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | LoadContentView(); |
| | | if(!CurShowTypeIsFunction) |
| | | { |
| | | contentView.PageIndex = 1; |
| | | } |
| | | contentView.PageIndex = CurShowTypeContent; |
| | | }; |
| | | topView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 }); |
| | | |
| | | changeView = new FrameLayout() |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | //Y = Application.GetRealHeight(20) + topView.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(230), |
| | | Height = Application.GetRealHeight(62), |
| | | BackgroundImagePath = "Collection/ChangeViewbg.png", |
| | | }; |
| | | bodyView.AddChidren(changeView); |
| | | changeView = new FrameLayout() |
| | | { |
| | | //Y = Application.GetRealHeight(20) + topView.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(334), |
| | | Height = Application.GetRealHeight(62), |
| | | BackgroundImagePath = "Collection/ChangeViewbg.png", |
| | | }; |
| | | bodyView.AddChidren(changeView); |
| | | |
| | | btnChangeFunction = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(114-10), |
| | | TextID = StringId.Functions, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsSelected = true, |
| | | IsBold = true, |
| | | }; |
| | | changeView.AddChidren(btnChangeFunction); |
| | | btnChangeFunction = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(114 - 10), |
| | | TextID = StringId.Functions, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsSelected = true, |
| | | IsBold = true, |
| | | }; |
| | | changeView.AddChidren(btnChangeFunction); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | X = btnChangeFunction.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(1), |
| | | Height = Application.GetRealHeight(14), |
| | | BackgroundColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | changeView.AddChidren(btnLine); |
| | | Button btnLine = new Button() |
| | | { |
| | | X = btnChangeFunction.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(1), |
| | | Height = Application.GetRealHeight(14), |
| | | BackgroundColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | changeView.AddChidren(btnLine); |
| | | |
| | | btnChangeScene = new Button() |
| | | btnChangeScene = new Button() |
| | | { |
| | | X = btnLine.Right, |
| | | Width = Application.GetRealWidth(114 - 10), |
| | | TextID = StringId.Scenes, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | changeView.AddChidren(btnChangeScene); |
| | | |
| | | Button btnLine2 = new Button() |
| | | { |
| | | X = btnChangeScene.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(1), |
| | | Height = Application.GetRealHeight(14), |
| | | BackgroundColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | changeView.AddChidren(btnLine2); |
| | | |
| | | btnChangeGroupControl = new Button() |
| | | { |
| | | X = btnLine2.Right, |
| | | Width = Application.GetRealWidth(114 - 10), |
| | | TextID = StringId.GroupControl, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | changeView.AddChidren(btnChangeGroupControl); |
| | | } |
| | | else |
| | | { |
| | | X = btnLine.Right, |
| | | Width = Application.GetRealWidth(114-10), |
| | | TextID = StringId.Scenes, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | changeView.AddChidren(btnChangeScene); |
| | | changeView = new FrameLayout() |
| | | { |
| | | //Y = Application.GetRealHeight(20) + topView.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(230), |
| | | Height = Application.GetRealHeight(62), |
| | | BackgroundImagePath = "Collection/ChangeViewbg.png", |
| | | }; |
| | | bodyView.AddChidren(changeView); |
| | | |
| | | btnChangeFunction = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(114 - 10), |
| | | TextID = StringId.Functions, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsSelected = true, |
| | | IsBold = true, |
| | | }; |
| | | changeView.AddChidren(btnChangeFunction); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | X = btnChangeFunction.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(1), |
| | | Height = Application.GetRealHeight(14), |
| | | BackgroundColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | changeView.AddChidren(btnLine); |
| | | |
| | | btnChangeScene = new Button() |
| | | { |
| | | X = btnLine.Right, |
| | | Width = Application.GetRealWidth(114 - 10), |
| | | TextID = StringId.Scenes, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | changeView.AddChidren(btnChangeScene); |
| | | } |
| | | #endregion |
| | | |
| | | #region ContextView |
| | |
| | | sceneFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(); |
| | | if (CurShowTypeIsFunction) |
| | | contentView.PageIndex = CurShowTypeContent; |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | contentView.PageIndex = 0; |
| | | }else |
| | | { |
| | | contentView.PageIndex = 1; |
| | | gcFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(gcFunctionView); |
| | | LoadGroupControlFunctionControlZone(); |
| | | } |
| | | |
| | | LoadEvent_ChangeShowedFunctionType(); |
| | |
| | | sceneFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(); |
| | | |
| | | if (CurShowTypeIsFunction) |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | contentView.PageIndex = 0; |
| | | gcFunctionView = new VerticalScrolViewLayout(); |
| | | contentView.AddChidren(gcFunctionView); |
| | | LoadGroupControlFunctionControlZone(); |
| | | } |
| | | else |
| | | { |
| | | contentView.PageIndex = 1; |
| | | } |
| | | contentView.PageIndex = CurShowTypeContent; |
| | | |
| | | |
| | | LoadEvent_ChangeShowedFunctionType(); |
| | |
| | | /// </summary> |
| | | void LoadDeviceFunctionControlZone() |
| | | { |
| | | #region ContextView |
| | | #region ContextView |
| | | deviceFunctionView.RemoveAll(); |
| | | functionViews.Clear(); |
| | | var rowView = new FrameLayout(); |
| | |
| | | int index = 0; |
| | | var list = new List<Function>(); |
| | | list.AddRange(FunctionList.List.GetDeviceFunctionList()); |
| | | list.AddRange(FunctionList.List.groupControls);//加入群控 |
| | | //list.AddRange(FunctionList.List.groupControls);//加入群控 |
| | | foreach (var function in list) |
| | | { |
| | | //音乐模块有主从关系,需要特殊处理 |
| | |
| | | MainPage.Log("homepage error : " + ex.Message); |
| | | } |
| | | deviceFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); |
| | | #endregion |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载群控功能显示区域 |
| | | /// </summary> |
| | | void LoadGroupControlFunctionControlZone() |
| | | { |
| | | #region ContextView |
| | | gcFunctionView.RemoveAll(); |
| | | functionViews.Clear(); |
| | | var rowView = new FrameLayout(); |
| | | try |
| | | { |
| | | int index = 0; |
| | | foreach (var function in FunctionList.List.groupControls) |
| | | { |
| | | if (index % 2 == 0) |
| | | { |
| | | rowView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(140), |
| | | }; |
| | | gcFunctionView.AddChidren(rowView); |
| | | } |
| | | var functionView_X = Application.GetRealWidth((182 + 7) * (index % 2)); |
| | | if (index % 2 == 0) |
| | | { |
| | | functionView_X += Application.GetRealWidth(7); |
| | | } |
| | | var functionView = new FrameLayout() |
| | | { |
| | | X = functionView_X, |
| | | Width = Application.GetRealWidth(182), |
| | | Height = Application.GetRealWidth(140), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = function.sid |
| | | }; |
| | | rowView.AddChidren(functionView); |
| | | functionViews.Add(functionView); |
| | | var btnbg = new Button() |
| | | { |
| | | UnSelectedImagePath = "Collection/Functionbg.png", |
| | | SelectedImagePath = "Collection/FunctionOnbg.png", |
| | | Tag = function.sid |
| | | }; |
| | | functionView.AddChidren(btnbg); |
| | | LoadDeviceFunctionDiv(functionView, function); |
| | | |
| | | index++; |
| | | } |
| | | |
| | | if (index == 0) |
| | | { |
| | | var view = new FrameLayout(); |
| | | deviceFunctionView.AddChidren(view); |
| | | |
| | | var btnNoCollectionBg = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(180), |
| | | Height = Application.GetRealWidth(180), |
| | | UnSelectedImagePath = "Collection/NoCollectionBg.png", |
| | | }; |
| | | view.AddChidren(btnNoCollectionBg); |
| | | |
| | | var btnNoCollectionTip = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(42), |
| | | Y = btnNoCollectionBg.Bottom, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | //TextID = StringId.TipNoFunctionCollcetion, |
| | | }; |
| | | view.AddChidren(btnNoCollectionTip); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("homepage error : " + ex.Message); |
| | | } |
| | | gcFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); |
| | | #endregion |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载场景功能显示区域 |
| | | /// </summary> |
| | |
| | | SelectedImagePath = "Collection/CollectionWhiteIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionIcon.png", |
| | | }; |
| | | view.AddChidren(btnCollection); |
| | | if (function.spk != SPK.GroupControl)//群控默认显示 |
| | | view.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | //{ |