From f35f1397c980efdc2542dff7aaa23b1a7dbb65e7 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期三, 16 十二月 2020 10:53:34 +0800 Subject: [PATCH] 2020-12-16-1 --- HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 74 +++++++++++++++++++----------------- 1 files changed, 39 insertions(+), 35 deletions(-) diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs index a275263..d80eb59 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs @@ -130,6 +130,10 @@ if (etParater.Text.Length > 20) { etParater.Text = etParater.Text.Remove(20); + +#if __ANDROID__ + etParater.SetSelectionEnd(); +#endif } }; @@ -169,11 +173,11 @@ { X = btnCancel.Right, Y = btnLine.Y, - Width = Application.GetRealWidth(135), + Width = Application.GetRealWidth(137), Height = Application.GetRealHeight(43 + 1), TextAlignment = TextAlignment.Center, //TextColor = CSS_Color.TextualColor, - //TextSize = CSS_FontSize.SubheadingFontSize, + TextSize = CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.MainBackgroundColor, BackgroundColor = CSS_Color.MainColor, TextID = StringId.Confirm, @@ -184,17 +188,10 @@ 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; - //}; EditParaterEvent(btnConfirm, errorId_IsNullOrEmpty, errorId_ContainsPar, baseList, etParater, callBackAction, contentView, btnLine, btnCancel, editView, dialog, titleId); } @@ -205,7 +202,7 @@ /// <param name="titleId"></param> /// <param name="msgId"></param> /// <param name="callBackAction"></param> - public void TipMsg(int titleId, int msgId, Action callBackAction) + public void TipOptionMsg(int titleId, int msgId, Action callBackAction) { Dialog dialog = new Dialog() { @@ -246,6 +243,7 @@ TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextID = msgId, + IsMoreLines = true, }; contentView.AddChidren(btnMsg); @@ -272,22 +270,12 @@ }; contentView.AddChidren(btnCancel); - //Button btnBottomLine = new Button() - //{ - // X = btnCancel.Right, - // Y = btnLine.Bottom, - // Height = Application.GetRealHeight(43), - // Width = Application.GetRealWidth(1), - // BackgroundColor = CSS_Color.DividingLineColor, - //}; - //contentView.AddChidren(btnBottomLine); - Button btnConfirm = new Button() { X = btnCancel.Right, Y = btnLine.Y, Width = Application.GetRealWidth(135), - Height = Application.GetRealHeight(43 + 1), + Height = Application.GetRealHeight(45), TextAlignment = TextAlignment.Center, //TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.SubheadingFontSize, @@ -330,20 +318,31 @@ /// <param name="isWhite"></param> public void TipMsgAutoClose(string msg, bool isWhite, int closeTime = 1500) { - Dialog dialog = new Dialog() + Dialog dialog = new Dialog(); + + FrameLayout dialogBody = new FrameLayout(); + dialog.AddChidren(dialogBody); + dialogBody.MouseUpEventHandler = (sender, e) => + { + dialog.Close(); + dialog = null; + }; + + FrameLayout frame = new FrameLayout() { X = Application.GetRealWidth(89), Y = Application.GetRealHeight(285), Width = Application.GetRealWidth(198), Height = Application.GetRealHeight(98), - }; - - FrameLayout frame = new FrameLayout() - { BackgroundColor = isWhite ? 0xE6FFFFFF : CSS_Color.DialogTransparentColor1, Radius = (uint)Application.GetRealWidth(12), }; dialog.AddChidren(frame); + frame.MouseUpEventHandler = (sender, e) => + { + dialog.Close(); + dialog = null; + }; Button btnTipIcon = new Button() { @@ -373,7 +372,10 @@ Thread.Sleep(closeTime); Application.RunOnMainThread(() => { - dialog.Close(); + if(dialog!=null) + { + dialog.Close(); + } }); }) { IsBackground = true }.Start(); @@ -384,7 +386,7 @@ /// </summary> /// <param name="titleId"></param> /// <param name="msgId"></param> - public void TipMsg(int titleId, int msgId) + public void TipMsg(int titleId, int msgId,Action action = null) { Dialog dialog = new Dialog() { @@ -425,6 +427,7 @@ TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextID = msgId, + IsMoreLines = true, }; contentView.AddChidren(btnMsg); @@ -458,6 +461,7 @@ btnConfirm.MouseUpEventHandler += (sender, e) => { btnConfirm.IsSelected = false; + action?.Invoke(); dialog.Close(); }; @@ -537,7 +541,7 @@ /// 鍦烘櫙寤舵椂璁剧疆寮圭獥 /// </summary> /// <param name="function"></param> - public void SetSceneDelayDialog(Function function,Button btn) + public void SetSceneDelayDialog(Scene scene,Button btn) { Button lastButton = new Button(); int changeDelay = 0; @@ -620,7 +624,7 @@ SelectedBackgroundColor = CSS_Color.MainColor, X = Application.GetRealWidth(20), Y = Application.GetRealHeight(80), - IsSelected = function.delayText == "30s" + IsSelected = scene.delayText == "30s" }; optionBaseView.AddChidren(btn1); @@ -640,7 +644,7 @@ SelectedBackgroundColor = CSS_Color.MainColor, X = Application.GetRealWidth(195), Y = Application.GetRealHeight(80), - IsSelected = function.delayText == "1min" + IsSelected = scene.delayText == "1min" }; optionBaseView.AddChidren(btn2); @@ -660,7 +664,7 @@ SelectedBackgroundColor = CSS_Color.MainColor, X = Application.GetRealWidth(20), Y = Application.GetRealHeight(140), - IsSelected = function.delayText == "2min" + IsSelected = scene.delayText == "2min" }; optionBaseView.AddChidren(btn3); @@ -680,7 +684,7 @@ SelectedBackgroundColor = CSS_Color.MainColor, X = Application.GetRealWidth(195), Y = Application.GetRealHeight(140), - IsSelected = function.delayText == "5min" + IsSelected = scene.delayText == "5min" }; optionBaseView.AddChidren(btn4); @@ -701,8 +705,8 @@ btnConfrim.MouseUpEventHandler = (sender, e) => { dialog.Close(); - function.delay = changeDelay; - btn.Text = function.delayText; + scene.delay = changeDelay; + btn.Text = scene.delayText; }; btn1.MouseUpEventHandler = (sender, e) => { btn1.IsSelected = !btn1.IsSelected; -- Gitblit v1.8.0