From 392f7271abdee3e219fb5e407e813bb16ba95a28 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 27 四月 2023 09:49:14 +0800 Subject: [PATCH] 添加成员闪退问题修复 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL-ON_iOS/Info.plist | 4 HDL_ON/DAL/DriverLayer/UdpSocket.cs | 6 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPage.cs | 2 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs | 272 ++++++++++++++++++++--------------------------------- HDL-ON_Android/Application.cs | 1 6 files changed, 113 insertions(+), 174 deletions(-) diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs index c5b0a2c..92b09ce 100644 --- a/HDL-ON_Android/Application.cs +++ b/HDL-ON_Android/Application.cs @@ -25,6 +25,7 @@ [Android.App.Application(Theme = "@style/MyTheme")] public class Application : Android.App.Application, Android.App.Application.IActivityLifecycleCallbacks { + //澶勭悊瀹夊崜鎺ユ敹涓嶅埌udp鍛戒护闂 WifiManager.MulticastLock multicast; static void reStartApp(Android.App.Application application) diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index 5a7aae1..ea9a9b1 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-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.7.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202304251"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202304261"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!--鍙嬬洘--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 68ad9fc..20da19f 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -11,7 +11,7 @@ <key>CFBundleName</key> <string>On Pro</string> <key>CFBundleShortVersionString</key> - <string>1.7.1</string> + <string>1.7.2</string> <key>CFBundleURLTypes</key> <array> <dict> @@ -36,7 +36,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>1.7.1</string> + <string>1.7.2</string> <key>LSApplicationQueriesSchemes</key> <array> <string>weixinULAPI</string> diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs index f0893ff..f454bf1 100644 --- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs +++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs @@ -50,8 +50,10 @@ busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188"))); } - catch{ - busSocket = null; + catch (Exception ex){ + MainPage.Log ($"udp port bind error : {ex.Message}"); + + busSocket = null; return; } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs index 7c88b59..8704a24 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs @@ -36,81 +36,83 @@ bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; new TopViewDiv(bodyView, Language.StringByID(StringId.AddMember)).LoadTopView(); + var btnMemberName = new Button() + { + Y = Application.GetRealHeight(70), + X = Application.GetRealWidth(16), + Height = Application.GetRealHeight(32), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.MemberName, + }; + bodyView.AddChidren(btnMemberName); + + etMemberName = new EditText() + { + Y = btnMemberName.Bottom, + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(356), + Height = Application.GetRealHeight(40), + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextAlignment = TextAlignment.CenterLeft, + PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), + PlaceholderTextColor = CSS_Color.PromptingColor2 + }; + bodyView.AddChidren(etMemberName); + + var btnLine = new Button() + { + Y = etMemberName.Bottom, + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.DividingLineColor, + }; + bodyView.AddChidren(btnLine); + + + var btnTitle = new Button() + { + Y = btnLine.Bottom + Application.GetRealHeight(20), + X = Application.GetRealWidth(16), + Height = Application.GetRealHeight(32), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.MemberAccount, + }; + bodyView.AddChidren(btnTitle); + + etMemberAccount = new EditText() + { + Y = btnTitle.Bottom, + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(356), + Height = Application.GetRealHeight(40), + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextAlignment = TextAlignment.CenterLeft, + PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), + PlaceholderTextColor = CSS_Color.PromptingColor2 + }; + bodyView.AddChidren(etMemberAccount); + + var btnLine1 = new Button() + { + Y = etMemberAccount.Bottom, + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.DividingLineColor, + }; + bodyView.AddChidren(btnLine1); + + int btnAddmemberY = 30; if (Entity.DB_ResidenceData.Instance.SupportFacePass) { - var btnMemberName = new Button() - { - Y = Application.GetRealHeight(70), - X = Application.GetRealWidth(16), - Height = Application.GetRealHeight(32), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.CenterLeft, - TextID = StringId.MemberName, - }; - bodyView.AddChidren(btnMemberName); - - etMemberName = new EditText() - { - Y = btnMemberName.Bottom, - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(356), - Height = Application.GetRealHeight(40), - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.CenterLeft, - PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), - PlaceholderTextColor = CSS_Color.PromptingColor2 - }; - bodyView.AddChidren(etMemberName); - - var btnLine = new Button() - { - Y = etMemberName.Bottom, - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.DividingLineColor, - }; - bodyView.AddChidren(btnLine); - - - var btnTitle = new Button() - { - Y = btnLine.Bottom + Application.GetRealHeight(20), - X = Application.GetRealWidth(16), - Height = Application.GetRealHeight(32), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.CenterLeft, - TextID = StringId.MemberAccount, - }; - bodyView.AddChidren(btnTitle); - - etMemberAccount = new EditText() - { - Y = btnTitle.Bottom, - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(356), - Height = Application.GetRealHeight(40), - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.CenterLeft, - PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), - PlaceholderTextColor = CSS_Color.PromptingColor2 - }; - bodyView.AddChidren(etMemberAccount); - - var btnLine1 = new Button() - { - Y = etMemberAccount.Bottom, - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.DividingLineColor, - }; - bodyView.AddChidren(btnLine1); - + btnAddmemberY = 203; #region 浜鸿劯绠$悊 var btnMemberFaceTitle = new Button() { @@ -190,7 +192,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID =StringId.FaceProTipText1, + TextID = StringId.FaceProTipText1, IsMoreLines = true, }; contentView.AddChidren(btnMsg); @@ -281,7 +283,8 @@ dialog.Close(); }; - btnConfirm.MouseUpEventHandler = (sender2, e2) => { + btnConfirm.MouseUpEventHandler = (sender2, e2) => + { dialog.Close(); OnAppConfig.Instance.FaceManagementTip = true; OnAppConfig.Instance.SaveConfig(); @@ -292,104 +295,37 @@ btnAddFace.MouseUpEventHandler = eFaceHandler; #endregion - - btnAddMember = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = btnAddFace.Bottom + Application.GetRealHeight(30), - Width = Application.GetRealWidth(220), - Height = Application.GetRealWidth(44), - Radius = (uint)Application.GetRealWidth(22), - BorderWidth = 0, - BorderColor = 0x00000000, - BackgroundColor = CSS_Color.MainColor, - TextColor = CSS_Color.MainBackgroundColor, - TextSize = CSS_FontSize.SubheadingFontSize, - IsBold = true, - TextAlignment = TextAlignment.Center, - TextID = StringId.Confirm, - }; - bodyView.AddChidren(btnAddMember); - - - btnScan = new Button() - { - Y = btnTitle.Bottom, - Width = Application.GetRealWidth(40), - Height = Application.GetRealWidth(40), - X = Application.GetRealWidth(310), - UnSelectedImagePath = "Public/Scan.png" - }; - bodyView.AddChidren(btnScan); - } - else + + btnAddMember = new Button() { - var btnTitle2 = new Button() - { - Y = Application.GetRealHeight(70), - X = Application.GetRealWidth(16), - Height = Application.GetRealHeight(32), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.CenterLeft, - TextID = StringId.NewMemberAccount, - }; - bodyView.AddChidren(btnTitle2); + Gravity = Gravity.CenterHorizontal, + Y = btnLine1.Bottom + Application.GetRealHeight(btnAddmemberY), + Width = Application.GetRealWidth(220), + Height = Application.GetRealWidth(44), + Radius = (uint)Application.GetRealWidth(22), + BorderWidth = 0, + BorderColor = 0x00000000, + BackgroundColor = CSS_Color.MainColor, + TextColor = CSS_Color.MainBackgroundColor, + TextSize = CSS_FontSize.SubheadingFontSize, + IsBold = true, + TextAlignment = TextAlignment.Center, + TextID = StringId.Confirm, + }; + bodyView.AddChidren(btnAddMember); - etMemberAccount = new EditText() - { - Y = btnTitle2.Bottom, - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(356), - Height = Application.GetRealHeight(40), - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.CenterLeft, - PlaceholderText = Language.StringByID(StringId.PleaseEnterContent), - PlaceholderTextColor = CSS_Color.PromptingColor2 - }; - bodyView.AddChidren(etMemberAccount); - var btnLine = new Button() - { - Y = etMemberAccount.Bottom, - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.DividingLineColor, - }; - bodyView.AddChidren(btnLine); + btnScan = new Button() + { + Y = btnTitle.Bottom, + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(40), + X = Application.GetRealWidth(310), + UnSelectedImagePath = "Public/Scan.png" + }; + bodyView.AddChidren(btnScan); - btnAddMember = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(244), - Width = Application.GetRealWidth(220), - Height = Application.GetRealWidth(44), - Radius = (uint)Application.GetRealWidth(22), - BorderWidth = 0, - BorderColor = 0x00000000, - BackgroundColor = CSS_Color.MainColor, - TextColor = CSS_Color.MainBackgroundColor, - TextSize = CSS_FontSize.SubheadingFontSize, - IsBold = true, - TextAlignment = TextAlignment.Center, - TextID = StringId.Confirm, - }; - bodyView.AddChidren(btnAddMember); - - btnScan = new Button() - { - Y = btnAddMember.Bottom, - Height = Application.GetRealHeight(44), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.TextFontSize, - TextID = StringId.ScanQRCoden, - }; - bodyView.AddChidren(btnScan); - } LoadEventList(); } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPage.cs index 1eb0921..4cad50b 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPage.cs @@ -30,7 +30,7 @@ public void LoadPage() { #if DEBUG - Entity.DB_ResidenceData.Instance.SupportFacePass = true; + //Entity.DB_ResidenceData.Instance.SupportFacePass = true; #endif bodyView.BackgroundColor = CSS_Color.BackgroundColor; //鍒涘缓璇诲彇鎴愬憳璐﹀彿绾跨▼ -- Gitblit v1.8.0