| | |
| | | /// StopBtn |
| | | /// </summary> |
| | | public Button StopBtn; |
| | | /// <summary> |
| | | /// 开合帘 |
| | | /// </summary> |
| | | private CurtainSeekBar curtainSeekBar = new CurtainSeekBar { }; |
| | | /// <summary> |
| | | /// 卷帘 |
| | | /// </summary> |
| | | private CurtainRollSeekBar curtainRollSeekBar = new CurtainRollSeekBar { }; |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 接口___________________________ |
| | |
| | | rollerShade.DeviceStatusReport = common.DeviceStatusReport; |
| | | rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} { deviceUI.GetDeviceStatu()}"; |
| | | if(rollerShade.WcdType==0) |
| | | { |
| | | curtainRollSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage; |
| | | } |
| | | else if(rollerShade.WcdType==4) |
| | | { |
| | | curtainSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage; |
| | | } |
| | | //SeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage; |
| | | //seekBarTitle.Text = $"{SeekBar.Progress} %"; |
| | | rollerShade.LastDateTime = DateTime.Now; |
| | |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | var sharedBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(850), |
| | | Width = Application.GetMinReal(69), |
| | | Height = Application.GetMinReal(69), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Shared.png" |
| | | }; |
| | | top.topView.AddChidren(sharedBtn); |
| | | |
| | | var moreBtn = new Button |
| | | { |
| | |
| | | (device.CommonDevice as Rollershade).CurtainUpDownStopControl(1); |
| | | }; |
| | | |
| | | SetRollerShadeIcon((device.CommonDevice as Rollershade).WcdType); |
| | | if ((device.CommonDevice as Rollershade).WcdType == -1) |
| | | { |
| | | CommonPage.Loading.Start(); |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | SetCurtainType(itemView, (device.CommonDevice as Rollershade).WcdType); |
| | | |
| | | var roomBG = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1178 - 50), |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SetCurtainType |
| | | /// </summary> |
| | | /// <param name="layout"></param> |
| | | /// <param name="type"></param> |
| | | private void SetCurtainType(FrameLayout layout, int type) |
| | | { |
| | | SetRollerShadeIcon(type); |
| | | SetRollerSeekBar(layout, type); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WcdType=4:开合帘 |
| | | /// WcdType=0:卷帘 |
| | | /// </summary> |
| | | /// <param name="type"></param> |
| | | public void SetRollerShadeIcon(int type) |
| | | private void SetRollerShadeIcon(int type) |
| | | { |
| | | if (type == 0) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SetRollerSeekBar |
| | | /// </summary> |
| | | /// <param name="layout"></param> |
| | | /// <param name="type"></param> |
| | | private void SetRollerSeekBar(FrameLayout layout,int type) |
| | | { |
| | | if(type == 0) |
| | | { |
| | | curtainRollSeekBar.Y = Application.GetRealHeight(300); |
| | | curtainRollSeekBar.Width = Application.GetRealWidth(438); |
| | | curtainRollSeekBar.Height = Application.GetRealHeight(576); |
| | | curtainRollSeekBar.Gravity = Gravity.CenterHorizontal; |
| | | curtainRollSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage; |
| | | layout.AddChidren(curtainRollSeekBar); |
| | | |
| | | curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress); |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | curtainSeekBar.Y = Application.GetRealHeight(334); |
| | | curtainSeekBar.Width = Application.GetRealWidth(570); |
| | | curtainSeekBar.Height = Application.GetRealHeight(513); |
| | | curtainSeekBar.Gravity = Gravity.CenterHorizontal; |
| | | layout.AddChidren(curtainSeekBar); |
| | | |
| | | curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 收藏到主页_______________________ |