| | |
| | | /// <param name="confirmAction">回调函数</param> |
| | | /// <param name="List">被检索列表</param> |
| | | /// <param name="confirmAction">回调函数</param> |
| | | public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, int errorId_PresenceP, List<string> List, Action<string> confirmAction) |
| | | public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, int errorId_PresenceP, List<string> List, Action<string,Dialog> confirmAction, Action action,bool tag=true) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | |
| | | btnCancel.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | action(); |
| | | |
| | | }; |
| | | Button btnTip = new Button |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | confirmAction(editText.Text.Trim()); |
| | | dialog.Close(); |
| | | confirmAction(editText.Text.Trim(),dialog); |
| | | if (tag) { |
| | | dialog.Close(); |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | /// <param name="tnputEditTxet">显示文本</param> |
| | | /// <param name="errorId_IsNullOrEmpty">输入框本文为空自定义提示错误文本</param> |
| | | /// <param name="confirmAction">回调函数</param> |
| | | public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction) |
| | | public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction,Action action) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | |
| | | btnCancel.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | action(); |
| | | |
| | | }; |
| | | |
| | | Button btnTip = new Button |
| | |
| | | /// 确定提示框 |
| | | /// </summary> |
| | | /// <param name="titleId">标题文本</param> |
| | | /// <param name="tipTxet">自定义提示文本</param> |
| | | /// <param name="confirmAction">回调函数</param> |
| | | public void TipBox(int titleId, string tipTxet, Action<Dialog> confirmAction,Action action,bool tag=true) |
| | | { |
| | | 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, |
| | | Text= 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) => |
| | | { |
| | | action(); |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnConfirm.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | confirmAction(dialog); |
| | | if (tag) { |
| | | dialog.Close(); |
| | | } |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 确定提示框 |
| | | /// </summary> |
| | | /// <param name="titleId">标题文本</param> |
| | | /// <param name="tipTxet">自定义提示文本(换行)</param> |
| | | /// <param name="confirmAction">回调函数</param> |
| | | public void TipBox1(int titleId, int tipTxet, Action confirmAction) |