From 83df0ebfbd306d0fb5a51a21a7ef2271c0c507ec Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 09 三月 2021 19:39:26 +0800 Subject: [PATCH] 2021-3-9-1 --- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 171 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs index b86395d..6fec343 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs @@ -326,7 +326,178 @@ } + /// <summary> + /// 纭畾鎻愮ず妗� + /// </summary> + /// <param name="titleId">鏍囬鏂囨湰</param> + /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�</param> + /// <param name="confirmAction">鍥炶皟鍑芥暟</param> + public void TipBox(int titleId, int tipTxet, Action confirmAction) + { + Dialog dialog = new Dialog() + { + BackgroundColor = CSS.CSS_Color.viewTrans60lucence, + }; + + FrameLayout whiteView = new FrameLayout() + { + //Gravity = Gravity.Center, + X = Application.GetRealWidth(53), + Y = Application.GetRealHeight(264), + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(140), + BackgroundColor = CSS_Color.view, + BorderColor = CSS_Color.viewTranslucence, + BorderWidth = 0, + Radius = (uint)Application.GetRealHeight(RradiusFrameLayout), + }; + dialog.AddChidren(whiteView); + + Button titleBtn = new Button() + { + Y = Application.GetRealHeight(20), + X = Application.GetRealWidth(35), + Height = Application.GetRealHeight(22), + Width = Application.GetRealWidth(270 - 35 * 2), + TextColor = CSS_Color.textConfirmColor, + TextSize = TextSize.Text16, + TextAlignment = TextAlignment.Center, + TextID = titleId, + }; + whiteView.AddChidren(titleBtn); + + Button tipBtn = new Button() + { + Y = titleBtn.Bottom + Application.GetRealHeight(8), + X = Application.GetRealWidth(20), + Height = Application.GetRealHeight(22), + Width = Application.GetRealWidth(270 - 20 * 2), + TextColor = CSS_Color.textTipColor, + TextSize = TextSize.Text12, + TextAlignment = TextAlignment.Center, + TextID = tipTxet, + }; + whiteView.AddChidren(tipBtn); + Button btnLine = new Button() + { + Y = whiteView.Height - Application.GetRealHeight(44 + 1), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.viewLine, + }; + whiteView.AddChidren(btnLine); + + Button btnCancel = new Button() + { + Y = btnLine.Bottom, + Width = Application.GetRealWidth(135), + Height = Application.GetRealHeight(44), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.textTipColor, + TextSize = TextSize.Text16, + TextID = StringId.cancelMusic, + Gravity = Gravity.BottomLeft, + }; + whiteView.AddChidren(btnCancel); + btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft); + Button btnConfirm = new Button() + { + X = btnCancel.Right, + Y = btnLine.Bottom, + Width = Application.GetRealWidth(135), + Height = Application.GetRealHeight(44), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.view, + IsBold = true, + TextSize = TextSize.Text16, + TextID = StringId.confirmMusic, + BackgroundColor = CSS_Color.textConfirmColor, + Gravity = Gravity.BottomRight, + }; + whiteView.AddChidren(btnConfirm); + btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight); + dialog.Show(); + btnCancel.MouseUpEventHandler += (sender, e) => + { + dialog.Close(); + }; + + btnConfirm.MouseUpEventHandler += (sender, e) => + { + confirmAction(); + dialog.Close(); + }; + + } + /// <summary> + /// 閿欒淇℃伅鎻愮ず绐楀彛锛屾墜鍔ㄧ‘瀹氬叧闂� + /// </summary> + /// <param name="titleId">鏍囬鏂囨湰</param> + /// <param name="msgId">鎻愮ず閿欒鏂囨湰</param> + public void TipBox(int titleId, int msgId) + { + Dialog dialog = new Dialog() + { + BackgroundColor = CSS_Color.viewTrans60lucence, + }; + + FrameLayout contentView = new FrameLayout() + { + Gravity = Gravity.Center, + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(140), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealHeight(RradiusFrameLayout), + }; + dialog.AddChidren(contentView); + + Button btnTitle = new Button() + { + Y = Application.GetRealHeight(20), + Height = Application.GetRealHeight(22), + TextColor = CSS_Color.MainColor, + TextSize =TextSize.Text16, + TextAlignment = TextAlignment.Center, + TextID = titleId, + }; + contentView.AddChidren(btnTitle); + + Button btnMsg = new Button() + { + Height = Application.GetRealHeight(17), + Y = Application.GetRealHeight(50), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.TextualColor, + TextSize = TextSize.Text12, + TextID = msgId, + }; + contentView.AddChidren(btnMsg); + + Button btnLine = new Button() + { + Y = Application.GetRealHeight(96), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.viewLine, + }; + contentView.AddChidren(btnLine); + + Button btnConfirm = new Button() + { + Y = btnLine.Bottom, + Height = Application.GetRealHeight(43), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainColor, + TextSize = TextSize.Text16, + TextID = StringId.Close, + }; + contentView.AddChidren(btnConfirm); + dialog.Show(); + btnConfirm.MouseUpEventHandler += (sender, e) => + { + dialog.Close(); + }; + + } } } -- Gitblit v1.8.0