| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 确定提示框 |
| | | /// </summary> |
| | | /// <param name="titleId">标题文本</param> |
| | | /// <param name="tipTxet">自定义提示文本</param> |
| | | /// <param name="confirmAction">回调函数</param> |
| | | public void TipBox1(int titleId, int tipTxet, Action confirmAction) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = MusicColor.PopupBackgroundColor, |
| | | }; |
| | | |
| | | FrameLayout whiteView = new FrameLayout() |
| | | { |
| | | //Gravity = Gravity.Center, |
| | | X = Application.GetRealWidth(53), |
| | | Y = Application.GetRealHeight(264), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | BorderColor = 0x00000000, |
| | | 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 = MusicColor.SelectedColor, |
| | | 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 + 15), |
| | | Width = Application.GetRealWidth(270 - 20 * 2), |
| | | TextColor = MusicColor.TextCancelColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = Language.StringByID(tipTxet).Replace("{\\r\\n}", "\r\n"), |
| | | IsMoreLines = true, |
| | | }; |
| | | whiteView.AddChidren(tipBtn); |
| | | |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | Y = whiteView.Height - Application.GetRealHeight(44 + 1), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = MusicColor.LineColor, |
| | | }; |
| | | whiteView.AddChidren(btnLine); |
| | | |
| | | Button btnCancel = new Button() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Width = Application.GetRealWidth(135), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = MusicColor.TextCancelColor, |
| | | 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 = MusicColor.WhiteColor, |
| | | IsBold = true, |
| | | TextSize = TextSize.Text16, |
| | | TextID = StringId.confirmMusic, |
| | | BackgroundColor = MusicColor.SelectedColor, |
| | | 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(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |