| | |
| | | { |
| | | Y = topFrame.Bottom, |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(127), |
| | | Height = Application.GetRealHeight(127),
|
| | | Gravity = Gravity.BottomCenter, |
| | | }; |
| | | tipFLayout.AddChidren(bottomFrame); |
| | | |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | Height = bottomFrame.Height, |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | | TextID = R.MyInternationalizationString.cancel,
|
| | | }; |
| | | bottomFrame.AddChidren(cancelBtn); |
| | | cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft); |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | Height = bottomFrame.Height, |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | |
| | | Y = Application.GetRealHeight(69), |
| | | X = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetRealWidth(492), |
| | | Width = Application.GetRealWidth(492),
|
| | | TextID = R.MyInternationalizationString.invalidSetting, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicTipColor, |
| | |
| | | Y = topFrame.Bottom, |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(127), |
| | | Gravity=Gravity.BottomCenter, |
| | | }; |
| | | tipFLayout.AddChidren(bottomFrame); |
| | | ///取消控件 |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | Height = bottomFrame.Height, |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | Height = bottomFrame.Height, |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | | }; |
| | | bottomFrame.AddChidren(okBtn); |
| | | |
| | | if (_if) { |
| | | if (_if) {
|
| | | cancelBtn.X = Application.GetRealWidth(0); |
| | | cancelBtn.Width = Application.GetRealWidth(0); |
| | | okBtn.X = Application.GetRealWidth(0); |
| | |
| | | { |
| | | 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) |
| | | if (int.Parse(editTime.Text) < 1 || int.Parse(editTime.Text) > 12|| int.Parse(editTime.Text)>(int.MaxValue-1)) |
| | | { ///限制输入数字范围; |
| | | 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(); |
| | |
| | | Y = topFrame.Bottom, |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(127), |
| | | Gravity = Gravity.BottomCenter, |
| | | }; |
| | | tipFLayout.AddChidren(bottomFrame); |
| | | ///取消控件 |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | Height = bottomFrame.Height, |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | Height = bottomFrame.Height, |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |