| | |
| | | |
| | | BaseActivity.BackKeyAction = () => { |
| | | if (Shared.SimpleControl.MainPage.Loading != null) { |
| | | Console.WriteLine (MainPage.Loading.CurStatus); |
| | | Utlis.WriteLine (MainPage.Loading.CurStatus); |
| | | if (Shared.SimpleControl.MainPage.Loading.CurStatus) { |
| | | Shared.SimpleControl.MainPage.Loading.Hide (); |
| | | return; |
| | |
| | | //if(BaseActivity.VerifyDateTime == DateTime.MaxValue) { } else |
| | | try { |
| | | var lastView = Shared.Application.MainPage.GetChildren (Shared.Application.MainPage.ChildrenCount - 1); |
| | | Console.WriteLine ("lastView " + lastView); |
| | | Utlis.WriteLine ("lastView " + lastView); |
| | | if (MainPage.Loading.CurStatus) { |
| | | return; |
| | | } |
| | |
| | | BaseActivity.VerifyDateTime = DateTime.MaxValue; |
| | | return; |
| | | } else { |
| | | Console.WriteLine ("Remove Dialog!!!!"); |
| | | Utlis.WriteLine ("Remove Dialog!!!!"); |
| | | var lastView2 = Shared.Application.MainPage.GetChildren (Shared.Application.MainPage.ChildrenCount - 2); |
| | | lastView.RemoveFromParent (); |
| | | lastView2.RemoveFromParent (); |
| | | Console.WriteLine ("Remove Dialog End!!!!"); |
| | | Utlis.WriteLine ("Remove Dialog End!!!!"); |
| | | BaseActivity.VerifyDateTime = DateTime.MinValue; |
| | | return; |
| | | } |
| | | } |
| | | } catch (System.Exception ezx) { |
| | | Console.WriteLine (ezx.Message); |
| | | Utlis.WriteLine (ezx.Message); |
| | | } |
| | | if (SharedMethod.SharedMethod.CurPageLayout != null) { |
| | | if (SharedMethod.SharedMethod.CurPageLayout.ChildrenCount > 1) { |
| | | Console.WriteLine ("Remove PageLayout Children!!!!"); |
| | | Utlis.WriteLine ("Remove PageLayout Children!!!!"); |
| | | SharedMethod.SharedMethod.CurPageLayout.GetChildren (SharedMethod.SharedMethod.CurPageLayout.ChildrenCount - 1).RemoveFromParent (); |
| | | Console.WriteLine ("Remove PageLayout Children End!!!!"); |
| | | Utlis.WriteLine ("Remove PageLayout Children End!!!!"); |
| | | BaseActivity.VerifyDateTime = DateTime.MinValue; |
| | | } else { |
| | | Console.WriteLine ("BaseActivity.VerifyDateTime = DateTime.MaxValue"); |
| | | Utlis.WriteLine ("BaseActivity.VerifyDateTime = DateTime.MaxValue"); |
| | | BaseActivity.VerifyDateTime = DateTime.MaxValue; |
| | | } |
| | | } |
| | |
| | | UserConfig.Instance.SaveUserConfig (); |
| | | } |
| | | BaseActivity.NetworkStateChanged += (int obj) => { |
| | | Console.WriteLine ("NetworkStateChanged " + obj); |
| | | Utlis.WriteLine ("NetworkStateChanged " + obj); |
| | | UserConfig.Instance.internetStatus = obj; |
| | | UserConfig.Instance.SaveUserConfig (); |
| | | EquipmentPublicClass.CheckLinkRemote (obj); |
| | | //网络变化通知 |
| | | EquipmentPublicClass.CheckLinkRemote (obj, false); |
| | | }; |
| | | }; |
| | | BaseActivity.RefreshUIAction += (activity) => { |
| | |
| | | BaseActivity.OnDestroyAction += (activity) => { |
| | | BusSocket.Stop (); |
| | | }; |
| | | HDLUtils.SetAuthoritiesName ("com.hdl.crabtreenew.fileProvider"); |
| | | } |
| | | public static bool IsShowTip = true; |
| | | void init () |
| | |
| | | JPushInterface.Init (this);//保存手机名称到本地文件 |
| | | //获取经纬度 |
| | | Shared.Application.LocationAction = (arg1, arg2) => { |
| | | Shared.Application.LocationAction = null; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | while (true) { |
| | | try { |
| | | Shared.SimpleControl.CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality (arg2.ToString (), arg1.ToString ()); |
| | | if (Shared.SimpleControl.CommonPage.AirQuality != null) |
| | | break; |
| | | } catch { } |
| | | } |
| | | Shared.Application.RunOnMainThread (() => { |
| | | if (CommonPage.RefreshAir != null) |
| | | CommonPage.RefreshAir (); |
| | | |
| | | try { |
| | | Shared.Application.LocationAction = null; |
| | | Shared.Application.StopGPSLocationService (); |
| | | |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | while (true) { |
| | | try { |
| | | Shared.SimpleControl.CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality (arg2.ToString (), arg1.ToString ()); |
| | | if (Shared.SimpleControl.CommonPage.AirQuality != null) |
| | | break; |
| | | } catch { } |
| | | } |
| | | Shared.Application.RunOnMainThread (() => { |
| | | if (CommonPage.RefreshAir != null) |
| | | CommonPage.RefreshAir (); |
| | | }); |
| | | }); |
| | | }); |
| | | } catch { |
| | | } |
| | | }; |
| | | } |
| | | void checkSomeInfo () |
| | |
| | | |
| | | IsShowTip = true; |
| | | var status = isNetworkAvailable (this); |
| | | Console.WriteLine ("status!!!" + status); |
| | | Utlis.WriteLine ("status!!!" + status); |
| | | int internetStatus = 0; |
| | | if (status) { |
| | | var isWifi = isWifiConnected (this); |
| | |
| | | internetStatus = 1; |
| | | } |
| | | } |
| | | Console.WriteLine (""); |
| | | Shared.SimpleControl.EquipmentPublicClass.CheckLinkRemote (internetStatus,false); |
| | | Utlis.WriteLine (""); |
| | | Shared.SimpleControl.EquipmentPublicClass.CheckLinkRemote (internetStatus, false); |
| | | } |
| | | |
| | | bool isNetworkAvailable (Context context) |