From f500e14c0a994487070380c50c85e0929cbc8e63 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 05 一月 2021 10:48:04 +0800 Subject: [PATCH] 2021-01-05 1.更新 --- Crabtree/SmartHome/UI/SimpleControl/Phone/System/SystemHomePage.cs | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/System/SystemHomePage.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/System/SystemHomePage.cs old mode 100755 new mode 100644 index a7e8d48..0b6f940 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/System/SystemHomePage.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/System/SystemHomePage.cs @@ -2,7 +2,7 @@ namespace Shared.SimpleControl.Phone鈥▄鈥� /// <summary>鈥� /// 鍚庨潰鐣岄潰涓婚〉闈⑩�� /// </summary>鈥� public class SystemHomePage : FrameLayout鈥� {鈥� SystemMiddle systemMiddle;鈥� SysMiddle sysMiddle;鈥� PageLayout sysMiddlePageView = new PageLayout () {鈥� Height = Application.GetRealHeight (936),鈥� Y = Application.GetRealHeight (206),鈥� BackgroundColor = SkinStyle.Current.ViewColor,鈥� IsShowPoint = false鈥� };鈥ㄢ�� public static PageLayout sysMiddleGatewayPageView = new PageLayout () {鈥� IsShowPoint = false鈥� };鈥� public static PageLayout sysMiddleDevicePageView = new PageLayout () {鈥� IsShowPoint = false鈥� };鈥ㄢ�� public SystemHomePage ()鈥� {鈥� sysMiddlePageView.BackgroundColor = SkinStyle.Current.ViewColor;鈥� AddChidren (sysMiddlePageView);鈥ㄢ�� sysMiddleGatewayPageView.PageChange += (sender, e) => { while (e < sysMiddleGatewayPageView.ChildrenCount - 1) {鈥� sysMiddleGatewayPageView.GetChildren (sysMiddleGatewayPageView.ChildrenCount - 1).RemoveFromParent ();鈥� //sysMiddleGatewayPageView.RemoveAt (sysMiddleGatewayPageView.ChildrenCount - 1); - }鈥� };鈥� sysMiddleDevicePageView.PageChange += (sender, e) => {鈥� while (e < sysMiddleDevicePageView.ChildrenCount - 1) {鈥� sysMiddleDevicePageView.GetChildren (sysMiddleDevicePageView.ChildrenCount - 1).RemoveFromParent ();鈥� //sysMiddleDevicePageView.RemoveAt (sysMiddleDevicePageView.ChildrenCount - 1);鈥� }鈥� };鈥� }鈥ㄢ�� /// <summary>鈥� /// 鍒濆鍖栧綋鍓嶈鍥锯�� /// </summary>鈥� public void Init ()鈥� {鈥� BackgroundColor = SkinStyle.Current.MainColor;鈥� InitTop ();鈥� InitMiddleTop ();鈥� if(sysMiddlePageView.ChildrenCount>0){鈥� sysMiddlePageView.RemoveAll ();鈥� }鈥� if (sysMiddleGatewayPageView.Parent != null) {鈥� sysMiddleGatewayPageView.PageIndex = 0;鈥� sysMiddleGatewayPageView.RemoveAll ();鈥� sysMiddleGatewayPageView.RemoveFromParent ();鈥� }鈥� if (sysMiddleDevicePageView.Parent != null) {鈥� sysMiddleDevicePageView.PageIndex = 0;鈥� sysMiddleDevicePageView.RemoveAll ();鈥� sysMiddleDevicePageView.RemoveFromParent ();鈥� }鈥� sysMiddlePageView.AddChidren (sysMiddleGatewayPageView);鈥� systemMiddle = new SystemMiddle ();鈥� sysMiddleGatewayPageView.AddChidren (systemMiddle);鈥� systemMiddle.Init ();鈥ㄢ�� sysMiddlePageView.AddChidren (sysMiddleDevicePageView);鈥� sysMiddle = new SysMiddle ();鈥� sysMiddleDevicePageView.AddChidren (sysMiddle);鈥� sysMiddle.Init ();鈥� sysMiddlePageView.PageIndex = 0;鈥� }鈥ㄢ�� void InitTop ()鈥� {鈥� FrameLayout SystemTopView = new FrameLayout () {鈥� Height = Application.GetRealHeight (126),鈥� } ;鈥� AddChidren (SystemTopView);鈥ㄢ�� Button LogoButton = new Button () {鈥� Y = Application.GetRealHeight (35),鈥� Height = Application.GetRealHeight (90),鈥� Width = Application.GetRealWidth (85),鈥� UnSelectedImagePath = "Item/Back.png",鈥� SelectedImagePath = "Item/BackSelected.png",鈥� } ;鈥ㄢ�� SystemTopView.AddChidren (LogoButton);鈥� LogoButton.MouseUpEventHandler += (sender, e) => {鈥� sysMiddleGatewayPageView.RemoveAll ();鈥� sysMiddleDevicePageView.RemoveAll ();鈥� sysMiddlePageView.RemoveAll ();鈥� (Parent as PageLayout).PageIndex -= 1;鈥� } ;鈥ㄢ�� Button NameButton = new Button () {鈥� Width = Application.GetRealWidth (400),鈥� Height = Application.GetMinReal (90),鈥� Text = UserConfig.Instance.CurrentRegion.RegionName,鈥� TextColor = SkinStyle.Current.TextColor1,鈥� Gravity = Gravity.CenterHorizontal,鈥� TextAlignment = TextAlignment.Center,鈥� Y = Application.GetRealHeight (30),鈥� TextSize = 20,鈥� } ;鈥� SystemTopView.AddChidren (NameButton);鈥ㄢ�� var logo = new Button () {鈥� Width = Application.GetRealWidth (154),鈥� Height = Application.GetRealHeight (90),鈥� X = Application.GetRealWidth (486),鈥� Y = Application.GetRealHeight (36),鈥� UnSelectedImagePath = MainPage.LogoString,鈥� };鈥� SystemTopView.AddChidren (logo);鈥� }鈥ㄢ�� void InitMiddleTop ()鈥� {鈥� HorizontalScrolViewLayout HorizontalScrolViewMain = new HorizontalScrolViewLayout () {鈥� Y = Application.GetRealHeight (126),鈥� Height = Application.GetRealHeight (80),鈥� ScrollEnabled = false鈥� };鈥� AddChidren (HorizontalScrolViewMain);鈥ㄢ�� Button gateWay = new Button {鈥� Width = Application.GetRealWidth (320),鈥� Height = LayoutParams.MatchParent,鈥� BackgroundColor = SkinStyle.Current.SysTitleView,鈥� SelectedBackgroundColor = SkinStyle.Current.SelectedColor,鈥� TextID = R.MyInternationalizationString.GateWay,鈥� TextAlignment = TextAlignment.Center,鈥� IsSelected = true,鈥� SelectedTextColor = SkinStyle.Current.TextColor1,鈥� TextColor = SkinStyle.Current.TextColor1,鈥� };鈥� HorizontalScrolViewMain.AddChidren (gateWay);鈥ㄢ�� Button equipmentButton = new Button {鈥� Width = Application.GetRealWidth (322),鈥� Height = LayoutParams.MatchParent,鈥� BackgroundColor = SkinStyle.Current.SysTitleView,鈥� SelectedBackgroundColor = SkinStyle.Current.SelectedColor,鈥� TextID = R.MyInternationalizationString.Equipment,鈥� TextAlignment = TextAlignment.Center,鈥� SelectedTextColor = SkinStyle.Current.TextColor1,鈥� TextColor = SkinStyle.Current.TextColor1,鈥� };鈥� HorizontalScrolViewMain.AddChidren (equipmentButton);鈥ㄢ�� gateWay.MouseUpEventHandler += (sender, e) => {鈥� sysMiddleGatewayPageView.PageIndex = 0;鈥� sysMiddleDevicePageView.PageIndex = 0;鈥� //while (sysMiddleGatewayPageView.ChildrenCount > 1) {//瀛恜ageview淇濈暀棣栭〉鈥� // sysMiddleGatewayPageView.RemoveAt (sysMiddleGatewayPageView.ChildrenCount - 1);鈥� //} + }鈥� };鈥� sysMiddleDevicePageView.PageChange += (sender, e) => {鈥� while (e < sysMiddleDevicePageView.ChildrenCount - 1) {鈥� sysMiddleDevicePageView.GetChildren (sysMiddleDevicePageView.ChildrenCount - 1).RemoveFromParent ();鈥� //sysMiddleDevicePageView.RemoveAt (sysMiddleDevicePageView.ChildrenCount - 1);鈥� }鈥� };鈥� }鈥ㄢ�� /// <summary>鈥� /// 鍒濆鍖栧綋鍓嶈鍥锯�� /// </summary>鈥� public void Init ()鈥� {鈥� BackgroundColor = SkinStyle.Current.MainColor;鈥� InitTop ();鈥� InitMiddleTop ();鈥� if(sysMiddlePageView.ChildrenCount>0){鈥� sysMiddlePageView.RemoveAll ();鈥� }鈥� if (sysMiddleGatewayPageView.Parent != null) {鈥� sysMiddleGatewayPageView.PageIndex = 0;鈥� sysMiddleGatewayPageView.RemoveAll ();鈥� sysMiddleGatewayPageView.RemoveFromParent ();鈥� }鈥� if (sysMiddleDevicePageView.Parent != null) {鈥� sysMiddleDevicePageView.PageIndex = 0;鈥� sysMiddleDevicePageView.RemoveAll ();鈥� sysMiddleDevicePageView.RemoveFromParent ();鈥� }鈥� sysMiddlePageView.AddChidren (sysMiddleGatewayPageView);鈥� systemMiddle = new SystemMiddle ();鈥� sysMiddleGatewayPageView.AddChidren (systemMiddle);鈥� systemMiddle.Init ();鈥ㄢ�� sysMiddlePageView.AddChidren (sysMiddleDevicePageView);鈥� sysMiddle = new SysMiddle ();鈥� sysMiddleDevicePageView.AddChidren (sysMiddle);鈥� sysMiddle.Init ();鈥� sysMiddlePageView.PageIndex = 0;鈥� }鈥ㄢ�� void InitTop ()鈥� {鈥� FrameLayout SystemTopView = new FrameLayout () {鈥� Height = Application.GetRealHeight (126),鈥� } ;鈥� AddChidren (SystemTopView);鈥ㄢ�� Button LogoButton = new Button () {鈥� Y = Application.GetRealHeight (35),鈥� Height = Application.GetRealHeight (90),鈥� Width = Application.GetRealWidth (85),鈥� UnSelectedImagePath = "Item/Back.png",鈥� SelectedImagePath = "Item/BackSelected.png",鈥� } ;鈥ㄢ�� SystemTopView.AddChidren (LogoButton);鈥� LogoButton.MouseUpEventHandler += (sender, e) => {鈥� sysMiddleGatewayPageView.RemoveAll ();鈥� sysMiddleDevicePageView.RemoveAll ();鈥� sysMiddlePageView.RemoveAll ();鈥� (Parent as PageLayout).PageIndex -= 1;鈥� } ;鈥ㄢ�� Button NameButton = new Button () {鈥� Width = Application.GetRealWidth (400),鈥� Height = Application.GetMinReal (90),鈥� Text = UserConfig.Instance.CurrentRegion.Name,鈥� TextColor = SkinStyle.Current.TextColor1,鈥� Gravity = Gravity.CenterHorizontal,鈥� TextAlignment = TextAlignment.Center,鈥� Y = Application.GetRealHeight (30),鈥� TextSize = 20,鈥� } ;鈥� SystemTopView.AddChidren (NameButton);鈥ㄢ�� var logo = new Button () {鈥� Width = Application.GetRealWidth (154),鈥� Height = Application.GetRealHeight (90),鈥� X = Application.GetRealWidth (486),鈥� Y = Application.GetRealHeight (36),鈥� UnSelectedImagePath = MainPage.LogoString,鈥� };鈥� SystemTopView.AddChidren (logo);鈥� }鈥ㄢ�� void InitMiddleTop ()鈥� {鈥� HorizontalScrolViewLayout HorizontalScrolViewMain = new HorizontalScrolViewLayout () {鈥� Y = Application.GetRealHeight (126),鈥� Height = Application.GetRealHeight (80),鈥� ScrollEnabled = false鈥� };鈥� AddChidren (HorizontalScrolViewMain);鈥ㄢ�� Button gateWay = new Button {鈥� Width = Application.GetRealWidth (320),鈥� Height = LayoutParams.MatchParent,鈥� BackgroundColor = SkinStyle.Current.SysTitleView,鈥� SelectedBackgroundColor = SkinStyle.Current.SelectedColor,鈥� TextID = R.MyInternationalizationString.GateWay,鈥� TextAlignment = TextAlignment.Center,鈥� IsSelected = true,鈥� SelectedTextColor = SkinStyle.Current.TextColor1,鈥� TextColor = SkinStyle.Current.TextColor1,鈥� };鈥� HorizontalScrolViewMain.AddChidren (gateWay);鈥ㄢ�� Button equipmentButton = new Button {鈥� Width = Application.GetRealWidth (322),鈥� Height = LayoutParams.MatchParent,鈥� BackgroundColor = SkinStyle.Current.SysTitleView,鈥� SelectedBackgroundColor = SkinStyle.Current.SelectedColor,鈥� TextID = R.MyInternationalizationString.Equipment,鈥� TextAlignment = TextAlignment.Center,鈥� SelectedTextColor = SkinStyle.Current.TextColor1,鈥� TextColor = SkinStyle.Current.TextColor1,鈥� };鈥� HorizontalScrolViewMain.AddChidren (equipmentButton);鈥ㄢ�� gateWay.MouseUpEventHandler += (sender, e) => {鈥� sysMiddleGatewayPageView.PageIndex = 0;鈥� sysMiddleDevicePageView.PageIndex = 0;鈥� //while (sysMiddleGatewayPageView.ChildrenCount > 1) {//瀛恜ageview淇濈暀棣栭〉鈥� // sysMiddleGatewayPageView.RemoveAt (sysMiddleGatewayPageView.ChildrenCount - 1);鈥� //} //while (sysMiddleDevicePageView.ChildrenCount > 1) {//瀛恜ageview淇濈暀棣栭〉 // sysMiddleDevicePageView.RemoveAt (sysMiddleDevicePageView.ChildrenCount - 1);鈥� //} sysMiddlePageView.PageIndex = 0; -- Gitblit v1.8.0