| | |
| | | #region top |
| | | topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(74), |
| | | BackgroundColor = CSS_Color.TopViewColor, |
| | | }; |
| | | bodyView.AddChidren(topView); |
| | |
| | | //判断是否需要隐藏自动化 |
| | | if (HideAutoPage) |
| | | { |
| | | if (false && DB_ResidenceData.Instance.GatewayType == 1)//网关需要加载安防--2021-11-28 19:56:53 刘晓辉将安防放入改界面 |
| | | { |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected = true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | //if (DB_ResidenceData.Instance.GatewayType == 1)//网关需要加载安防--2021-11-28 19:56:53 刘晓辉将安防放入该界面 |
| | | //{ |
| | | // btnSceneTilte = new Button() |
| | | // { |
| | | // Y = Application.GetRealHeight(30), |
| | | // Width = Application.GetRealWidth(170), |
| | | // Height = Application.GetRealHeight(25), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextSize = CSS_FontSize.HeadlineFontSize, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextID = StringId.Scenes, |
| | | // IsSelected = true |
| | | // }; |
| | | // topView.AddChidren(btnSceneTilte); |
| | | |
| | | btnSecurityTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(209), |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.anfang, |
| | | }; |
| | | topView.AddChidren(btnSecurityTitle); |
| | | btnAutomationTitle = new Button(); |
| | | } |
| | | else |
| | | // btnSecurityTitle = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(209), |
| | | // Y = Application.GetRealHeight(30), |
| | | // Width = Application.GetRealWidth(170), |
| | | // Height = Application.GetRealHeight(25), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextID = StringId.anfang, |
| | | // }; |
| | | // topView.AddChidren(btnSecurityTitle); |
| | | // btnAutomationTitle = new Button(); |
| | | //} |
| | | //else |
| | | { |
| | | |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(40), |
| | | //Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | } |
| | | else |
| | | { |
| | | if (false && DB_ResidenceData.Instance.GatewayType == 1)//网关需要加载安防--2021-11-28 19:56:53 刘晓辉将安防放入改界面 |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | btnAutomationTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(40), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(40), |
| | | Width = otherWidth, |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | |
| | | btnSecurityTitle = new Button() |
| | | { |
| | | X = btnAutomationTitle.Right, |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(40), |
| | | Width = otherWidth, |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | { |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(40), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | |
| | | btnAutomationTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(209), |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(40), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | btnAddIconBg = new Button() |
| | | { |
| | | X = Application.GetRealWidth(337), |
| | | Y = Application.GetRealHeight(29), |
| | | Y = Application.GetRealHeight(39), |
| | | Width = Application.GetMinRealAverage(28), |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/AddIcon.png", |
| | |
| | | |
| | | contentPageView = new PageLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667 - 64 - 49 + 30), |
| | | Y = Application.GetRealHeight(74), |
| | | Height = Application.GetRealHeight(667 - 74 - 49 + 30), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | IsShowPoint = false |
| | | }; |
| | |
| | | var rowView = new FrameLayout(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | foreach (var scene in listScene) |
| | | try |
| | | { |
| | | System.Threading.Thread.Sleep(10); |
| | | foreach (var scene in listScene) |
| | | { |
| | | if (scene == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (scene.sceneType == SceneType.LightScene) |
| | | { |
| | | continue; |
| | | } |
| | | System.Threading.Thread.Sleep(10); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (index % 2 == 0) |
| | | { |
| | | rowView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(122), |
| | | }; |
| | | sceneFunctionView.AddChidren(rowView); |
| | | sceneFunctionView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(7 + 7), |
| | | }); |
| | | } |
| | | var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16); |
| | | |
| | | var functionView = LoadSceneFunctionDiv(functionView_X, scene); |
| | | rowView.AddChidren(functionView); |
| | | index++; |
| | | }); |
| | | } |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log($"加载场景列表异常:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (index % 2 == 0) |
| | | { |
| | | rowView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(122), |
| | | }; |
| | | sceneFunctionView.AddChidren(rowView); |
| | | sceneFunctionView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(7 + 7), |
| | | }); |
| | | } |
| | | var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16); |
| | | |
| | | var functionView = LoadSceneFunctionDiv(functionView_X, scene); |
| | | rowView.AddChidren(functionView); |
| | | index++; |
| | | sceneFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | MainPage.Log("homepage erorr : " + ex.Message); |
| | | } |
| | | sceneFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnSceneTilte.IsSelected = false; |
| | | btnSceneTilte.TextSize = CSS_FontSize.TextFontSize; |
| | | contentPageView.PageIndex = 2; |
| | | contentPageView.PageIndex = contentPageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | } |
| | |
| | | { |
| | | btnAddIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (btnSecurityTitle != null && btnSecurityTitle.IsSelected) |
| | | { |
| | | return; |
| | | } |
| | | if (!btnAutomationTitle.IsSelected) |
| | | { |
| | | //如果是成员 |