From adb12dcdbb2ddaeac687c3aa9e57bb7ed459ab7e Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期三, 24 六月 2020 15:26:46 +0800 Subject: [PATCH] 2020.06.24.01 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 86 ++++-------------------------------------- 1 files changed, 9 insertions(+), 77 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs index 539ff34..3349ea3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs @@ -46,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> @@ -94,11 +82,6 @@ bodyFrameLayout = new FrameLayout(); bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor; Common.CommonPage.Instance.AddChidren(bodyFrameLayout); - //var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1); - //if (nowForm != null && (nowForm is ViewGroup) == true) - //{ - // ((ViewGroup)nowForm).AddChidren(bodyFrameLayout); - //} var frameBack = new FrameLayout(); frameBack.Width = Application.GetRealWidth(674); @@ -121,38 +104,11 @@ }; //杩涘害鏉� - 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.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, 45, 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 @@ -181,7 +137,7 @@ /// <param name="value">姝ゅ�间负鐧惧垎姣斿��(涔熷氨鏄皬浜庢垨鑰呯瓑浜�1鐨�)</param> public void SetValue(decimal value) { - this.SetValueEx(value); + this.btnProgressBar.SetValue(value); } /// <summary> @@ -191,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 @@ -261,8 +195,6 @@ bodyFrameLayout?.RemoveFromParent(); bodyFrameLayout = null; btnText = null; - btnProgressView = null; - frameProgress = null; btnProgressBar = null; this.MsgClickEvent = null; //鍏抽棴浜嬩欢 -- Gitblit v1.8.0