| | |
| | | /// IsDrawerLockMode |
| | | /// </summary> |
| | | public bool IsDrawerLockMode; |
| | | /// <summary> |
| | | /// ProgressBtn |
| | | /// </summary> |
| | | Button ProgressBtn; |
| | | /// <summary> |
| | | /// ProgressBtnY |
| | | /// </summary> |
| | | int ProgressBtnY; |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 接口__________________________ |
| | |
| | | } |
| | | dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | switchBtn.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | StatuBtn.Text = CommonFormResouce.GetSwitchStatu(switchBtn.IsSelected); |
| | | StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}"; |
| | | |
| | | if (switchBtn.IsSelected == true) |
| | | { |
| | | levelSeekBar.IsClickable = true; |
| | |
| | | dimmableLight.Level = attriButeList[0].AttriButeData; |
| | | dimmableLight.LastDateTime = DateTime.Now; |
| | | levelSeekBar.Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100); |
| | | StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}"; |
| | | |
| | | break; |
| | | } |
| | | } |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = device.CommonDevice.DeviceEpointName, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15 |
| | | TextSize = 15, |
| | | IsBold=true |
| | | }; |
| | | itemView.AddChidren(deviceNameBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1) |
| | | Text = dimmableLight.Level>0?$"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" :$"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}", |
| | | TextSize=10 |
| | | }; |
| | | |
| | | itemView.AddChidren(StatuBtn); |
| | | |
| | | levelSeekBar = new WaveSeekBar() |
| | |
| | | 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 |
| | | WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor, |
| | | CornerRadius= Application.GetRealHeight(58) |
| | | }; |
| | | |
| | | itemView.AddChidren(levelSeekBar); |
| | | |
| | | if (dimmableLight.OnOffStatus == 1) |
| | |
| | | levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor; |
| | | } |
| | | |
| | | levelSeekBar.OnStartTrackingTouchEvent += (sender, e) => |
| | | { |
| | | OnProgressButtonMove(levelSeekBar.Progress); |
| | | levelSeekBar.IsProgressTextShow = false; |
| | | ProgressBtn.Visible = true; |
| | | }; |
| | | |
| | | levelSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | ProgressBtn.Visible = false; |
| | | levelSeekBar.IsProgressTextShow = true; |
| | | }; |
| | | |
| | | levelSeekBar.OnProgressChangedEvent += (send2, e2) => |
| | | { |
| | | |
| | | OnProgressButtonMove(e2); |
| | | |
| | | //判断是否300ms屏蔽 |
| | | if (levelSeekBar.IsProgressChangeDelay()) return; |
| | | |
| | | dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); |
| | | }; |
| | | |
| | | InitProgressBtn(itemView); |
| | | |
| | | switchBtn = new Button() |
| | | { |
| | |
| | | Height = Application.GetRealHeight(50), |
| | | Text = room.Name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextSize = 12 |
| | | }; |
| | | 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 |
| | |
| | | private void Switch_MouseUpEvent(object sender, MouseEventArgs eventArgs) |
| | | { |
| | | switchBtn.IsSelected = !switchBtn.IsSelected; |
| | | StatuBtn.Text = CommonFormResouce.GetSwitchStatu(switchBtn.IsSelected); |
| | | StatuBtn.Text = switchBtn.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.CurrentLightLevel)} { device.GetDeviceStatu()}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}"; |
| | | if (switchBtn.IsSelected == true) |
| | | { |
| | | dimmableLight.SwitchControl(1); |