From efad979b6fae76fb37a4de7e94e6bac0a85cb72c Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 30 十一月 2021 13:14:28 +0800
Subject: [PATCH] 2021-11-30 1.修复乐橙Android,没调用拒接接口问题。

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs |  506 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 505 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs
index 5d70028..9a2280b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/TipView.cs
@@ -15,6 +15,186 @@
         /// 灏忔鍦嗚鍊�
         /// </summary>
         public int radiusEditFrameLayout = 4;
+        /// <summary>
+        /// 杈撳叆妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tnputEditTxet">鏄剧ず鏂囨湰</param>
+        /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘枃鏈负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
+        /// <param name="errorId_PresenceP">妫�绱㈠凡瀛樺湪鍚嶇О鑷畾涔夋彁绀洪敊璇枃鏈�</param>
+        /// <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, 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(172),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button btnTitle = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(200),
+                TextColor = CSS_Color.textConfirmColor,
+                TextSize = TextSize.Text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+
+            };
+            whiteView.AddChidren(btnTitle);
+
+            FrameLayout editBjView = new FrameLayout()
+            {
+                // Gravity = Gravity.CenterHorizontal,
+                Y = btnTitle.Bottom + Application.GetRealHeight(16),
+                X = Application.GetRealWidth(24),
+                Width = Application.GetRealWidth(222),
+                Height = Application.GetRealHeight(40),
+                BackgroundColor = CSS_Color.viewMiddle,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout),
+            };
+            whiteView.AddChidren(editBjView);
+
+            EditText editText = new EditText()
+            {
+                X = Application.GetRealWidth(12),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(160),
+                Height = Application.GetRealHeight(20),
+                Text = tnputEditTxet,
+                TextColor = CSS_Color.textColor,
+                TextSize = TextSize.Text14,
+                TextAlignment = TextAlignment.CenterLeft,
+
+            };
+            editBjView.AddChidren(editText);
+
+            Button clearIconBtn = new Button
+            {
+                X = Application.GetRealWidth(194),
+                Y = Application.GetRealHeight(8),
+                Width = Application.GetRealWidth(24),
+                Height = Application.GetRealWidth(24),
+                UnSelectedImagePath = "MusicIcon/clear.png",
+            };
+            editBjView.AddChidren(clearIconBtn);
+            clearIconBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                editText.Text = "";
+            };
+
+            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) =>
+            {
+                dialog.Close();
+                action();
+
+            };
+            Button btnTip = new Button
+            {
+                Width = Application.GetRealWidth(0),
+            };
+            whiteView.AddChidren(btnTip);//涓�鐩撮敊璇紝涓�鐩寸寷鐐癸紝涓�鐩村姞鎺т欢
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                string listNameText = editText.Text.Trim();
+                if (string.IsNullOrEmpty(listNameText) || List.Contains(listNameText))
+                {
+                    string tipMsgString = "";
+                    if (string.IsNullOrEmpty(editText.Text.Trim()))
+                    {
+                        tipMsgString = Language.StringByID(errorId_IsNullOrEmpty);
+                    }
+                    else
+                    {
+                        tipMsgString = Language.StringByID(errorId_PresenceP);
+                    }
+
+                    whiteView.Height = Application.GetRealHeight(183);
+                    btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
+                    btnCancel.Y = btnLine.Bottom;
+                    btnCancel.Gravity = Gravity.BottomLeft;
+                    btnConfirm.Y = btnLine.Bottom;
+                    btnConfirm.Gravity = Gravity.BottomRight;
+
+                    btnTip.X = Application.GetRealWidth(24);
+                    btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
+                    btnTip.Width = Application.GetRealWidth(222);
+                    btnTip.Height = Application.GetRealHeight(17);
+                    btnTip.Text = tipMsgString;
+                    btnTip.TextColor = CSS_Color.textRedColor;
+                    btnTip.TextSize = TextSize.Text12;
+                    btnTip.TextAlignment = TextAlignment.CenterLeft;
+
+                    return;
+                }
+
+
+                confirmAction(editText.Text.Trim(), dialog);
+                if (tag)
+                {
+                    dialog.Close();
+                }
+            };
+
+        }
 
         /// <summary>
         /// 杈撳叆妗�
@@ -171,9 +351,333 @@
 
         }
 
