From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 297 +++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 217 insertions(+), 80 deletions(-)
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
index 618425a..1bd77d6 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -243,7 +243,7 @@
/// <param name="titleId"></param>
/// <param name="msgId"></param>
/// <param name="callBackAction"></param>
- public void TipOptionMsg(int titleId, string msg, Action callBackAction)
+ public void TipOptionMsg(int titleId, string msg, Action callBackAction,int extraHeight = 0)
{
Dialog dialog = new Dialog()
{
@@ -253,8 +253,8 @@
FrameLayout contentView = new FrameLayout()
{
Gravity = Gravity.Center,
- Width = Application.GetRealWidth(270),
- Height = Application.GetRealHeight(140),
+ Width = Application.GetRealWidth(270 ),
+ Height = Application.GetRealHeight(140 + extraHeight),
BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
BorderColor = 0x00000000,
BorderWidth = 0,
@@ -277,7 +277,7 @@
Button btnMsg = new Button()
{
Gravity = Gravity.CenterHorizontal,
- Height = Application.GetRealHeight(25),
+ Height = Application.GetRealHeight(35 + extraHeight),
Y = btnTitle.Bottom,
Width = Application.GetRealHeight(200),
TextAlignment = TextAlignment.Center,
@@ -290,7 +290,7 @@
Button btnLine = new Button()
{
- Y = Application.GetRealHeight(96),
+ Y = Application.GetRealHeight(96 + extraHeight),
Height = Application.GetRealHeight(1),
Width = Application.GetRealWidth(270 / 2),
BackgroundColor = CSS.CSS_Color.DividingLineColor,
@@ -351,6 +351,124 @@
};
}
+
+
+ /// <summary>
+ /// 鍔犺浇鎻愮ず寮圭獥
+ /// </summary>
+ /// <param name="titleId"></param>
+ /// <param name="msgId"></param>
+ /// <param name="callBackAction"></param>
+ public void TipOptionMsgNotTitle(string msg, Action callBackAction, int extraHeight = 0)
+ {
+ Dialog dialog = new Dialog()
+ {
+ BackgroundColor = CSS_Color.DialogTransparentColor1,
+ };
+
+ FrameLayout contentView = new FrameLayout()
+ {
+ Gravity = Gravity.Center,
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(140 + extraHeight),
+ BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetMinRealAverage(10),
+ };
+ dialog.AddChidren(contentView);
+
+ Button btnMsg = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Height = Application.GetRealHeight(40 + extraHeight),
+ Y = Application.GetRealHeight(40),
+ Width = Application.GetRealHeight(200),
+ TextAlignment = TextAlignment.Center,
+ TextColor = 0xFF222222,
+ TextSize = CSS_FontSize.TextFontSize,
+ Text = msg,
+ IsMoreLines = true,
+ };
+ contentView.AddChidren(btnMsg);
+
+ Button btnLine = new Button()
+ {
+ Y = Application.GetRealHeight(96 + extraHeight),
+ Height = Application.GetRealHeight(1),
+ Width = Application.GetRealWidth(270 / 2),
+ BackgroundColor = CSS.CSS_Color.DividingLineColor,
+ };
+ contentView.AddChidren(btnLine);
+
+ Button btnCancel = new Button()
+ {
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(43),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ //SelectedTextColor = CSS_Color.MainBackgroundColor,
+ //SelectedBackgroundColor = CSS_Color.MainColor,
+ TextID = StringId.Cancel,
+ };
+ contentView.AddChidren(btnCancel);
+
+
+ Button btnLine11 = new Button()
+ {
+ Y = btnLine.Bottom,
+ X = btnCancel.Right,
+ Width = 1,
+ Height = Application.GetRealHeight(43),
+ BackgroundColor = CSS.CSS_Color.DividingLineColor,
+
+ };
+ contentView.AddChidren(btnCancel);
+
+ Button btnConfirm = new Button()
+ {
+ X = btnLine11.Right,
+ Y = btnLine.Bottom,
+ Width = Application.GetRealWidth(135),
+ Height = Application.GetRealHeight(45),
+ TextAlignment = TextAlignment.Center,
+ //TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextColor = CSS_Color.MainColor,
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ TextID = StringId.Confirm,
+ };
+ contentView.AddChidren(btnConfirm);
+ //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
+ int mRectCornerID = HDLUtils.RectCornerBottomRight;
+ btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID);
+ dialog.Show();
+
+ //btnCancel.MouseDownEventHandler += (sender, e) =>
+ //{
+ // btnCancel.IsSelected = true;
+ //};
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ //btnCancel.IsSelected = false;
+ dialog.Close();
+ };
+ //btnConfirm.MouseDownEventHandler += (sender, e) =>
+ //{
+ // btnConfirm.IsSelected = true;
+ //};
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ //btnConfirm.IsSelected = false;
+ callBackAction();
+ dialog.Close();
+ };
+
+ }
+
+
/// <summary>
/// 淇℃伅鎻愮ず绐楀彛锛岃嚜鍔ㄥ叧闂�
@@ -428,86 +546,105 @@
/// <param name="title"></param>
/// <param name="msg"></param>
/// <param name="action"></param>
- public void TipMsg(string title, string msg, Action action = null)
+ public void TipMsg(string title, string msg, Action action = null,bool again = true)
{
-
- Dialog dialog = new Dialog()
+ try
{
- BackgroundColor = CSS_Color.DialogTransparentColor1,
- };
+ Dialog dialog = new Dialog()
+ {
+ BackgroundColor = CSS_Color.DialogTransparentColor1,
+ };
- FrameLayout contentView = new FrameLayout()
+ FrameLayout contentView = new FrameLayout()
+ {
+ Gravity = Gravity.Center,
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(140),
+ BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
+ BorderColor = 0x00000000,
+ BorderWidth = 0,
+ Radius = (uint)Application.GetMinRealAverage(10),
+ };
+ dialog.AddChidren(contentView);
+
+ Button btnTitle = new Button()
+ {
+ Y = Application.GetRealHeight(16),
+ Height = Application.GetRealHeight(30),
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextAlignment = TextAlignment.Center,
+ IsBold = true,
+ Text = title
+ };
+ contentView.AddChidren(btnTitle);
+
+ Button btnMsg = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Height = Application.GetRealHeight(35),
+ Y = btnTitle.Bottom,
+ Width = Application.GetRealHeight(200),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Text = msg,
+ IsMoreLines = true,
+ };
+ contentView.AddChidren(btnMsg);
+
+ Button btnLine = new Button()
+ {
+ Y = Application.GetRealHeight(96),
+ Height = Application.GetRealHeight(1),
+ BackgroundColor = CSS.CSS_Color.DividingLineColor,
+ };
+ contentView.AddChidren(btnLine);
+
+ Button btnConfirm = new Button()
+ {
+ Y = btnLine.Bottom,
+ Height = Application.GetRealHeight(43),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.TextualColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ SelectedTextColor = CSS_Color.MainBackgroundColor,
+ SelectedBackgroundColor = CSS_Color.MainColor,
+ TextID = StringId.Confirm,
+ };
+ contentView.AddChidren(btnConfirm);
+
+ dialog.Show();
+
+ btnConfirm.MouseDownEventHandler += (sender, e) =>
+ {
+ btnConfirm.IsSelected = true;
+ };
+ btnConfirm.MouseUpEventHandler += (sender, e) =>
+ {
+ btnConfirm.IsSelected = false;
+ action?.Invoke();
+ dialog.Close();
+ };
+ }catch(Exception ex)
{
- Gravity = Gravity.Center,
- Width = Application.GetRealWidth(270),
- Height = Application.GetRealHeight(140),
- BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
- BorderColor = 0x00000000,
- BorderWidth = 0,
- Radius = (uint)Application.GetMinRealAverage(10),
- };
- dialog.AddChidren(contentView);
-
- Button btnTitle = new Button()
+ MainPage.Log($"lc add fail:{ex.Message}");
+ if (again)
+ {
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(500);
+ Application.RunOnMainThread(() =>
+ {
+ TipMsg(title, msg, action, false);
+ });
+ }).Start() ;
+ }
+ }
+ finally
{
- Y = Application.GetRealHeight(16),
- Height = Application.GetRealHeight(30),
- TextColor = CSS_Color.MainColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextAlignment = TextAlignment.Center,
- IsBold = true,
- Text = title
- };
- contentView.AddChidren(btnTitle);
-
- Button btnMsg = new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Height = Application.GetRealHeight(25),
- Y = btnTitle.Bottom,
- Width = Application.GetRealHeight(200),
- TextAlignment = TextAlignment.Center,
- TextColor = CSS_Color.TextualColor,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = msg,
- IsMoreLines = true,
- };
- contentView.AddChidren(btnMsg);
-
- Button btnLine = new Button()
- {
- Y = Application.GetRealHeight(96),
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS.CSS_Color.DividingLineColor,
- };
- contentView.AddChidren(btnLine);
-
- Button btnConfirm = new Button()
- {
- Y = btnLine.Bottom,
- Height = Application.GetRealHeight(43),
- TextAlignment = TextAlignment.Center,
- TextColor = CSS_Color.TextualColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
- SelectedTextColor = CSS_Color.MainBackgroundColor,
- SelectedBackgroundColor = CSS_Color.MainColor,
- TextID = StringId.Confirm,
- };
- contentView.AddChidren(btnConfirm);
-
- dialog.Show();
-
- btnConfirm.MouseDownEventHandler += (sender, e) =>
- {
- btnConfirm.IsSelected = true;
- };
- btnConfirm.MouseUpEventHandler += (sender, e) =>
- {
- btnConfirm.IsSelected = false;
- action?.Invoke();
- dialog.Close();
- };
-
+
+ }
}
--
Gitblit v1.8.0