From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs | 77 +++++++++++++++++++++-----------------
1 files changed, 42 insertions(+), 35 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
old mode 100755
new mode 100644
index d261ffd..e10d95a
--- a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
@@ -42,12 +42,13 @@
/// <summary>
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
/// </summary>
- public void ShowForm()
+ /// <param name="autoUpdate">鎵撳紑鐣岄潰涔嬪悗,濡傛灉鏈夋柊鐗堟湰,鏄惁鐩存帴鍗囩骇</param>
+ public void ShowForm(bool autoUpdate)
{
//璁剧疆鏍囬淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAboutMe));
//鍒濆鍖栦腑閮ㄦ帶浠�
- this.InitMiddleFrame();
+ this.InitMiddleFrame(autoUpdate);
}
/// <summary>
/// Closes the form.
@@ -65,27 +66,23 @@
/// <summary>
/// 鍒濆鍖栦腑閮ㄦ帶浠�
/// </summary>
- private void InitMiddleFrame()
+ /// <param name="autoUpdate">鎵撳紑鐣岄潰涔嬪悗,濡傛灉鏈夋柊鐗堟湰,鏄惁鐩存帴鍗囩骇</param>
+ private void InitMiddleFrame(bool autoUpdate)
{
//澶撮儴鐧借壊鑳屾櫙
var frameLogo = new FrameLayoutBase();
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);
+ 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);
@@ -111,11 +108,17 @@
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);
@@ -156,6 +159,11 @@
//鏇存柊鏈�鏂扮増
btnRightView.TextID = R.MyInternationalizationString.Update;
rowUpdate.CanClick = true;
+ if (autoUpdate == true)
+ {
+ //鐩存帴鍗囩骇
+ rowUpdate.ButtonClickEvent?.Invoke(null, null);
+ }
}
else
{
@@ -202,9 +210,10 @@
if (results[0] == null)
{
return false;
- }
- var newVersion = results[0]["version"]?.ToString();
- var updateContent = results[0]["releaseNotes"]?.ToString();
+ }
+ var newVersion = results[0]["version"]?.ToString();
+
+ var updateContent = results[0]["releaseNotes"]?.ToString();
if (newVersion.CompareTo(CommonPage.CodeIDString) > 0)
{
return true;
@@ -224,7 +233,7 @@
{
return false;
}
- if (int.Parse(versionResult.FirmwareVersion.Replace(".", "")) > int.Parse(CommonPage.CodeIDString.Replace(".", "")))
+ if (versionResult.FirmwareVersion.CompareTo(CommonPage.CodeIDString) > 0)
{
distributedMark = versionResult.DistributedMark;
return true;
@@ -300,7 +309,7 @@
try
{
var webClient = new WebClient { };
- var result = await webClient.DownloadDataTaskAsync("https://itunes.apple.com/lookup?id=1461693569");
+ var result = await webClient.DownloadDataTaskAsync("https://itunes.apple.com/lookup?id=1528702586");
if (result == null)
{
return null;
@@ -317,7 +326,7 @@
/// </summary>
public void OpenUrl()
{
- Uri url = new Uri("https://itunes.apple.com/cn/app/hdl-home/id1461693569?mt=8");
+ Uri url = new Uri("https://itunes.apple.com/cn/app/hdl-home/id1528702586?mt=8");
UIKit.UIApplication.SharedApplication.OpenUrl(url);
}
#elif Android
@@ -338,7 +347,7 @@
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);
//娣诲姞杩欎竴鍙ヨ〃绀哄鐩爣搴旂敤涓存椂鎺堟潈璇ri鎵�浠h〃鐨勬枃浠�
intent.AddFlags(Android.Content.ActivityFlags.GrantReadUriPermission);
intent.SetDataAndType(apkUri, "application/vnd.android.package-archive");
@@ -381,19 +390,17 @@
{
return null;
}
- int MaxIndex = 0;
- int NewVersion = 0;
+
+ Common.ResponseEntity.ApkInfoOBJ apkInfoOBJ = null;
for (int i = 0; i < responeData.pageData.Count; i++)
{
var apkInfo = responeData.pageData[i];
- var version = int.Parse(apkInfo.FirmwareVersion.Replace(".", ""));
- if (version > NewVersion)
+ if (apkInfoOBJ == null || apkInfo.FirmwareVersion.CompareTo(apkInfoOBJ.FirmwareVersion) > 0)
{
- NewVersion = version;
- MaxIndex = i;
+ apkInfoOBJ = apkInfo;
}
}
- return responeData.pageData[MaxIndex];
+ return apkInfoOBJ;
}
return null;
}
--
Gitblit v1.8.0