| | |
| | | frameLogo.Height = Application.GetRealHeight(484);
|
| | | frameLogo.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
|
| | | bodyFrameLayout.AddChidren(frameLogo);
|
| | | //图标的容器
|
| | | var frameLogoBackground = new FrameLayoutBase();
|
| | | frameLogoBackground.Y = Application.GetRealHeight(104);
|
| | | frameLogoBackground.Width = this.GetPictrueRealSize(167);
|
| | | frameLogoBackground.Height = this.GetPictrueRealSize(167);
|
| | | frameLogoBackground.Gravity = Gravity.CenterHorizontal;
|
| | | frameLogoBackground.BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor;
|
| | | frameLogoBackground.Radius = (uint)Application.GetRealHeight(37);
|
| | | frameLogo.AddChidren(frameLogoBackground);
|
| | | //图标
|
| | | var btnLogo = new IconViewControl(144);
|
| | | btnLogo.UnSelectedImagePath = "Account/Logo_White.png";
|
| | | btnLogo.Gravity = Gravity.Center;
|
| | | frameLogoBackground.AddChidren(btnLogo);
|
| | | //HDL Home
|
| | | var btnLogo = new ImageView();
|
| | | btnLogo.Y = Application.GetRealHeight(104);
|
| | | btnLogo.Width = this.GetPictrueRealSize(167);
|
| | | btnLogo.Height = this.GetPictrueRealSize(167);
|
| | | btnLogo.Radius = (uint)Application.GetRealHeight(37);
|
| | | btnLogo.ImagePath = "Account/Logo_Evoyo.png";
|
| | | btnLogo.Gravity = Gravity.CenterHorizontal;
|
| | | frameLogo.AddChidren(btnLogo);
|
| | | //Evoyo Home
|
| | | var btnName = new NormalViewControl(700, 60, true);
|
| | | btnName.Y = Application.GetRealHeight(294);
|
| | | btnName.Gravity = Gravity.CenterHorizontal;
|
| | | btnName.Text = "HDL Home";
|
| | | btnName.Text = "Evoyo Home";
|
| | | btnName.TextSize = 15;
|
| | | btnName.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor;
|
| | | btnName.TextAlignment = TextAlignment.Center;
|
| | |
| | | listView.Height = Application.GetRealHeight(500);
|
| | | bodyFrameLayout.AddChidren(listView);
|
| | | //服务协议
|
| | | //var rowService = new FrameRowControl(listView.rowSpace / 2);
|
| | | //listView.AddChidren(rowService);
|
| | | //rowService.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SLA), 400);
|
| | | //rowService.AddRightArrow();
|
| | | //rowService.AddBottomLine();
|
| | | var rowService = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(rowService);
|
| | | rowService.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SLA), 400);
|
| | | rowService.AddRightArrow();
|
| | | rowService.AddBottomLine();
|
| | | rowService.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new SLAForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | //版本更新
|
| | | this.rowUpdate = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(rowUpdate);
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// CheckVersion
|
| | | /// </summary>
|
| | | private void CheckVersion()
|
| | | {
|
| | | new System.Threading.Thread(async () =>
|
| | | {
|
| | | |
| | | })
|
| | | { IsBackground = true }.Start();
|
| | |
|
| | | }
|
| | | /// <summary>
|
| | | /// 设置进度控件不可见
|
| | | /// </summary>
|
| | |
| | | #elif Android
|
| | | try
|
| | | {
|
| | | var versionResult = await RequestHttpsAndroidAppVersionAsync();
|
| | | var versionResult = RequestHttpsAndroidAppVersionAsync();
|
| | | if (versionResult == null)
|
| | | {
|
| | | return false;
|
| | |
| | | };
|
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj);
|
| | |
|
| | | var bytesTotalLengthResult = await CommonPage.Instance.RequestHttpsZigbeeAsync("FirmwareMana/DownloadPlatformUploadFirmwarePreLength", Encoding.UTF8.GetBytes(requestJson));
|
| | | var bytesTotalLengthResult = CommonPage.Instance.RequestHttpsZigbeeAsync("FirmwareMana/DownloadPlatformUploadFirmwarePreLength", Encoding.UTF8.GetBytes(requestJson));
|
| | | if (bytesTotalLengthResult == null || bytesTotalLengthResult.ResponseData == null)
|
| | | {
|
| | | CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.UpdateAppFail);
|
| | |
| | | if (Android.OS.BuildVersionCodes.M < Android.OS.Build.VERSION.SdkInt)
|
| | | {
|
| | | //参数1 上下文, 参数2 Provider主机地址 和配置文件中保持一致 参数3 共享的文件
|
| | | var apkUri = Android.Support.V4.Content.FileProvider.GetUriForFile(context, "com.hdl.home.fileProvider", file);
|
| | | var apkUri = Android.Support.V4.Content.FileProvider.GetUriForFile(context, "com.evoyo.home.fileProvider", file);
|
| | | //添加这一句表示对目标应用临时授权该Uri所代表的文件
|
| | | intent.AddFlags(Android.Content.ActivityFlags.GrantReadUriPermission);
|
| | | intent.SetDataAndType(apkUri, "application/vnd.android.package-archive");
|
| | |
| | | /// 获取 Android-APP 版本信息
|
| | | /// </summary>
|
| | | /// <returns>The https app version async.</returns>
|
| | | private async System.Threading.Tasks.Task<Common.ResponseEntity.ApkInfoOBJ> RequestHttpsAndroidAppVersionAsync()
|
| | | private Common.ResponseEntity.ApkInfoOBJ RequestHttpsAndroidAppVersionAsync()
|
| | | {
|
| | | try
|
| | | {
|
| | |
| | | RequestVersion = CommonPage.CodeIDString
|
| | | };
|
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestOBJ);
|
| | | var result = await CommonPage.Instance.RequestHttpsZigbeeAsync("FirmwareMana/DetectionPlatformUploadFirmware", System.Text.Encoding.UTF8.GetBytes(requestJson));
|
| | | var result = CommonPage.Instance.RequestHttpsZigbeeAsync("FirmwareMana/DetectionPlatformUploadFirmware", System.Text.Encoding.UTF8.GetBytes(requestJson));
|
| | | if (result == null)
|
| | | {
|
| | | return null;
|