File was renamed from ZigbeeApp/Shared/Phone/Common/Controls/CompoundControls/ProgressFormBar.cs |
| | |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Shared.Phone |
| | | namespace Shared.Phone.UserCenter |
| | | { |
| | | /// <summary> |
| | | /// 界面类型的进度条控件 |
| | |
| | | /// </summary> |
| | | private NormalViewControl btnText = null; |
| | | /// <summary> |
| | | /// 标题控件 |
| | | /// </summary> |
| | | private NormalViewControl btnTitle = null; |
| | | /// <summary> |
| | | /// 进度条控件 |
| | | /// </summary> |
| | | private ProgressRowBar btnProgressBar = null; |
| | |
| | | /// <summary> |
| | | /// 初始化进度条 |
| | | /// </summary> |
| | | private void InitProgressFormBar(bool i_hadTitle) |
| | | private void InitProgressFormBar() |
| | | { |
| | | //拥有标题时,扩大的高度 |
| | | int titleValue = 40; |
| | | |
| | | //安卓可以点击系统的返回键 |
| | | this.oldScrollEnabled = UserView.HomePage.Instance.ScrollEnabled; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | Common.Config.Instance.BackKeyCanClick = false; |
| | | Shared.Common.CommonPage.BackKeyCanClick = false; |
| | | |
| | | this.oldPrigressVisible = Common.CommonPage.Loading.Visible; |
| | | if (oldPrigressVisible == true) |
| | |
| | | Common.CommonPage.Instance.AddChidren(bodyFrameLayout); |
| | | |
| | | var frameBack = new FrameLayout(); |
| | | if (i_hadTitle == false) |
| | | { |
| | | frameBack.Y = Application.GetRealHeight(683); |
| | | frameBack.Height = Application.GetRealHeight(386); |
| | | } |
| | | else |
| | | { |
| | | frameBack.Y = Application.GetRealHeight(683 + titleValue / 2); |
| | | frameBack.Height = Application.GetRealHeight(386 + titleValue); |
| | | } |
| | | frameBack.Width = Application.GetRealWidth(674); |
| | | frameBack.Height = Application.GetRealHeight(386); |
| | | frameBack.BackgroundColor = UserCenterColor.Current.White; |
| | | frameBack.Gravity = Gravity.CenterHorizontal; |
| | | frameBack.Y = Application.GetRealHeight(683); |
| | | frameBack.Radius = (uint)Application.GetRealHeight(17); |
| | | bodyFrameLayout.AddChidren(frameBack); |
| | | |
| | | //进度显示文本 |
| | | this.btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false); |
| | | btnTitle.Y = Application.GetRealHeight(40); |
| | | btnTitle.TextColor = UserCenterColor.Current.TextGrayColor1; |
| | | btnTitle.TextAlignment = TextAlignment.Center; |
| | | frameBack.AddChidren(btnTitle); |
| | | |
| | | //进度显示文本 |
| | | this.btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false); |
| | | if (i_hadTitle == false) |
| | | { |
| | | btnText.Y = Application.GetRealHeight(248); |
| | | } |
| | | else |
| | | { |
| | | btnText.Y = Application.GetRealHeight(248 + titleValue); |
| | | } |
| | | btnText.Y = Application.GetRealHeight(248); |
| | | btnText.TextColor = UserCenterColor.Current.TextGrayColor1; |
| | | btnText.TextAlignment = TextAlignment.Center; |
| | | frameBack.AddChidren(btnText); |
| | |
| | | //进度条 |
| | | this.btnProgressBar = new ProgressRowBar(559, 29); |
| | | btnProgressBar.Gravity = Gravity.CenterHorizontal; |
| | | if (i_hadTitle == false) |
| | | { |
| | | btnProgressBar.Y = Application.GetRealHeight(161); |
| | | } |
| | | else |
| | | { |
| | | btnProgressBar.Y = Application.GetRealHeight(161 + titleValue); |
| | | } |
| | | btnProgressBar.Y = Application.GetRealHeight(161); |
| | | frameBack.AddChidren(btnProgressBar); |
| | | btnProgressBar.StartMode1(true); |
| | | } |
| | |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | btnText.Text = msg; |
| | | }, ShowErrorMode.NO); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置标题信息 |
| | | /// </summary> |
| | | /// <param name="i_title"></param> |
| | | public void SetTitle(string i_title) |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | btnTitle.Text = i_title; |
| | | }, ShowErrorMode.NO); |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 开启进度条 |
| | | /// </summary> |
| | | /// <param name="i_hadTitle">是否拥有标题</param> |
| | | public void Start(bool i_hadTitle = false) |
| | | public void Start() |
| | | { |
| | | if (this.bodyFrameLayout == null) |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | //初始化进度条 |
| | | this.InitProgressFormBar(i_hadTitle); |
| | | this.InitProgressFormBar(); |
| | | }, ShowErrorMode.NO); |
| | | } |
| | | } |
| | |
| | | //如果它原来就是不可以滑动的话,不处理 |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | } |
| | | Common.Config.Instance.BackKeyCanClick = true; |
| | | Shared.Common.CommonPage.BackKeyCanClick = true; |
| | | if (this.oldPrigressVisible == true) |
| | | { |
| | | //如果原来的进度条是可见的话,还原回去 |