From 0a0d7ec5080cd1f1802d9fcc96b08102b9b551f1 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 29 五月 2020 11:15:19 +0800
Subject: [PATCH] 2020-05-29-2
---
ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs
index e200696..b032749 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs
@@ -32,12 +32,14 @@
/// </summary>
private void InitMiddleFrame(string i_file)
{
+ if (i_file == string.Empty) { return; }
+
if (i_file.EndsWith(".png") == true || i_file.EndsWith(".jpg") == true || i_file.EndsWith(".JPG") == true)
{
var btnPic = new ImageView();
btnPic.Y = Application.GetRealHeight(60);
- btnPic.Width = Application.GetMinRealAverage(887);
- btnPic.Height = Application.GetMinRealAverage(444);
+ btnPic.Width = this.GetPictrueRealSize(887);
+ btnPic.Height = this.GetPictrueRealSize(444);
btnPic.Gravity = Gravity.CenterHorizontal;
btnPic.Radius= (uint)Application.GetRealHeight(17);
btnPic.ImageBytes = Shared.IO.FileUtils.ReadFile(i_file);
@@ -46,26 +48,35 @@
else
{
string textValue = System.Text.Encoding.UTF8.GetString(Shared.IO.FileUtils.ReadFile(i_file)).Trim();
- textValue = textValue.Replace(",", "\r\n");
- if (textValue.StartsWith("{") == true)
- {
- textValue = "{\r\n" + textValue.Substring(1);
- }
- if (textValue.EndsWith("}") == true)
- {
- textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}";
- }
-
- var btnText = new EditTextView();
- btnText.Width = bodyFrameLayout.Width;
- btnText.Height = bodyFrameLayout.Height;
- btnText.TextAlignment = TextAlignment.TopLeft;
- btnText.TextColor = UserCenterColor.Current.TextColor1;
- btnText.Text = textValue;
- bodyFrameLayout.AddChidren(btnText);
+ this.SetTextContent(textValue);
}
}
+ /// <summary>
+ /// 鑷畾涔夎缃樉绀虹殑鏂囨湰
+ /// </summary>
+ /// <param name="i_text"></param>
+ public void SetTextContent(string textValue)
+ {
+ textValue = textValue.Replace(",", "\r\n");
+ if (textValue.StartsWith("{") == true)
+ {
+ textValue = "{\r\n" + textValue.Substring(1);
+ }
+ if (textValue.EndsWith("}") == true)
+ {
+ textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}";
+ }
+
+ var btnText = new EditTextView();
+ btnText.Width = bodyFrameLayout.Width;
+ btnText.Height = bodyFrameLayout.Height;
+ btnText.TextAlignment = TextAlignment.TopLeft;
+ btnText.TextColor = UserCenterColor.Current.TextColor1;
+ btnText.Text = textValue;
+ bodyFrameLayout.AddChidren(btnText);
+ }
+
#endregion
#region 鈻� 涓�鑸柟娉昣__________________________
--
Gitblit v1.8.0