From 1a0a7f736c6d2e7129e7591d40bed67ec7c0f09a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 05 二月 2021 10:47:42 +0800
Subject: [PATCH] 2021-02-05 1.编译冲突修改
---
HDL-ON_iOS/ViewController.cs | 78 +++++++++++++++++++++++++++-----------
1 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/HDL-ON_iOS/ViewController.cs b/HDL-ON_iOS/ViewController.cs
index 2dc82cb..c4016d2 100644
--- a/HDL-ON_iOS/ViewController.cs
+++ b/HDL-ON_iOS/ViewController.cs
@@ -2,6 +2,7 @@
using CoreLocation;
using Foundation;
using HDL_ON;
+using HDL_ON.DriverLayer;
using Shared;
using UIKit;
@@ -9,6 +10,18 @@
{
public partial class ViewController : ViewControllerBase
{
+
+ public override void ViewWillAppear(bool animated)
+ {
+ base.ViewWillAppear(animated);
+ //2021-02-01 璁剧疆NavigationBarHidden true
+ if (this.NavigationController != null)
+ {
+ this.NavigationController.NavigationBar.Hidden = true;
+ this.NavigationController.NavigationBar.TintColor = UIColor.Black;
+ }
+ }
+
public override void ViewDidLoad()
{
base.ViewDidLoad();
@@ -33,18 +46,31 @@
{
Language.CurrentLanguage = OnAppConfig.Instance.SetLanguage;
}
+#if DEBUG
+ Language.CurrentLanguage = "English";
+#endif
HDL_ON.MainPage.Show();
- //渚︽祴缃戠粶鍙樺寲
- Reachability.ReachabilityChanged += UpdateStatus;
+ try
+ {
+ //渚︽祴缃戠粶鍙樺寲
+ Reachability.ReachabilityChanged += UpdateStatus;
- UITapGestureRecognizer oTapRecognizer = new UITapGestureRecognizer();
- oTapRecognizer.CancelsTouchesInView = false;
- oTapRecognizer.AddTarget(
- this,
- new ObjCRuntime.Selector("ViewTappedSelector:")
- );
- this.View.AddGestureRecognizer(oTapRecognizer);
+ UITapGestureRecognizer oTapRecognizer = new UITapGestureRecognizer();
+ oTapRecognizer.CancelsTouchesInView = false;
+ oTapRecognizer.AddTarget(
+ this,
+ new ObjCRuntime.Selector("ViewTappedSelector:")
+ );
+ this.View.AddGestureRecognizer(oTapRecognizer);
+ MainPage.InternetStatus = (int)Reachability.InternetConnectionStatus();
+ //HDLCommon.Current.UpdateInternetStatus((int)Reachability.InternetConnectionStatus(), SharedMethod.SharedMethod.IsBackground);
+ }
+ catch
+ {
+
+ }
+
}
public override UIStatusBarStyle PreferredStatusBarStyle()
{
@@ -72,20 +98,26 @@
void UpdateStatus(object sender, EventArgs e)
{
internetStatus = Reachability.InternetConnectionStatus();
- if (internetStatus == NetworkStatus.NotReachable)//娌℃湁缃戠粶杩炴帴 0
- {
- }
- else if (internetStatus == NetworkStatus.ReachableViaCarrierDataNetwork)//3,4G鐨勭綉缁滆繛鎺� 1
- {
- }
- else if (internetStatus == NetworkStatus.ReachableViaWiFiNetwork)
- { //wifi鐨勭綉缁滆繛鎺� 2
- BusSocket.Stop();
- new System.Threading.Thread(() => {
- System.Threading.Thread.Sleep(1000);
- BusSocket.Start(6000);
- }) { IsBackground = true }.Start();
- }
+ //MainPage.Log($"缃戠粶鐘舵�佸彉鍖栵紝褰撳墠缃戠粶:{internetStatus}");
+ //缃戠粶鍙樺寲澶勭悊
+ HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground);
+
+ //if (internetStatus == NetworkStatus.NotReachable)//娌℃湁缃戠粶杩炴帴 0
+ //{
+ // Control.Ins.GatewayOnline = false;
+ // Control.Ins.IsRemote = false;
+ // MainPage.InternetStatus = 0;
+ //}
+ //else if (internetStatus == NetworkStatus.ReachableViaCarrierDataNetwork)//3,4G鐨勭綉缁滆繛鎺� 1
+ //{
+ // Control.Ins.SearchLoaclGateway();
+ // MainPage.InternetStatus = 1;
+ //}
+ //else if (internetStatus == NetworkStatus.ReachableViaWiFiNetwork)
+ //{
+ // Control.Ins.SearchLoaclGateway();
+ // MainPage.InternetStatus = 2;
+ //}
}
}
}
\ No newline at end of file
--
Gitblit v1.8.0