From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 103 +++++++++++++-------------------------------------- 1 files changed, 27 insertions(+), 76 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs index a1e6520..3349ea3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs @@ -29,7 +29,14 @@ return m_Current; } } - + /// <summary> + /// 娑堟伅鎺т欢鍗曞嚮鐨勪簨浠� + /// </summary> + public Action MsgClickEvent = null; + /// <summary> + /// 鐣岄潰鍏抽棴鐨勪簨浠� + /// </summary> + public Action CloseEvent = null; /// <summary> /// 瀹瑰櫒鎺т欢 /// </summary> @@ -39,21 +46,9 @@ /// </summary> private NormalViewControl btnText = null; /// <summary> - /// 杩涘害鍊兼枃鏈殑鏄剧ず鎺т欢 + /// 杩涘害鏉℃帶浠� /// </summary> - private NormalViewControl btnProgressView = null; - /// <summary> - /// 杩涘害鍊艰兘澶熺Щ鍔ㄧ殑閭d釜妗嗘帶浠� - /// </summary> - private FrameLayout frameProgress = null; - /// <summary> - /// 杩涘害鏉� - /// </summary> - private FrameLayout btnProgressBar = null; - /// <summary> - /// 杩涘害鏉″鍣ㄧ殑鏈�澶у搴� - /// </summary> - private int ProRowWidth = 0; + private ProgressRowBar btnProgressBar = null; /// <summary> /// 鍘熸潵鐨勬粦鍔ㄦ爣璇� /// </summary> @@ -76,13 +71,13 @@ this.oldScrollEnabled = UserView.HomePage.Instance.ScrollEnabled; UserView.HomePage.Instance.ScrollEnabled = false; Shared.Common.CommonPage.BackKeyCanClick = false; + this.oldPrigressVisible = Common.CommonPage.Loading.Visible; if (oldPrigressVisible == true) { //鍦嗗舰杩涘害鏉′复鏃跺叧闂� Common.CommonPage.Loading.Hide(); } - //瀹瑰櫒 bodyFrameLayout = new FrameLayout(); bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor; @@ -94,7 +89,7 @@ frameBack.BackgroundColor = UserCenterColor.Current.White; frameBack.Gravity = Gravity.CenterHorizontal; frameBack.Y = Application.GetRealHeight(683); - frameBack.Radius = 6; + frameBack.Radius = (uint)Application.GetRealHeight(17); bodyFrameLayout.AddChidren(frameBack); //杩涘害鏄剧ず鏂囨湰 @@ -103,41 +98,17 @@ btnText.TextColor = UserCenterColor.Current.TextGrayColor1; btnText.TextAlignment = TextAlignment.Center; frameBack.AddChidren(btnText); + btnText.ButtonClickEvent += (sender, e) => + { + this.MsgClickEvent?.Invoke(); + }; //杩涘害鏉� - var btnProRow = new FrameLayout(); - btnProRow.Gravity = Gravity.CenterHorizontal; - btnProRow.Y = Application.GetRealHeight(161); - btnProRow.Width = Application.GetRealWidth(559); - btnProRow.Height = Application.GetRealHeight(29); - btnProRow.BackgroundColor = 0xfff5f5f5; - btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2; - frameBack.AddChidren(btnProRow); - this.btnProgressBar = new FrameLayout(); - btnProgressBar.Width = 0; - btnProgressBar.Height = btnProRow.Height; - btnProgressBar.Radius = btnProRow.Radius; - btnProgressBar.BackgroundColor = 0xfffb744a; - btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2; - btnProRow.AddChidren(btnProgressBar); - - //杩涘害鍊兼枃鏈� - this.frameProgress = new FrameLayout(); - frameProgress.Width = Application.GetRealWidth(84); - frameProgress.Height = Application.GetRealHeight(60); - frameProgress.Y = Application.GetRealHeight(86); - frameBack.AddChidren(frameProgress); - frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2; - var btnProgressPic = new PicViewControl(84, 60); - btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png"; - frameProgress.AddChidren(btnProgressPic); - this.btnProgressView = new NormalViewControl(84, 32, true); - btnProgressView.TextSize = 10; - btnProgressView.TextAlignment = TextAlignment.Center; - btnProgressView.Text = "0%"; - frameProgress.AddChidren(btnProgressView); - - this.ProRowWidth = btnProRow.Width; + this.btnProgressBar = new ProgressRowBar(559, 29); + btnProgressBar.Gravity = Gravity.CenterHorizontal; + btnProgressBar.Y = Application.GetRealHeight(161); + frameBack.AddChidren(btnProgressBar); + btnProgressBar.StartMode1(true); } #endregion @@ -166,7 +137,7 @@ /// <param name="value">姝ゅ�间负鐧惧垎姣斿��(涔熷氨鏄皬浜庢垨鑰呯瓑浜�1鐨�)</param> public void SetValue(decimal value) { - this.SetValueEx(value); + this.btnProgressBar.SetValue(value); } /// <summary> @@ -176,29 +147,7 @@ /// <param name="maxValue">鏈�澶у��</param> public void SetValue(decimal value, decimal maxValue) { - decimal result = value / maxValue; - this.SetValueEx(result); - } - - /// <summary> - /// 璁剧疆杩涘害鍊� - /// </summary> - /// <param name="value"></param> - private void SetValueEx(decimal value) - { - if (btnProgressBar == null) - { - return; - } - HdlThreadLogic.Current.RunMain(() => - { - int width = (int)(value * ProRowWidth); - btnProgressBar.Width = width; - //鏂囨湰鏄剧ず - btnProgressView.Text = ((int)(value * 100)) + "%"; - //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩 - frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2; - }); + this.btnProgressBar.SetValue(value, maxValue); } #endregion @@ -246,9 +195,11 @@ bodyFrameLayout?.RemoveFromParent(); bodyFrameLayout = null; btnText = null; - btnProgressView = null; - frameProgress = null; btnProgressBar = null; + this.MsgClickEvent = null; + //鍏抽棴浜嬩欢 + this.CloseEvent?.Invoke(); + this.CloseEvent = null; }); } -- Gitblit v1.8.0