From e3f3f62315a5789cd812b96954b67bffda4a0f5a Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 01 四月 2021 16:33:55 +0800
Subject: [PATCH] 金辉项目,萤石摄像头更新
---
HDL_ON/UI/UI0-Public/Widget/UpdateTipDialog.cs | 310 +++++++++++++++++++++++++++++++++++++-------------
1 files changed, 227 insertions(+), 83 deletions(-)
diff --git a/HDL_ON/UI/UI0-Public/Widget/UpdateTipDialog.cs b/HDL_ON/UI/UI0-Public/Widget/UpdateTipDialog.cs
index 65ed221..5689c26 100644
--- a/HDL_ON/UI/UI0-Public/Widget/UpdateTipDialog.cs
+++ b/HDL_ON/UI/UI0-Public/Widget/UpdateTipDialog.cs
@@ -1,13 +1,11 @@
锘縰sing System;
using Shared;
using HDL_ON.UI.CSS;
-using System.Collections.Generic;
namespace HDL_ON.UI
{
/// <summary>
- /// 鏇存柊浜屾纭鐣岄潰
- /// 鍙互鑷畾涔夋寜閽枃瀛�
+ /// UpdateTipDialog
/// </summary>
public class UpdateTipDialog : Dialog
{
@@ -26,7 +24,7 @@
/// <param name="cancelAction"></param>
/// <param name="cancelID"></param>
/// <param name="confirmID"></param>
- void ShowDialogBase(string titleStr, string tipStr, List<string> msgList, Action okAction, Action cancelAction, int cancelID = StringId.Ignore, int confirmID = StringId.Update)
+ void ShowDialogBase(string titleStr, string tipStr, string msgStr, Action okAction, Action cancelAction, bool isForceUpdate, int cancelID = StringId.Ignore, int confirmID = StringId.Update)
{
this.BackgroundColor = CSS_Color.DialogTransparentColor1;
@@ -67,35 +65,42 @@
};
contentView.AddChidren(btnTip);
- //鏂规1
- int listViewY = btnTip.Bottom + Application.GetMinRealAverage(10);
- int lineY = Application.GetRealHeight(250);
+ int btnMesY = btnTip.Bottom + Application.GetMinRealAverage(5);
+ int lineY = Application.GetRealHeight(258);
- var listView = new VerticalScrolViewLayout()
+ VerticalScrolViewLayout mesView = new VerticalScrolViewLayout()
{
- X = Application.GetRealWidth(25),
- Width = contentView.Width - Application.GetRealWidth(50),
- Y = listViewY,
- Height = lineY - listViewY,
+ X = Application.GetRealWidth(16),
+ Y = btnMesY,
+ Width = contentView.Width - Application.GetRealWidth(32),
+ Height = lineY - btnMesY - Application.GetMinRealAverage(5),
};
- contentView.AddChidren(listView);
+ contentView.AddChidren(mesView);
- //鏂规2
- //Button btnMes = new Button()
- //{
- // Gravity = Gravity.CenterHorizontal,
- // X = Application.GetRealWidth(25),
- // Y = btnTip.Bottom + Application.GetMinRealAverage(28),
- // Width = contentView.Width - Application.GetRealWidth(50),
- // Height = lineY - listViewY,
- // TextAlignment = TextAlignment.TopLeft,
- // TextColor = CSS_Color.TextualColor,
- // TextSize = CSS_FontSize.TextFontSize,
- // IsMoreLines = true,
- // Text = msgStr,
+ TextButton btnMes = new TextButton()
+ {
+ //Gravity = Gravity.CenterHorizontal,
+ Width = mesView.Width,
+ //Height = mesView.Height,
+ Height = Application.GetRealWidth(20),
+ TextAlignment = TextAlignment.TopLeft,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.TextFontSize,
+ Text = msgStr,
+ //BackgroundColor = CSS_Color.AuxiliaryColor2
- //};
- //listView.AddChidren(btnMes);
+ };
+ mesView.AddChidren(btnMes);
+ //鍔ㄦ�佽绠楅珮搴�
+ var needHeight = btnMes.GetMoreLineNeedHeight();
+ if(needHeight < mesView.Height)
+ {
+ needHeight = mesView.Height;
+ }
+ btnMes.IsMoreLines = true;
+ btnMes.Height = needHeight;
+ //mesView.AddChidren(btnMes);
+
Button btnLine = new Button()
{
@@ -106,23 +111,198 @@
};
contentView.AddChidren(btnLine);
- Button btnCancel = new Button()
+ if (!isForceUpdate)
{
- Y = btnLine.Bottom,
- Width = Application.GetRealWidth(144),
- Height = Application.GetRealHeight(44),
- TextAlignment = TextAlignment.Center,
- TextColor = CSS_Color.TextualColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextID = cancelID,
+ int Width144 = Application.GetRealWidth(144);
+ Button btnCancel = new Button()
+ {
+ Y = btnLine.Bottom,
+ Width = Width144,
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextID = cancelID,
+ };
+ contentView.AddChidren(btnCancel);
+
+ Button btnConfirm = new Button()
+ {
+ X = contentView.Width - Width144,
+ Y = btnLine.Y,
+ Width = Width144,
+ Height = Application.GetRealHeight(45),
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextColor = CSS_Color.MainBackgroundColor,
+ BackgroundColor = CSS_Color.MainColor,
+ TextID = confirmID,
+ };
+ contentView.AddChidren(btnConfirm);
+ //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
+ int mRectCornerID = HDLUtils.RectCornerBottomRight;
+ btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID);
+
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ this.Close();
+ cancelAction?.Invoke();
+ };
+
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ this.Close();
+ okAction?.Invoke();
+ };
+ }
+ else
+ {
+ Button btnConfirm = new Button()
+ {
+ Y = btnLine.Y,
+ Width = contentView.Width,
+ Height = Application.GetRealHeight(45),
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextColor = CSS_Color.MainBackgroundColor,
+ BackgroundColor = CSS_Color.MainColor,
+ TextID = confirmID,
+ };
+ contentView.AddChidren(btnConfirm);
+ //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
+ int mRectCornerID = HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerBottomLeft;
+ btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID);
+
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ //dialog绂佹鍏抽棴
+ okAction?.Invoke();
+ };
+ }
+
+ Button btnHeadImage = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetMinRealAverage(152),
+ Width = Application.GetMinRealAverage(160),
+ Height = Application.GetMinRealAverage(160),
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ UnSelectedImagePath = "Public/Dialog/DialogTipTitleIcon_3.png",
};
- contentView.AddChidren(btnCancel);
+ this.AddChidren(btnHeadImage);
+
+ this.Show();
+ }
+
+
+ /// <summary>
+ /// 鍔犺浇鎻愮ず鏇存柊Dialog
+ /// </summary>
+ /// <param name="titleStr"></param>
+ /// <param name="tipStr"></param>
+ /// <param name="msgStr"></param>
+ /// <param name="okAction"></param>
+ /// <param name="cancelAction"></param>
+ public void ShowUpdateDialog(string titleStr, string tipStr, string msgStr, Action okAction, Action cancelAction = null)
+ {
+ this.ShowDialogBase(titleStr, tipStr, msgStr, okAction, cancelAction, false);
+ }
+
+ /// <summary>
+ /// 鍔犺浇寮哄埗鏇存柊Dialog
+ /// Dialog涓嶅叧闂�
+ /// </summary>
+ /// <param name="titleStr"></param>
+ /// <param name="tipStr"></param>
+ /// <param name="msgStr"></param>
+ /// <param name="okAction"></param>
+ /// <param name="cancelAction"></param>
+ public void ShowForcedUpdateDialog(string titleStr, string tipStr, string msgStr, Action okAction)
+ {
+ this.ShowDialogBase(titleStr, tipStr, msgStr, okAction, null, true);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖朌ialog
+ /// </summary>
+ /// <param name="titleStr"></param>
+ /// <param name="tipStr"></param>
+ /// <param name="msgStr"></param>
+ /// <param name="okAction"></param>
+ /// <param name="cancelAction"></param>
+ /// <param name="cancelID"></param>
+ /// <param name="confirmID"></param>
+ void ShowTipDialogBase(string titleStr, string msgStr, Action okAction, int confirmID = StringId.Close)
+ {
+ this.BackgroundColor = CSS_Color.DialogTransparentColor1;
+
+ FrameLayout contentView = new FrameLayout()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetMinRealAverage(223),
+ Width = Application.GetRealWidth(288),
+ Height = Application.GetRealHeight(302),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ Radius = (uint)Application.GetRealWidth(12),
+ BorderWidth = 0,
+ BorderColor = 0x00000000,
+ };
+ this.AddChidren(contentView);
+
+ Button btnTitle = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetMinRealAverage(95),
+ Height = Application.GetMinRealAverage(30),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
+ Text = titleStr
+ };
+ contentView.AddChidren(btnTitle);
+
+ int btnMesY = btnTitle.Bottom + Application.GetMinRealAverage(5);
+ int lineY = Application.GetRealHeight(258);
+
+ VerticalScrolViewLayout mesView = new VerticalScrolViewLayout()
+ {
+ X = Application.GetRealWidth(16),
+ Y = btnMesY,
+ Width = contentView.Width - Application.GetRealWidth(32),
+ Height = lineY - btnMesY - Application.GetMinRealAverage(5),
+ };
+ contentView.AddChidren(mesView);
+
+ Button btnMes = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Width = mesView.Width,
+ Height = mesView.Height,
+ TextAlignment = TextAlignment.TopLeft,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.TextFontSize,
+ IsMoreLines = true,
+ Text = msgStr,
+ BackgroundColor = CSS_Color.AuxiliaryColor2
+
+ };
+ mesView.AddChidren(btnMes);
+
+ Button btnLine = new Button()
+ {
+ Y = lineY,
+ Height = Application.GetRealHeight(1),
+ Width = contentView.Width,
+ BackgroundColor = CSS_Color.DividingLineColor,
+ };
+ contentView.AddChidren(btnLine);
+
Button btnConfirm = new Button()
{
- X = btnCancel.Right,
Y = btnLine.Y,
- Width = Application.GetRealWidth(144),
+ Width = contentView.Width,
Height = Application.GetRealHeight(44),
TextAlignment = TextAlignment.Center,
TextSize = CSS_FontSize.SubheadingFontSize,
@@ -132,14 +312,8 @@
};
contentView.AddChidren(btnConfirm);
//渚嬶細鍙充笅鍦嗚 澶у皬涓�50
- int mRectCornerID = HDLUtils.RectCornerBottomRight;
+ int mRectCornerID = HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerBottomLeft;
btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID);
-
- btnCancel.MouseUpEventHandler += (sender, e) =>
- {
- this.Close();
- cancelAction?.Invoke();
- };
btnConfirm.MouseUpEventHandler += (sender, e) =>
{
@@ -159,53 +333,23 @@
};
this.AddChidren(btnHeadImage);
- if(msgList != null && msgList.Count > 0)
- {
- foreach(var mes in msgList)
- {
- Button btnMes = new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = listView.Width,
- Height = Application.GetRealHeight(17),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.TextualColor,
- TextSize = CSS_FontSize.TextFontSize,
- Text = mes,
- };
- contentView.AddChidren(btnMes);
- }
- }
-
-
this.Show();
}
-
- ///// <summary>
- ///// 鍔犺浇鎻愮ずDialog
- ///// </summary>
- ///// <param name="titleStr"></param>
- ///// <param name="tipStr"></param>
- ///// <param name="msgStr"></param>
- ///// <param name="okAction"></param>
- ///// <param name="cancelAction"></param>
- //public void ShowDialog(string titleStr, string tipStr, string msgStr, Action okAction, Action cancelAction = null)
- //{
- // this.ShowDialogBase(titleStr, tipStr, msgStr, okAction, cancelAction);
- //}
-
/// <summary>
- /// 鍔犺浇鎻愮ずDialog
+ /// 鍔犺浇鎻愮ず閫氱煡Dialog
/// </summary>
/// <param name="titleStr"></param>
/// <param name="tipStr"></param>
- /// <param name="msgList"></param>
+ /// <param name="msgStr"></param>
/// <param name="okAction"></param>
/// <param name="cancelAction"></param>
- public void ShowDialog(string titleStr, string tipStr, List<string> msgList, Action okAction, Action cancelAction = null)
+ public void ShowTipDialog(string titleStr, string msgStr, Action okAction)
{
- this.ShowDialogBase(titleStr, tipStr, msgList, okAction, cancelAction);
+ this.ShowTipDialogBase(titleStr, msgStr, okAction);
}
+
+
+
}
}
--
Gitblit v1.8.0