From 26cee91cc3332e09db5cadb9faf76612b1b0c081 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 11 五月 2020 11:22:34 +0800 Subject: [PATCH] 2020-05-11-1 --- ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs | 86 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 76 insertions(+), 10 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs index 0a63986..a555e0c 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs @@ -81,7 +81,7 @@ TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, - Height = Application.GetRealHeight(127), + //Height =Application.GetRealHeight(127), Width = Application.GetRealWidth(397), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, TextID = R.MyInternationalizationString.cancel, @@ -95,7 +95,7 @@ TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, TextSize = 14, X = cancelBtn.Right, - Height = Application.GetRealHeight(127), + //Height =Application.GetRealHeight(127), Width = bottomFrame.Width - cancelBtn.Width, BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, TextID = R.MyInternationalizationString.confrim, @@ -223,7 +223,7 @@ TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, - Height = Application.GetRealHeight(127), + // Height = Application.GetRealHeight(127), Width = Application.GetRealWidth(397), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, TextID = R.MyInternationalizationString.cancel, @@ -236,7 +236,7 @@ TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, TextSize = 14, X = cancelBtn.Right, - Height = Application.GetRealHeight(127), + //Height = Application.GetRealHeight(127), Width = bottomFrame.Width - cancelBtn.Width, BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, TextID = R.MyInternationalizationString.confrim, @@ -270,26 +270,27 @@ { if (string.IsNullOrEmpty(editTime.Text)) { - ShowTip(Language.StringByID(R.MyInternationalizationString.timeNull),true); + ShowErrorTip(Language.StringByID(R.MyInternationalizationString.timeNull),true); return; } if (int.Parse(editTime.Text) < 1 || int.Parse(editTime.Text) > 12) { ///闄愬埗杈撳叆鏁板瓧鑼冨洿; string str = Language.StringByID(R.MyInternationalizationString.less) + Language.StringByID(R.MyInternationalizationString.or) + Language.StringByID(R.MyInternationalizationString.more); - ShowTip(str, true); + ShowErrorTip(str, true); return; } - dialog.Close(); action(editTime.Text); - }; + dialog.Close(); + + }; } /// <summary> - /// 鎻愮ず妗� + /// 閿欒鎻愮ず妗� /// </summary> - public static void ShowTip(string tipText,bool _if ) + public static void ShowErrorTip(string tipText,bool _if ) { ///涓绘帶浠� Dialog dialog = new Dialog(); @@ -411,5 +412,70 @@ dialog.Close(); }; } + /// <summary> + /// 闂敊鎻愮ず妗� + /// </summary> + public static void ShowFlashTip(string tipText,int timeValue=1) + { + ///涓绘帶浠� + Dialog dialog = new Dialog(); + dialog.Show(); + ///鑳屾櫙鐨勭埗鎺т欢 + FrameLayout fLayout = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; + dialog.AddChidren(fLayout); + fLayout.MouseUpEventHandler += (sender,e) => { + dialog.Close(); + + }; + ///寮规鐖舵帶浠� + FrameLayout tipFLayout = new FrameLayout + { + X = Application.GetRealWidth(230), + Y = Application.GetRealHeight(717), + Width = Application.GetRealWidth(622), + Height = Application.GetRealHeight(317), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + Radius = (uint)Application.GetRealHeight(17) + }; + fLayout.AddChidren(tipFLayout); + + ///鎻愮ず鎺т欢 + Button tipBtn = new Button + { + Y = Application.GetRealHeight(58), + X = Application.GetRealWidth(150), + Height = Application.GetRealHeight(63), + Width = Application.GetRealWidth(622 - 300), + TextID = R.MyInternationalizationString.tip, + TextAlignment = TextAlignment.Center, + TextColor = ZigbeeColor.Current.LogicTipColor, + TextSize = 16, + + }; + tipFLayout.AddChidren(tipBtn); + ///鏂囨湰鎺т欢 + Button Text1Btn = new Button + { + Y = Application.GetRealHeight(156), + X = Application.GetRealWidth(50), + Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(622 - 100), + Text = tipText, + TextAlignment = TextAlignment.Center, + TextColor = ZigbeeColor.Current.LogicBtnCancelColor, + TextSize = 14, + }; + tipFLayout.AddChidren(Text1Btn); + + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(timeValue*1000); + Application.RunOnMainThread(() => + { + dialog.Close(); + }); + }) + { IsBackground = true }.Start(); + } } } -- Gitblit v1.8.0