| | |
| | | /// IsDrawerLockMode |
| | | /// </summary> |
| | | public bool IsDrawerLockMode; |
| | | /// <summary> |
| | | /// ProgressBtn |
| | | /// </summary> |
| | | Button ProgressBtn; |
| | | /// <summary> |
| | | /// ProgressBtnY |
| | | /// </summary> |
| | | int ProgressBtnY; |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 接口__________________________ |
| | |
| | | Width = Application.GetRealWidth(271), |
| | | Height = Application.GetRealHeight(533), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | WavePadding = 2, |
| | | WavePadding = Application.GetRealWidth(8), |
| | | MaxValue=100, |
| | | Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100), |
| | | WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor |
| | | }; |
| | | itemView.AddChidren(levelSeekBar); |
| | | |
| | | if (dimmableLight.OnOffStatus==1) |
| | | if (dimmableLight.OnOffStatus == 1) |
| | | { |
| | | levelSeekBar.IsClickable = true; |
| | | levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor; |
| | |
| | | levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor; |
| | | } |
| | | |
| | | levelSeekBar.OnProgressChangedEvent += (send2, e2) => |
| | | levelSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
|
| | | {
|
| | | OnProgressButtonMove(levelSeekBar.Progress);
|
| | | ProgressBtn.Visible = true;
|
| | | };
|
| | |
|
| | | levelSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
|
| | | {
|
| | | ProgressBtn.Visible = false;
|
| | | };
|
| | |
|
| | | levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
|
| | | { |
| | | dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); |
| | | }; |
| | | |
| | | OnProgressButtonMove(e2);
|
| | |
|
| | | //判断是否300ms屏蔽
|
| | | if (levelSeekBar.IsProgressChangeDelay()) return;
|
| | |
|
| | | dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0));
|
| | | };
|
| | |
|
| | | InitProgressBtn(itemView); |
| | | |
| | | switchBtn = new Button() |
| | | { |
| | |
| | | itemView.AddChidren(roomName); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// OnProgressButtonMove
|
| | | /// </summary>
|
| | | private void OnProgressButtonMove(int mProgress)
|
| | | {
|
| | | ProgressBtn.Y = ProgressBtnY + levelSeekBar.NowProgressY;
|
| | | ProgressBtn.Text = mProgress + "%";
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 添加进度按钮
|
| | | /// </summary>
|
| | | private void InitProgressBtn(FrameLayout layout) |
| | | {
|
| | | ProgressBtnY = levelSeekBar.Y - Application.GetMinReal(154);
|
| | | ProgressBtn = new Button()
|
| | | {
|
| | | Y = ProgressBtnY,
|
| | | Width = Application.GetMinReal(135),
|
| | | Height = Application.GetMinReal(104),
|
| | | UnSelectedImagePath = "Item/ProgressBubbles.png",
|
| | | Visible = false,
|
| | | Gravity = Gravity.CenterHorizontal
|
| | | };
|
| | | layout.AddChidren(ProgressBtn);
|
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 绑定按钮_______________________ |