+        /// <summary>
+        /// 杈撳叆妗�
+        /// </summary>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void InputBox(FrameLayout frameLayout,string tnputEditTxet, Action<string, FrameLayout> confirmAction, bool if_bool = true)
+        {
+            FrameLayout frame = new FrameLayout() 
+            {
+                BackgroundColor = MusicColor.PopupBackgroundColor,
+            };
+            frameLayout.AddChidren(frame);
+            FrameLayout whiteView = new FrameLayout()
+            {
+                //Gravity = Gravity.Center,
+                X = Application.GetRealWidth(53),
+                Y = Application.GetRealHeight(264),
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(201),
+                BackgroundColor = MusicColor.WhiteColor,
+                BorderColor = 0x00000000,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            frame.AddChidren(whiteView);
 
-       
+            Button btnTitle = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(200),
+                TextColor = MusicColor.SelectedColor,
+                TextSize = TextSize.Text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = StringId.shuruyaokongqimingcheng,
+
+            };
+            whiteView.AddChidren(btnTitle);
+
+            FrameLayout editBjView = new FrameLayout()
+            {
+                // Gravity = Gravity.CenterHorizontal,
+                Y = btnTitle.Bottom + Application.GetRealHeight(16),
+                X = Application.GetRealWidth(24),
+                Width = Application.GetRealWidth(222),
+                Height = Application.GetRealHeight(40),
+                BackgroundColor = MusicColor.ViewColor,
+                BorderColor = 0x00000000,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetMinRealAverage(radiusEditFrameLayout),
+            };
+            whiteView.AddChidren(editBjView);
+
+            EditText editText = new EditText()
+            {
+                X = Application.GetRealWidth(12),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(160),
+                Height = Application.GetRealHeight(20),
+                Text = tnputEditTxet,
+                TextColor = MusicColor.TextColor,
+                TextSize = TextSize.Text14,
+                TextAlignment = TextAlignment.CenterLeft,
+            };
+            editBjView.AddChidren(editText);
+
+            Button clearIconBtn = new Button
+            {
+                X = Application.GetRealWidth(194),
+                Y = Application.GetRealHeight(8),
+                Width = Application.GetRealWidth(24),
+                Height = Application.GetRealWidth(24),
+                UnSelectedImagePath = "MusicIcon/clear.png",
+            };
+            editBjView.AddChidren(clearIconBtn);
+            clearIconBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                editText.Text = "";
+            };
 
 
+            Button btnTipText = new Button
+            {
+                X = Application.GetRealWidth(24),
+                Y = editBjView.Bottom + Application.GetRealHeight(12),
+                Width = Application.GetRealWidth(211),
+                Height = Application.GetRealHeight(35),
+                Text = Language.StringByID(StringId.fengleichazhao).Replace("{\\r\\n}", "\r\n"),
+                IsMoreLines = true,
+                TextColor = MusicColor.MusicNoTxetColor,
+                TextSize = TextSize.Text12,
+                TextAlignment = TextAlignment.CenterLeft,
+            };
+            whiteView.AddChidren(btnTipText);
+
+            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);
+            btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                frame.RemoveFromParent();
+            };
+
+
+
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                if (string.IsNullOrEmpty(editText.Text.Trim()))
+                {
+                    return;
+                }
+                confirmAction(editText.Text.Trim(), frame);
+                if (if_bool)
+                {
+                    frame.RemoveFromParent();
+                }
+            };
+
+        }
+
+        /// <summary>
+        /// 纭畾鎻愮ず妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void TipBox(int titleId, int tipTxet, Action confirmAction)
+        {
+            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,
+                TextID = 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) =>
+            {
+                dialog.Close();
+            };
+
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                confirmAction();
+                dialog.Close();
+            };
+
+        }
+        /// <summary>
+        /// 閿欒淇℃伅鎻愮ず绐楀彛锛屾墜鍔ㄧ‘瀹氬叧闂�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="msgId">鎻愮ず閿欒鏂囨湰</param>
+        public void TipBox(int titleId, int msgId)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = CSS_Color.viewTrans60lucence,
+            };
+
+            FrameLayout contentView = new FrameLayout()
+            {
+                Gravity = Gravity.Center,
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(140),
+                BackgroundColor = CSS.CSS_Color.MainBackgroundColor,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(contentView);
+
+            Button btnTitle = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                Height = Application.GetRealHeight(22),
+                TextColor = CSS_Color.MainColor,
+                TextSize =TextSize.Text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+            };
+            contentView.AddChidren(btnTitle);
+
+            Button btnMsg = new Button()
+            {
+                Height = Application.GetRealHeight(17),
+                Y = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                TextSize = TextSize.Text12,
+                TextID = msgId,
+            };
+            contentView.AddChidren(btnMsg);
+
+            Button btnLine = new Button()
+            {
+                Y = Application.GetRealHeight(96),
+                Height = Application.GetRealHeight(1),
+                BackgroundColor = CSS_Color.viewLine,
+            };
+            contentView.AddChidren(btnLine);
+
+            Button btnConfirm = new Button()
+            {
+                Y = btnLine.Bottom,
+                Height = Application.GetRealHeight(43),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.MainColor,
+                TextSize = TextSize.Text16,
+                TextID = StringId.Close,
+            };
+            contentView.AddChidren(btnConfirm);
+            dialog.Show();
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                dialog.Close();
+            };
+
+        }
     }
 }

--
Gitblit v1.8.0