HDL-ON_Android/AgreementActivity.cs
@@ -6,13 +6,7 @@ using Android.OS; using CN.Jpush.Android.Api; //using Android.Widget; using Com.Hdl.ON.Jpush.Androidjpush; using HDL_ON; using Java.Util; using Microsoft.AppCenter; using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; using Shared; namespace HDL_ON_Android HDL-ON_Android/Application.cs
@@ -12,9 +12,6 @@ using CN.Jpush.Android.Api; using HDL_ON; using Java.Util; using Microsoft.AppCenter; using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; using Shared; namespace HDL_ON_Android HDL-ON_Android/HDL-ON_Android.csproj
@@ -163,9 +163,6 @@ <Reference Include="videophone"> <HintPath>..\DLL\FL\Android\videophone.dll</HintPath> </Reference> <Reference Include="UMSdkDroid"> <HintPath>..\DLL\UMeng\UMSdkDroid.dll</HintPath> </Reference> <Reference Include="Shared.Droid.HDLLinphone"> <HintPath>..\DLL\Linphone\Android\Shared.Droid.HDLLinphone.dll</HintPath> </Reference> @@ -196,6 +193,9 @@ </Reference> <Reference Include="HdlEzvizDroid"> <HintPath>..\DLL\HdlEzvizDroid.dll</HintPath> </Reference> <Reference Include="UMSdkDroid"> <HintPath>..\DLL\UMeng\UMSdkDroid.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> @@ -783,7 +783,6 @@ <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> <PackageReference Include="Xamarin.Android.Support.v4"> <Version>28.0.0.3</Version> </PackageReference> @@ -804,15 +803,6 @@ </PackageReference> <PackageReference Include="Xamarin.Android.Support.Constraint.Layout.Solver"> <Version>1.1.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Crashes"> <Version>4.2.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> <Version>4.2.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter"> <Version>4.2.0</Version> </PackageReference> <PackageReference Include="Square.OkHttp3"> <Version>3.14.4</Version> @@ -1674,6 +1664,11 @@ <Folder Include="Assets\Phone\FunctionIcon\Inverter\" /> <Folder Include="Assets\Phone\FunctionIcon\Electrical\MechanicalArm\" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\AliyuLog\AliyuLog.csproj"> <Name>AliyuLog</Name> </ProjectReference> </ItemGroup> <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. HDL-ON_Android/Other/LocationUtils.cs
@@ -1,25 +1,25 @@ using System; using System.Threading.Tasks; using Xamarin.Essentials; //using System; //using System.Threading.Tasks; //using Xamarin.Essentials; namespace HDL_ON_Android { public static class LocationUtils { public static async Task<Location> GetCurrentLocationAsync() { try { var request = new GeolocationRequest(GeolocationAccuracy.Medium); var location = await Geolocation.GetLocationAsync(request); return location; } catch (Exception ex) { // 处理异常 Console.WriteLine($"获取位置信息失败: {ex.Message}"); return null; } } } } //namespace HDL_ON_Android //{ // public static class LocationUtils // { // public static async Task<Location> GetCurrentLocationAsync() // { // try // { // var request = new GeolocationRequest(GeolocationAccuracy.Medium); // var location = await Geolocation.GetLocationAsync(request); // return location; // } // catch (Exception ex) // { // // 处理异常 // Console.WriteLine($"获取位置信息失败: {ex.Message}"); // return null; // } // } // } //} HDL-ON_Android/Resources/Resource.designer.cs
@@ -15,7 +15,7 @@ { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.1.111")] public partial class Resource { HDL-ON_Android/SplashActivity.cs
@@ -13,9 +13,6 @@ using Com.Hdl.ON.Jpush.Androidjpush; using HDL_ON; using Java.Util; using Microsoft.AppCenter; using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; using Shared; namespace HDL_ON_Android @@ -26,6 +23,7 @@ { protected override void OnActivityResult(int requestCode, Result resultVal, Intent data) { Console.WriteLine("123456"); if (requestCode == 99) { if (resultVal == Result.Ok) @@ -48,6 +46,7 @@ [Obsolete] protected override void OnCreate(Bundle savedInstanceState) { Console.WriteLine("123456"); base.OnCreate(savedInstanceState); if(Shared.Application.Activity != null && Shared.Application.Activity.GetType() == typeof(BaseActivity)) @@ -126,7 +125,7 @@ void initOhterSdk() { //注册未处理异常事件 AppCenter.Start("64ac5859-2cd7-4ef8-a5da-5455e29679ec", typeof(Analytics), typeof(Crashes)); //AppCenter.Start("64ac5859-2cd7-4ef8-a5da-5455e29679ec", typeof(Analytics), typeof(Crashes)); //手机名称 Android.OS.Build.Manufacturer; //OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; //#if DEBUG @@ -144,10 +143,17 @@ }; try { //初始化友盟sdk Com.Hdl.Umsdk.UmSdk.InitUmSdk(this, "61d565d9e0f9bb492bbc3d5a", "Android"); //初始化友盟sdk config ////初始化友盟sdk config Com.Hdl.Umsdk.UmSdk.InitUMConfigure(this, "61d565d9e0f9bb492bbc3d5a", "Android", ""); } catch (Exception ex) { Console.WriteLine("初始化友盟SDK异常:" + ex.Message); } } HDL-ON_iOS/AppDelegate.cs
@@ -343,6 +343,14 @@ //{ // //RemoteInfo.Current.ReadMsgList(true); //} try { UMSdk.HDLUMSDK.InitUMSDKWithAppKey("61d56642e0f9bb492bbc3e72", "IOS"); } catch(Exception ex) { Console.WriteLine("启动友盟SDK异常:"+ex.Message); } Console.WriteLine("FinishedLaunching"); return true; HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -125,12 +125,6 @@ <PackageReference Include="MQTTnet"> <Version>3.1.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> <Version>4.4.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Crashes"> <Version>4.4.0</Version> </PackageReference> <PackageReference Include="ZXing.Net.Mobile"> <Version>2.4.1</Version> </PackageReference> @@ -1661,6 +1655,10 @@ <Project>{2DDF4C3C-6998-432E-9F43-6786D82F0630}</Project> <Name>Blufi</Name> </ProjectReference> <ProjectReference Include="..\UMSdk\UMSdk.csproj"> <Project>{5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}</Project> <Name>UMSdk</Name> </ProjectReference> </ItemGroup> <ItemGroup> <Content Include="Base.lproj\Intents.intentdefinition" /> HDL_ON/DAL/DriverLayer/Control.cs
@@ -536,7 +536,7 @@ var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, resend); MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}"); Ins.myTcpClient.SendMessage(sendBytes); //Ins.myTcpClient.SendMessage(sendBytes); } } //远程通讯 @@ -1012,7 +1012,7 @@ if (receiveObj.Topic == CommunicationTopic.ct.HeartBeat + "_reply") { Ins.myTcpClient.ClearHeartBeatLog(); //Ins.myTcpClient.ClearHeartBeatLog(); MainPage.Log("tcp心跳回复"); return null; } HDL_ON/Entity/Function/Function.cs
@@ -888,13 +888,13 @@ var tt = GetAttribute(FunctionAttributeKey.TempType); if (tt == null) { attr.unit = "°"; attr.unit = "°C"; } else { if (tt.unit == string.Empty) { attr.unit = "°"; attr.unit = "°C"; } else { HDL_ON/Entity/Function/Scene.cs
@@ -726,7 +726,7 @@ { case FunctionAttributeKey.SetTemp: case FunctionAttributeKey.RoomTemp: us = "°"; us = "°C"; break; case FunctionAttributeKey.Percent: case FunctionAttributeKey.Brightness: HDL_ON/UI/MainPage.cs
@@ -231,36 +231,36 @@ } #if __ANDROID__ new System.Threading.Thread(async () => { int i = 10; while (i < 10) { try { var location_android = await HDL_ON_Android.LocationUtils.GetCurrentLocationAsync(); if (location_android != null) { MainPage.cityInfo.lat = location_android.Latitude.ToString(); MainPage.cityInfo.lon = location_android.Longitude.ToString(); new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(MainPage.cityInfo.lon.Replace(",", "."), MainPage.cityInfo.lat.ToString().Replace(",", ".")); i = 100; Application.RunOnMainThread(() => { HomePage.LoadEvent_RefreshAir(); }); } else { i++; } } catch (Exception ex) { Log($"经纬度获取异常: {ex.Message}"); } } }) { IsBackground = true }.Start(); #endif //#if __ANDROID__ // new System.Threading.Thread(async () => // { // int i = 10; // while (i < 10) { // try // { // var location_android = await HDL_ON_Android.LocationUtils.GetCurrentLocationAsync(); // if (location_android != null) // { // MainPage.cityInfo.lat = location_android.Latitude.ToString(); // MainPage.cityInfo.lon = location_android.Longitude.ToString(); // new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(MainPage.cityInfo.lon.Replace(",", "."), MainPage.cityInfo.lat.ToString().Replace(",", ".")); // i = 100; // Application.RunOnMainThread(() => { // HomePage.LoadEvent_RefreshAir(); // }); // } // else // { // i++; // } // } catch (Exception ex) // { // Log($"经纬度获取异常: {ex.Message}"); // } // } // }) // { IsBackground = true }.Start(); //#endif } /// <summary> HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
@@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Threading; using HDL_ON.DAL.Server; #if DEBUG using Xamarin.Essentials; #endif //#if DEBUG //using Xamarin.Essentials; //#endif namespace HDL_ON.UI { /// <summary> @@ -124,10 +124,10 @@ //测试提前当前推送ID allMenuButton.ImageButton.MouseLongEventHandler = (sender, e) => { #if DEBUG //#if DEBUG CopyToClipboard("推送ID:" + OnAppConfig.Instance.PushId); #else // CopyToClipboard("推送ID:" + OnAppConfig.Instance.PushId); //#else //检测是否获取推送ID成功,提示推送注册是否正常 if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) { @@ -137,7 +137,7 @@ { Utlis.ShowTip(Language.StringByID(StringId.PushNormal)); } #endif //#endif }; #endregion @@ -864,18 +864,18 @@ HDLCommon.GetPushMessageAction = null; } #if DEBUG //#if DEBUG /// <summary> /// 复制到剪切板 /// </summary> /// <param name="text"></param> void CopyToClipboard(string text) { Clipboard.SetTextAsync(text); Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); } #endif // /// <summary> // /// 复制到剪切板 // /// </summary> // /// <param name="text"></param> // void CopyToClipboard(string text) // { // Clipboard.SetTextAsync(text); // Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); // } //#endif } HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/ComplaintsPage.cs
@@ -1,7 +1,7 @@ using System; using Shared; using HDL_ON.UI.CSS; using Xamarin.Essentials; //using Xamarin.Essentials; namespace HDL_ON.UI { @@ -78,14 +78,14 @@ phoneRow.AddChidren(btnImage); phoneRow.AddChidren(new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealWidth(49), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); EventHandler<MouseEventArgs> eventHandler = (sender, e) => { PhoneDialer.Open(Constant.SUPPORT_TELEPHONENUMBER); }; //EventHandler<MouseEventArgs> eventHandler = (sender, e) => //{ // PhoneDialer.Open(Constant.SUPPORT_TELEPHONENUMBER); //}; phoneRow.MouseUpEventHandler = eventHandler; btnPhoneText.MouseUpEventHandler = eventHandler; btnImage.MouseUpEventHandler = eventHandler; //phoneRow.MouseUpEventHandler = eventHandler; //btnPhoneText.MouseUpEventHandler = eventHandler; //btnImage.MouseUpEventHandler = eventHandler; #endregion #region 联系邮箱 @@ -174,8 +174,8 @@ /// <param name="text"></param> void CopyToClipboard(string text) { Clipboard.SetTextAsync(text); Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); //Clipboard.SetTextAsync(text); //Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); } } HDL_ON/UI/UI2/4-PersonalCenter/CancelAccountPage.cs
@@ -1,7 +1,7 @@ using System; using Shared; using HDL_ON.UI.CSS; using Xamarin.Essentials; //using Xamarin.Essentials; using HDL_ON.DAL.Server; namespace HDL_ON.UI @@ -355,14 +355,14 @@ phoneRow.AddChidren(btnImage); phoneRow.AddChidren(new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealWidth(49), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); EventHandler<MouseEventArgs> eventHandler = (sender, e) => { PhoneDialer.Open(Constant.SUPPORT_TELEPHONENUMBER); }; //EventHandler<MouseEventArgs> eventHandler = (sender, e) => //{ // PhoneDialer.Open(Constant.SUPPORT_TELEPHONENUMBER); //}; phoneRow.MouseUpEventHandler = eventHandler; btnPhoneText.MouseUpEventHandler = eventHandler; btnImage.MouseUpEventHandler = eventHandler; //phoneRow.MouseUpEventHandler = eventHandler; //btnPhoneText.MouseUpEventHandler = eventHandler; //btnImage.MouseUpEventHandler = eventHandler; #endregion #region 联系邮箱 @@ -451,8 +451,8 @@ /// <param name="text"></param> void CopyToClipboard(string text) { Clipboard.SetTextAsync(text); Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); //Clipboard.SetTextAsync(text); //Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); } HDL_ON/UI/UI2/4-PersonalCenter/SearchDevice/VoicePanelSceneListPage.cs
@@ -61,7 +61,7 @@ DriverLayer.Control.Ins.reportIp = device.ip_address; //DriverLayer.Control.ins.OpenTcpClent(); DriverLayer.Control.Ins.myTcpClient.ReceiveEvent = ReceiveEvent; //DriverLayer.Control.Ins.myTcpClient.ReceiveEvent = ReceiveEvent; contentView = new VerticalRefreshLayout() { @@ -180,7 +180,7 @@ var sendJson = JsonConvert.SerializeObject(sendingObject); var sendBytes = System.Text.Encoding.ASCII.GetBytes(sendJson); DriverLayer.Control.Ins.myTcpClient.SendMessage(sendBytes); //DriverLayer.Control.Ins.myTcpClient.SendMessage(sendBytes); } /// <summary> HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs
@@ -158,7 +158,7 @@ Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), BackgroundColor = 0xFF00ab11, BackgroundColor = 0xFFFEF267, Radius = (uint)Application.GetRealWidth(14), }; recommendColorView.AddChidren(btnRecommenColor3); @@ -170,7 +170,7 @@ Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), BackgroundColor = 0xFF28952e, BackgroundColor = 0xFF73FD7B, Radius = (uint)Application.GetRealWidth(14), }; recommendColorView.AddChidren(btnRecommenColor4); @@ -181,7 +181,7 @@ Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), BackgroundColor = 0xFF45b7fd, BackgroundColor = 0xFF45B7FD, Radius = (uint)Application.GetRealWidth(14), }; recommendColorView.AddChidren(btnRecommenColor5); @@ -193,7 +193,7 @@ Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), BackgroundColor = 0xFF794efc, BackgroundColor = 0xFF5558fd, Radius = (uint)Application.GetRealWidth(14), }; recommendColorView.AddChidren(btnRecommenColor6); @@ -204,7 +204,7 @@ Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth(28), Height = Application.GetRealWidth(28), BackgroundColor = 0xFFFFFFFF, BackgroundColor = 0xFF962eff, Radius = (uint)Application.GetRealWidth(14), }; recommendColorView.AddChidren(btnRecommenColor7); @@ -387,17 +387,17 @@ }; btnRecommenColor3.MouseUpEventHandler = (sender, e) => { curColor = btnCurColor.BackgroundColor = btnRecommenColor3.BackgroundColor; etCurColorHexInfo.Text = "00AB11"; redColor = 0; greenColor = 171; blueColor = 17; etCurColorHexInfo.Text = "FEF267"; redColor = 254; greenColor = 242; blueColor = 103; }; btnRecommenColor4.MouseUpEventHandler = (sender, e) => { curColor = btnCurColor.BackgroundColor = btnRecommenColor4.BackgroundColor; etCurColorHexInfo.Text = "28952E"; redColor = 40; greenColor = 149; blueColor = 46; etCurColorHexInfo.Text = "73FD7B"; redColor = 115; greenColor = 253; blueColor = 123; }; btnRecommenColor5.MouseUpEventHandler = (sender, e) => { curColor = btnCurColor.BackgroundColor = btnRecommenColor5.BackgroundColor; @@ -408,16 +408,16 @@ }; btnRecommenColor6.MouseUpEventHandler = (sender, e) => { curColor = btnCurColor.BackgroundColor = btnRecommenColor6.BackgroundColor; etCurColorHexInfo.Text = "794EFC"; redColor = 121; greenColor = 78; blueColor = 252; etCurColorHexInfo.Text = "5558fd"; redColor = 85; greenColor = 88; blueColor = 253; }; btnRecommenColor7.MouseUpEventHandler = (sender, e) => { curColor = btnCurColor.BackgroundColor = btnRecommenColor7.BackgroundColor; etCurColorHexInfo.Text = "FFFFFF"; redColor = 255; greenColor = 255; etCurColorHexInfo.Text = "962eff"; redColor = 150; greenColor = 26; blueColor = 255; }; }