HDL-ON_Android/Assets/Language.ini
@@ -666,6 +666,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic coloring @@ -2003,9 +2004,10 @@ 676=中 677=高 678=当前用户数据已清空,即将返回上一页。 679=群控 679=组控 680=炫彩开关 681=自动炫彩测试 682=自动炫彩 @@ -3345,6 +3347,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic Coloring @@ -4680,6 +4683,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic Coloring @@ -6004,6 +6008,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic Coloring HDL-ON_Android/Assets/Phone/Classification/Room/Roombg.pngHDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.9.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307201"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.9.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307211"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <!--友盟--> HDL-ON_iOS/Resources/Language.ini
@@ -666,6 +666,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic coloring @@ -2006,6 +2007,7 @@ 679=组控 680=炫彩开关 681=自动炫彩测试 682=自动炫彩 @@ -3345,6 +3347,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic Coloring @@ -4680,6 +4683,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic Coloring @@ -6004,6 +6008,7 @@ 679=Group control 680=Colorful switch 681=Test 682=Automatic Coloring HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg.pngHDL_ON/Common/HDLCommon.cs
@@ -461,6 +461,7 @@ case "464027401@qq.com": case "13580507523": case "15626203746": case "18316672920": return; } HDL_ON/Common/R.cs
@@ -4,6 +4,7 @@ { public static class StringId { /// <summary> /// 自动炫彩测试 /// </summary> @@ -13,7 +14,7 @@ /// </summary> public const int ColorfulSwitch = 680; /// <summary> /// 群控 /// 组控 /// </summary> public const int GroupControl = 679; /// <summary> HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -879,6 +879,7 @@ //测试账号,不挤下线 switch (UserInfo.Current.userMobileInfo) { case "18316672920": case "15626203746": case "464027401@qq.com": return; HDL_ON/Entity/Function/Function.cs
@@ -803,25 +803,27 @@ var list = new List<FunctionAttributes>(); if (spk == SPK.GroupControl) { var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); if (gc != null) lock (list) { foreach (var temp in gc.sids) var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); if (gc != null) { var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); if (light != null) foreach (var temp in gc.sids) { foreach (var attr in light.attributes) var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); if (light != null) { if (list.Find((obj) => obj.key == attr.key) == null) foreach (var attr in light.attributes) { list.Add(attr); if (list.Find((obj) => obj.key == attr.key) == null) { list.Add(attr); } } } } } } } else { HDL_ON/HDL_ON.projitems
@@ -561,6 +561,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockFaceUnlockHelpPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockAudioSetupPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockBatteryManagementPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\2-Classification\SeriesFunctionListPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -320,12 +320,12 @@ //etAccount.Text = "18321091245"; //etAccount.Text = "13751916353"; etAccount.Text = "13549566666"; etAccount.Text = "18316672920"; etAccount.Text = "support7@hdlautomation.com"; etAccount.Text = "13375012446";//测试服务器 etAccount.Text = "15855403939"; etAccount.Text = "15006564444"; etAccount.Text = "13580507523"; etAccount.Text = "18316672920"; } else { HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -70,19 +70,20 @@ /// <summary> /// 切换显示功能类型区域 /// </summary> FrameLayout changeView; /// <summary> /// 切换显示设备功能按钮 /// </summary> Button btnChangeFunction; /// <summary> /// 切换显示场景功能按钮 /// </summary> Button btnChangeScene; /// <summary> /// 切换显示场组控按钮 /// </summary> Button btnChangeGroupControl; FrameLayout changeBaseView; //FrameLayout changeView; ///// <summary> ///// 切换显示设备功能按钮 ///// </summary> //Button btnChangeFunction; ///// <summary> ///// 切换显示场景功能按钮 ///// </summary> //Button btnChangeScene; ///// <summary> ///// 切换显示场组控按钮 ///// </summary> //Button btnChangeGroupControl; /// <summary> /// 功能显示区域 /// </summary> @@ -116,11 +117,11 @@ #endregion #region 报警信息 Button btnMsgBg; Button btnMsgTime; Button btnMsg; //Button btnMsgBg; //Button btnMsgTime; //Button btnMsg; Button btnMsgIcon; #endregion #endregion public HomePage() { @@ -164,14 +165,14 @@ }; topView = new FrameLayout() { Height = Application.GetRealHeight(216), Height = Application.GetRealHeight(113),//216), BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, }; bodyView.AddChidren(topView); #else VerticalRefreshLayout refreshLayout = new VerticalRefreshLayout() { Height = Application.GetRealHeight(216), Height = Application.GetRealHeight(113),//216), BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, }; bodyView.AddChidren(refreshLayout); @@ -184,7 +185,7 @@ }; topView = new FrameLayout() { Height = Application.GetRealHeight(216), Height = Application.GetRealHeight(113),//216), }; refreshLayout.AddChidren(topView); #endif @@ -508,57 +509,57 @@ #region msg FrameLayout msgView; msgView = new FrameLayout() { Y = Application.GetRealHeight(164), Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(28), }; topView.AddChidren(msgView); //FrameLayout msgView; //msgView = new FrameLayout() //{ // Y = Application.GetRealHeight(164), // Gravity = Gravity.CenterHorizontal, // Width = Application.GetRealWidth(343), // Height = Application.GetRealHeight(28), //}; //topView.AddChidren(msgView); btnMsgBg = new Button() { BackgroundColor = CSS_Color.MainColor,//0x3F4484F4, Alpha = 0.4f, }; msgView.AddChidren(btnMsgBg); //btnMsgBg = new Button() //{ // BackgroundColor = CSS_Color.MainColor,//0x3F4484F4, // Alpha = 0.4f, //}; //msgView.AddChidren(btnMsgBg); btnMsgIcon = new Button() { X = Application.GetRealWidth(12), Gravity = Gravity.CenterVertical, X = Application.GetRealWidth(290), Y = Application.GetRealHeight(35), Width = Application.GetMinRealAverage(24), Height = Application.GetMinRealAverage(24), UnSelectedImagePath = "Collection/MsgIcon.png", SelectedImagePath = "Collection/MsgIconTip.png", }; msgView.AddChidren(btnMsgIcon); topView.AddChidren(btnMsgIcon); btnMsg = new Button() { X = Application.GetRealWidth(10) + btnMsgIcon.Right, Width = Application.GetRealWidth(240), Text = "...", TextColor = CSS_Color.MainBackgroundColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.CenterLeft, }; msgView.AddChidren(btnMsg); //btnMsg = new Button() //{ // X = Application.GetRealWidth(10) + btnMsgIcon.Right, // Width = Application.GetRealWidth(240), // Text = "...", // TextColor = CSS_Color.MainBackgroundColor, // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, // TextAlignment = TextAlignment.CenterLeft, //}; //msgView.AddChidren(btnMsg); btnMsgTime = new Button() { X = Application.GetRealWidth(299), Width = Application.GetRealWidth(44), Text = "00:00", TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.CenterLeft, }; msgView.AddChidren(btnMsgTime); //btnMsgTime = new Button() //{ // X = Application.GetRealWidth(299), // Width = Application.GetRealWidth(44), // Text = "00:00", // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, // TextAlignment = TextAlignment.CenterLeft, //}; //msgView.AddChidren(btnMsgTime); LoadEvent_GotoMessageCenterPage(); @@ -570,134 +571,12 @@ bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 }); if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) { 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); loadNavView(); 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); 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 { 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 contentView = new PageLayout() { //Y = changeView.Bottom, Height = Application.GetRealHeight(310 + 30 + 10), //20为超出部分 IsShowPoint = false, }; bodyView.AddChidren(contentView); functionViews = new List<FrameLayout>(); @@ -712,6 +591,295 @@ } void loadNavView() { if(changeBaseView == null) { changeBaseView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Height = Application.GetRealHeight(62), }; bodyView.AddChidren(changeBaseView); } else { changeBaseView.RemoveAll(); } if (contentView == null) { contentView = new PageLayout() { Height = Application.GetRealHeight(310 + 30 + 10 + 100), //20为超出部分 IsShowPoint = false, }; bodyView.AddChidren(contentView); } if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl && FunctionList.List.groupControls.Count > 0) { var changeView = new FrameLayout() { //Y = Application.GetRealHeight(20) + topView.Bottom, Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(334), Height = Application.GetRealHeight(62), BackgroundImagePath = "Collection/ChangeViewbg.png", }; changeBaseView.AddChidren(changeView); var 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); var 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); var 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); btnChangeGroupControl.MouseUpEventHandler = (sender, e) => { btnChangeFunction.IsSelected = false; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsBold = false; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; btnChangeGroupControl.IsSelected = true; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeGroupControl.IsBold = true; CurShowTypeContent = 2; contentView.PageIndex = 2; }; btnChangeFunction.MouseUpEventHandler = (sender, e) => { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; CurShowTypeContent = 0; contentView.PageIndex = 0; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; }; btnChangeScene.MouseUpEventHandler = (sender, e) => { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; CurShowTypeContent = 1; contentView.PageIndex = 1; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; }; contentView.PageChange = (sender, e) => { if (contentView.PageIndex == 0) { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; } else if (contentView.PageIndex == 1) { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; } else if (contentView.PageIndex == 2) { btnChangeFunction.IsSelected = false; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsBold = false; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; btnChangeGroupControl.IsSelected = true; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeGroupControl.IsBold = true; } }; } else { var changeView = new FrameLayout() { //Y = Application.GetRealHeight(20) + topView.Bottom, Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(230), Height = Application.GetRealHeight(62), BackgroundImagePath = "Collection/ChangeViewbg.png", }; changeBaseView.AddChidren(changeView); var 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); var 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); btnChangeFunction.MouseUpEventHandler = (sender, e) => { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; CurShowTypeContent = 0; contentView.PageIndex = 0; }; btnChangeScene.MouseUpEventHandler = (sender, e) => { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; CurShowTypeContent = 1; contentView.PageIndex = 1; }; contentView.PageChange = (sender, e) => { if (contentView.PageIndex == 0) { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; } else if (contentView.PageIndex == 1) { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; } }; } contentView.PageIndex = CurShowTypeContent; } /// <summary> /// 加载内容区域 /// </summary> @@ -736,8 +904,10 @@ { if (contentView == null) { waitPage.Hide(); return; } loadNavView(); contentView.RemoveAll(); deviceFunctionView = new VerticalScrolViewLayout(); contentView.AddChidren(deviceFunctionView); HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -238,6 +238,19 @@ } /// <summary> /// 更新功能组控主页 /// </summary> public static void RefreshGroupControlView() { if (bodyView != null) { bodyView.LoadGroupControlFunctionControlZone(); } } /// <summary> /// 更新连接状态图标 /// </summary> void CheckLinkStatus() @@ -325,137 +338,9 @@ /// </summary> void LoadEvent_ChangeShowedFunctionType() { btnChangeFunction.MouseUpEventHandler = (sender, e) => if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl && FunctionList.List.groupControls.Count>0) { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; CurShowTypeContent = 0; contentView.PageIndex = 0; }; btnChangeScene.MouseUpEventHandler = (sender, e) => { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; CurShowTypeContent = 1; contentView.PageIndex = 1; }; contentView.PageChange = (sender, e) => { if (contentView.PageIndex == 0) { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; } else if (contentView.PageIndex == 1) { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; } }; if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) { btnChangeGroupControl.MouseUpEventHandler = (sender, e) => { btnChangeFunction.IsSelected = false; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsBold = false; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; btnChangeGroupControl.IsSelected = true; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeGroupControl.IsBold = true; CurShowTypeContent = 2; contentView.PageIndex = 2; }; btnChangeFunction.MouseUpEventHandler = (sender, e) => { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; CurShowTypeContent = 0; contentView.PageIndex = 0; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; }; btnChangeScene.MouseUpEventHandler = (sender, e) => { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; CurShowTypeContent = 1; contentView.PageIndex = 1; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; }; contentView.PageChange = (sender, e) => { if (contentView.PageIndex == 0) { btnChangeFunction.IsSelected = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeFunction.IsBold = true; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; } else if (contentView.PageIndex == 1) { btnChangeScene.IsSelected = true; btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeScene.IsBold = true; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsSelected = false; btnChangeFunction.IsBold = false; btnChangeGroupControl.IsSelected = false; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeGroupControl.IsBold = false; } else if (contentView.PageIndex == 2) { btnChangeFunction.IsSelected = false; btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeFunction.IsBold = false; btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize; btnChangeScene.IsSelected = false; btnChangeScene.IsBold = false; btnChangeGroupControl.IsSelected = true; btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize; btnChangeGroupControl.IsBold = true; } }; } } @@ -888,9 +773,9 @@ skipPage.LoadPage(backAction); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnMsgBg.MouseUpEventHandler = eventHandler; btnMsgTime.MouseUpEventHandler = eventHandler; btnMsg.MouseUpEventHandler = eventHandler; //btnMsgBg.MouseUpEventHandler = eventHandler; //btnMsgTime.MouseUpEventHandler = eventHandler; //btnMsg.MouseUpEventHandler = eventHandler; btnMsgIcon.MouseUpEventHandler = eventHandler; } @@ -975,8 +860,8 @@ void ShowMesBtnState(PushMessageInfo pushMessageInfo, bool allRead) { if (bodyView == null) return; btnMsg.Text = pushMessageInfo.messageTitle + ": " + pushMessageInfo.messageContent; btnMsgTime.Text = GetUnixToDateTime(pushMessageInfo.createTime); //btnMsg.Text = pushMessageInfo.messageTitle + ": " + pushMessageInfo.messageContent; //btnMsgTime.Text = GetUnixToDateTime(pushMessageInfo.createTime); btnMsgIcon.IsSelected = !allRead; } @@ -986,8 +871,8 @@ void ResetMesBtnRead() { if (bodyView == null) return; btnMsg.Text = "..."; btnMsgTime.Text = "00:00"; //btnMsg.Text = "..."; //btnMsgTime.Text = "00:00"; btnMsgIcon.IsSelected = false; } HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -876,6 +876,12 @@ case ShowFunction.Series: btnName.TextID = StringId.HorseRaceLamp; functionPageTitleId = StringId.HorseRaceLamp; btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { var page2 = new UI2.Classification.SeriesFunctionListPage(); MainPage.BasePageView.AddChidren(page2); page2.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; break; case ShowFunction.Light: #region Light @@ -1196,8 +1202,9 @@ && item != ShowFunction.SecurityMonitoring && item != ShowFunction.DoorLock && ShowFunction.EnergyMonitoring != item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item && ShowFunction.Series != item && ShowFunction.Acst != item) { btnFunctionViewBg.MouseUpEventHandler = (sender, e) => HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs
New file @@ -0,0 +1,170 @@ using System; using System.Collections.Generic; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI.UI2.Classification { public class SeriesFunctionListPage : FrameLayout { FrameLayout bodyView; public SeriesFunctionListPage() { bodyView = this; } public void LoadPage() { new TopViewDiv(bodyView, Language.StringByID(StringId.HorseRaceLamp)).LoadTopView(); bodyView.BackgroundColor = CSS_Color.BackgroundColor; var functionListView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(603 - 12), }; bodyView.AddChidren(functionListView); var waitPage = new Loading(); bodyView.AddChidren(waitPage); waitPage.Hide(); Dictionary<string, List<Button>> dicGroupButtons = new Dictionary<string, List<Button>>(); foreach(var rgb in FunctionList.List.GetLightList()) { if(rgb.spk == SPK.LightRGB) { if (rgb.GetAttribute(FunctionAttributeKey.Colorful) == null) { continue; } List<Button> groupButtons = new List<Button>(); var list = new List<Function>(); list.Add(rgb); var oid = rgb.sid.Substring(0, 16); var seriesList = FunctionList.List.GetSeries().FindAll((obj) => obj.sid.StartsWith(oid)); list.AddRange(seriesList); var groupView = new VerticalScrolViewLayout() { Height = Application.GetRealHeight(44 + 51 * list.Count), BackgroundColor = CSS_Color.MainBackgroundColor, ScrollEnabled = false, }; functionListView.AddChidren(groupView); #region title var titleView = new FrameLayout() { Height = Application.GetRealHeight(44), }; groupView.AddChidren(titleView); var btnTitle = new Button() { X = Application.GetRealWidth(16), TextSize = CSS_FontSize.SubheadingFontSize, TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.MainColor, Text = rgb.name, }; titleView.AddChidren(btnTitle); #endregion foreach (var series in list) { groupView.AddChidren(new Button { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, }); var rgbColorfulView = new FrameLayout() { Height = Application.GetRealHeight(50), }; groupView.AddChidren(rgbColorfulView); var btnRgbColorfulTitle = new Button() { X = Application.GetRealWidth(16), TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.FirstLevelTitleColor, Text = series.name == rgb.name ? Language.StringByID(StringId.AutomaticColoring) : series.name, }; rgbColorfulView.AddChidren(btnRgbColorfulTitle); var btnColorfulSwitch = new Button() { X = Application.GetRealWidth(320), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(48), Height = Application.GetMinRealAverage(36), UnSelectedImagePath = "Public/Switch.png", SelectedImagePath = "Public/SwitchOn.png", Tag = series.sid, }; rgbColorfulView.AddChidren(btnColorfulSwitch); groupButtons.Add(btnColorfulSwitch); btnColorfulSwitch.MouseUpEventHandler = (sener, e) => { btnColorfulSwitch.IsSelected = !btnColorfulSwitch.IsSelected; var state = btnColorfulSwitch.IsSelected ? "on" : "off"; waitPage.Start(""); new System.Threading.Thread(() => { try { var d = new Dictionary<string, string>(); d.Add("on_off", state); DriverLayer.Control.Ins.SendWriteCommand(series, d); if (state == "on") { Application.RunOnMainThread(() => { List<Button> updataList = new List<Button>(); dicGroupButtons.TryGetValue(((Button)sener).Tag.ToString().Substring(0, 16), out updataList); foreach (var updataTemp in updataList) { updataTemp.IsSelected = false; } btnColorfulSwitch.IsSelected = true; }); } } catch (Exception ex) { MainPage.Log($"序列控制异常:{ex.Message}"); } finally { Application.RunOnMainThread(() => { waitPage.Hide(); }); } }) { IsBackground = true }.Start(); }; } Console.WriteLine("oid: " + oid); dicGroupButtons.TryAdd(oid, groupButtons); functionListView.AddChidren(new Button { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.DividingLineColor, }); } } } } } HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -1112,7 +1112,8 @@ string on_off = GetKeyValue("on_off", dicList); string brightness = GetKeyValue("brightness", dicList); string cct = GetKeyValue(FunctionAttributeKey.CCT, dicList); string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); //自动化组控 炫彩功能 //string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); string rgb = GetKeyValue("rgb", dicList); @@ -1138,19 +1139,18 @@ stateStr += "," + Language.StringByID(StringId.ColorTemperature) + cct + "k"; } if (!string.IsNullOrEmpty(colorful)) { stateStr += "," + Language.StringByID(StringId.ColorfulFunction); if (colorful == "on") { stateStr += Language.StringByID(StringId.onLogic); } else if (colorful == "off") { stateStr += Language.StringByID(StringId.offLogic); } } //if (!string.IsNullOrEmpty(colorful)) //{ // stateStr += "," + Language.StringByID(StringId.ColorfulFunction); // if (colorful == "on") // { // stateStr += Language.StringByID(StringId.onLogic); // } // else if (colorful == "off") // { // stateStr += Language.StringByID(StringId.offLogic); // } //} if (!string.IsNullOrEmpty(rgb) && rgb.Length > 6) { HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -548,10 +548,21 @@ var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); if(perColorful != null) { if(perColorful.value == "on") if (perColorful.value == "on") { sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp); } else sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); { if (sceneFunction.localFunction.spk == SPK.GroupControl) { sceneFunctionInfo += " " + Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); } else { sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); } } } return sceneFunctionInfo; HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -1905,13 +1905,13 @@ if (sceneFunction.localFunction.spk == SPK.LightRGB || sceneFunction.localFunction.spk == SPK.GroupControl) { var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); if (colorfulStatus != null) { isColorful = true; LoadColorfulRow(colorfulStatus); isColorful = colorfulStatus.value == "on"; } //var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); //if (colorfulStatus != null) //{ // isColorful = true; // LoadColorfulRow(colorfulStatus); // isColorful = colorfulStatus.value == "on"; //} } foreach (var attr in sceneFunction.status) { @@ -1982,7 +1982,18 @@ btnConfrim.MouseUpEventHandler = (sender, e) => { if (sceneFunction.localFunction.spk == SPK.GroupControl) { } if (sceneFunction.localFunction.spk == SPK.GroupControl) { var colorBegin = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.ColorfulBegin); if (colorBegin != null) { sceneFunction.status.Remove(colorBegin); } var colorEnd = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.ColorfulEnd); if (colorEnd != null) { sceneFunction.status.Remove(colorEnd); } } else { if (isOnStatus) @@ -3189,7 +3200,33 @@ /// <param name="btn"></param> void LoadEditDialog_CCT(SceneFunctionStatus trait, Button btn) { if (trait.min == 0) { switch (trait.key) { case FunctionAttributeKey.SetTemp: trait.min = 16; break; case FunctionAttributeKey.CCT: trait.min = 2700; break; } } if (trait.max == 0) { switch (trait.key) { case FunctionAttributeKey.SetTemp: trait.max = 30; break; case FunctionAttributeKey.CCT: trait.max = 6500; break; } } double temp = trait.min; double.TryParse(trait.value, out temp); trait.value = temp.ToString(); HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
@@ -115,7 +115,7 @@ { if (pack.Code == StateCode.SUCCESS) { FunctionList.List.groupControls.Remove(groupControl); FunctionList.List.groupControls.Remove(groupControl);//var delTemp = FunctionList.List.groupControls.Find((obj) => groupControl.sid == obj.sid); //list.Remove(groupControl); this.RemoveFromParent(); delAction?.Invoke(); HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -629,7 +629,7 @@ { Y = btnResidenceManageIcon.Bottom, Height = Application.GetRealHeight(29), TextID = StringId.CombinedDimming, TextID = StringId.GroupControl, TextAlignment = TextAlignment.Center, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
@@ -61,7 +61,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.ColorfulSwitch, TextID = StringId.CulorfulTest, }; viewSwitch.AddChidren(btnSwitchText); @@ -271,6 +271,13 @@ }; workHoursView.AddChidren(btnWorkHours); var time = Convert.ToInt32( function.GetAttrState(FunctionAttributeKey.ColorfulTime)); btnWorkHours.Text = time/ 360 + Language.StringByID(StringId.h); btnWorkHours.Text += time / 60 + Language.StringByID(StringId.m); btnWorkHours.Text += time % 60 + Language.StringByID(StringId.s); var waitPage = new Loading(); this.AddChidren(waitPage); @@ -289,7 +296,8 @@ btnWorkHours.Text += minute + "分"; btnWorkHours.Text += second + "秒"; new System.Threading.Thread(() => { System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); var d = new Dictionary<string, string>(); function.SetAttrState(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString()); d.Add(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString()); Control.Ins.SendWriteCommand(function, d); }) { IsBackground = true }.Start(); @@ -309,8 +317,6 @@ btnWorkHours.MouseUpEventHandler = eventHandler; workHoursView.MouseUpEventHandler = eventHandler; btnWorkHoursRight.MouseUpEventHandler = eventHandler; #endregion HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
@@ -1,5 +1,7 @@ using System; using System.Collections.Generic; using HDL_ON.Common; using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; @@ -93,7 +95,7 @@ //回退刷新信息事件 new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView_SettingIcon( () => { new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView_SettingIcon( () => { var page = new AddGroupControlPage(function, (newGC) => { try @@ -116,7 +118,7 @@ try { this.RemoveFromParent(); UI.HomePage.RefreshFunctionView(); UI.HomePage.RefreshGroupControlView(); UI.RoomPage.bodyView?.ReLoadPage(); UI.FunctionPage.bodyView?.ReLoadPage(); } @@ -157,10 +159,12 @@ } } hadRGB = true; hadDimming = true; } else if (temp.spk == SPK.LightCCT) { hadCCT = true; hadDimming = true; } else if (temp.spk == SPK.LightDimming) { @@ -187,25 +191,7 @@ controlView.AddChidren(attrView); attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); if (hadRGB) { hadCCT = true; LoadRgbAttrView(hadCCT,hadColorful); } else if (hadCCT) { LoadCctAttrView(attrView); } else if (hadDimming) { LoadDimmingAttrView(attrView); } var btnSwitch = new Button() btnSwitch = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(466), @@ -233,7 +219,61 @@ }; if (hadRGB) { LoadRgbAttrView(hadCCT,hadColorful); } else if (hadCCT) { LoadCctAttrView(attrView); } else if (hadDimming) { LoadDimmingAttrView(attrView); } else { attrView.AddChidren(new Button() { Height = Application.GetRealHeight(30) }); var btnSwitchIcon = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(102), Width = Application.GetRealWidth(168), Height = Application.GetRealWidth(288), UnSelectedImagePath = "FunctionIcon/Light/RelayBg.png", SelectedImagePath = "FunctionIcon/Light/RelayOnBg.png", IsSelected = function.trait_on_off.curValue.ToString() == "on" }; attrView.AddChidren(btnSwitchIcon); btnSwitchIcon.MouseUpEventHandler = (sender, e) => { if (btnSwitchIcon.IsSelected) { btnSwitchIcon.IsSelected = btnSwitch.IsSelected = false; var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, "off"); function.Control(d); } else { btnSwitchIcon.IsSelected = btnSwitch.IsSelected = true; var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, "on"); function.Control(d); } }; btnSwitch.MouseUpEventHandler += (sender, e) => { btnSwitchIcon.IsSelected = btnSwitch.IsSelected; }; } } Button btnSwitch; /// <summary> /// 加载调光属性设置控件 @@ -241,88 +281,98 @@ /// <param name="attrView"></param> void LoadDimmingAttrView(VerticalScrolViewLayout attrView) { var dimmingView = new FrameLayout() { Height = Application.GetRealHeight(54 + 11) }; attrView.AddChidren(dimmingView); #region 亮度调节 attrView.AddChidren(new Button { Height = Application.GetRealHeight(50), }); var dimmerView = new FrameLayout() { Height = Application.GetRealHeight(280) }; attrView.AddChidren(dimmerView); var dimmerBar = new WaveSeekBarOn() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(168 - 40), Height = Application.GetRealHeight(288 - 16 - 16), BorderColor = 0x00000000, CornerRadius = Application.GetRealWidth(30), BorderWidth = 0, Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)), IsProgressTextShow = false, }; dimmerView.AddChidren(dimmerBar); var btnBrightnessText = new Button() { X = Application.GetRealWidth(35), Y = Application.GetRealHeight(1), Width = Application.GetRealWidth(224), Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.CenterLeft, Gravity = Gravity.CenterHorizontal, Y = ((100 - Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100), Width = Application.GetRealWidth(56), Height = Application.GetRealWidth(46), UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png", TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextID = StringId.Brightness, TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%", }; btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + function.GetAttrState(FunctionAttributeKey.Brightness) + "%"; dimmingView.AddChidren(btnBrightnessText); dimmerView.AddChidren(btnBrightnessText); var btnMinValuesText = new Button() { X = Application.GetRealWidth(35), Y = btnBrightnessText.Bottom, Width = Application.GetRealWidth(40), Height = Application.GetRealHeight(21), Text = "0%", TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, }; dimmingView.AddChidren(btnMinValuesText); var dimmerBar = new DiyImageSeekBar() { X = Application.GetRealWidth(45 + 10), Y = Application.GetRealHeight(11), Width = Application.GetRealWidth(220), Height = Application.GetRealHeight(54), SeekBarViewHeight = Application.GetRealHeight(8), ThumbImagePath = "Public/ThumbImage.png", ThumbImageHeight = Application.GetRealHeight(54), ProgressTextColor = CSS_Color.FirstLevelTitleColor, ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, ProgressBarColor = CSS_Color.AuxiliaryColor1, MaxValue = 100, SeekBarPadding = Application.GetRealWidth(20), IsProgressTextShow = false, ProgressChangeDelayTime = 0, }; dimmingView.AddChidren(dimmerBar); dimmerBar.OnProgressChangedEvent = (sender, e) => { btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%"; }; dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%"; var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, e.ToString()); function.Control(d); }; if (e == 0 && lastBrightness != 0) { btnSwitch.IsSelected = false; lastBrightness = 0; } else { if (lastBrightness == 0) lastBrightness = e; btnSwitch.IsSelected = true; } if (e == 0 || e == 100) { var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, e.ToString()); function.Control(d); } else { if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds) { function.refreshTime = DateTime.Now; new System.Threading.Thread(() => { var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, e.ToString()); function.Control(d); }) { IsBackground = true }.Start(); } } var btnMaxValuesText = new Button() { X = dimmerBar.Right, Y = btnBrightnessText.Bottom, Width = Application.GetRealWidth(55), Height = Application.GetRealHeight(21), Text = "100%", TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; dimmingView.AddChidren(btnMaxValuesText); #endregion btnSwitch.MouseUpEventHandler += (sender, e) => { if (btnSwitch.IsSelected) { dimmerBar.Progress = 100; } else { dimmerBar.Progress = 0; } }; } int lastBrightness = 0; /// <summary> /// 加载cct属性设置控件 @@ -330,6 +380,96 @@ /// <param name="attrView"></param> void LoadCctAttrView(VerticalScrolViewLayout attrView) { attrView.AddChidren(new Button { Height = Application.GetRealHeight(20), }); var dimmerView = new FrameLayout() { Height = Application.GetRealHeight(280) }; attrView.AddChidren(dimmerView); var dimmerBar = new WaveSeekBarOn() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(168 - 40), Height = Application.GetRealHeight(288 - 16 - 16), BorderColor = 0x00000000, CornerRadius = Application.GetRealWidth(30), BorderWidth = 0, Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)), IsProgressTextShow = false, }; dimmerView.AddChidren(dimmerBar); var btnBrightnessText = new Button() { Gravity = Gravity.CenterHorizontal, Y = ((100 - Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100), Width = Application.GetRealWidth(56), Height = Application.GetRealWidth(46), UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png", TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%", }; dimmerView.AddChidren(btnBrightnessText); dimmerBar.OnProgressChangedEvent = (sender, e) => { if (e == 0 && lastBrightness != 0) { btnSwitch.IsSelected = false; lastBrightness = 0; } else { if (lastBrightness == 0) lastBrightness = e; btnSwitch.IsSelected = true; } if (e == 0 || e == 100) { var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, e.ToString()); function.Control(d); } else { if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds) { function.refreshTime = DateTime.Now; new System.Threading.Thread(() => { var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, e.ToString()); function.Control(d); }) { IsBackground = true }.Start(); } } btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; btnSwitch.MouseUpEventHandler += (sender, e) => { if (btnSwitch.IsSelected) { dimmerBar.Progress = 100; } else { dimmerBar.Progress = 0; } }; //attrView.AddChidren(new Button() { Height = Application.GetRealHeight(10) }); #region 色温 var cctView = new FrameLayout() { @@ -385,6 +525,7 @@ Y = Application.GetRealHeight(11), Width = Application.GetRealWidth(220), Height = Application.GetRealHeight(54), Progress = 38, }; barColorTemplatrue.MinValue = 27; barColorTemplatrue.MaxValue = 65; @@ -489,6 +630,52 @@ }; btnWhiteRound.Visible = false; framePickerBack.AddChidren(btnWhiteRound); //当前点击的【点】是否正确 bool pointIsRight = false; //圆的半径(考虑边界,需要设置它的半径比较小一点) int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); string rgbString = "255,255,255"; var rgbTemp = new Light(); colorPicker.MouseUpEventHandler = (sender2, e2) => { var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.RGB, rgbString); function.Control(d); }; colorPicker.ColorChaged += (sender2, e2) => { rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); btnCurColor.BackgroundColor = (uint)(0xFF000000 + rgbTemp.GetRGBcolor(rgbString)); var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.RGB, rgbString); function.Control(d); }; colorPicker.MouseDownEventHandler += (sender, e) => { pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); if (pointIsRight == false) { //点的区域不是圆盘内 return; } //显示白点 btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; if (btnWhiteRound.Visible == false) { btnWhiteRound.Visible = true; } }; colorPicker.MouseMoveEventHandler += (sender, e) => { //当鼠标点下事件处理 colorPicker.MouseDownEventHandler(sender, e); }; #region 亮度调节 var btnBrightnessText = new Button() @@ -668,16 +855,17 @@ }; controlView.AddChidren(btnGradualChangeText); var btnGradualChangeMinValuesText = new Button() var btnColorfulEdit = new Button() { X = Application.GetRealWidth(35), Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), Width = Application.GetRealWidth(22), Height = Application.GetRealHeight(21), UnSelectedImagePath = "Public/Edit.png", Visible = false, }; controlView.AddChidren(btnGradualChangeMinValuesText); btnGradualChangeMinValuesText.MouseUpEventHandler = (sender, e) => { controlView.AddChidren(btnColorfulEdit); btnColorfulEdit.MouseUpEventHandler = (sender, e) => { var rgbView = new ColorfulInfoPage(function); MainPage.BasePageView.AddChidren(rgbView); rgbView.LoadPage(); @@ -686,7 +874,7 @@ var barColorful = new FrameLayout() { X = btnGradualChangeMinValuesText.Right + Application.GetRealWidth(15+5), X = btnColorfulEdit.Right + Application.GetRealWidth(15+5), Y = Application.GetRealHeight(412 + heightMore - magriHeight), Width = Application.GetRealWidth(170), Height = Application.GetRealHeight(8), @@ -694,21 +882,45 @@ }; controlView.AddChidren(barColorful); var btnGradualChangeMaxValuesText = new Button() var btnColorfulSwitch = new Button() { X = barColorful.Right + Application.GetRealWidth(8), Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), Width = Application.GetRealWidth(38), Height = Application.GetRealHeight(24), UnSelectedImagePath = "Public/Switch.png" UnSelectedImagePath = "Public/Switch.png", SelectedImagePath = "Public/SwitchOn.png" }; controlView.AddChidren(btnGradualChangeMaxValuesText); controlView.AddChidren(btnColorfulSwitch); btnColorfulSwitch.MouseUpEventHandler = (sender, e) => { btnColorfulSwitch.IsSelected = !btnColorfulSwitch.IsSelected; new System.Threading.Thread(() => { try { var controlColorfulState = btnColorfulSwitch.IsSelected ? "on" : "off"; function.SetAttrState(FunctionAttributeKey.Colorful, controlColorfulState); var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.Colorful, controlColorfulState); Control.Ins.SendWriteCommand(function, d); } catch (Exception ex) { MainPage.Log($"控制炫彩开关异常:{ex.Message}"); } }) { IsBackground = true }.Start(); }; #endregion } } @@ -742,5 +954,9 @@ return false; } } }