| | |
| | | //彩灯控件
|
| | | this.waveSeekBar = new WaveSeekBar();
|
| | | waveSeekBar.Y = Application.GetRealHeight(377);
|
| | | waveSeekBar.Width = Application.GetMinRealAverage(271);
|
| | | waveSeekBar.Height = Application.GetMinRealAverage(533);
|
| | | waveSeekBar.Width = this.GetPictrueRealSize(271);
|
| | | waveSeekBar.Height = this.GetPictrueRealSize(533);
|
| | | waveSeekBar.Gravity = Gravity.CenterHorizontal;
|
| | | waveSeekBar.WavePadding = Application.GetRealWidth(8);
|
| | | waveSeekBar.MaxValue = 100;
|
| | |
| | | //变更进度百分比的显示
|
| | | btnProgress.Y = progressY + waveSeekBar.NowProgressY;
|
| | | btnProgress.Text = value + "%";
|
| | | nowProgressValue = value;
|
| | | if (Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | nowProgressValue = value;
|
| | | }
|
| | | else
|
| | | {
|
| | | //如果住宅为虚拟住宅,直接改缓存
|
| | | ((DimmableLight)this.device).Level = value;
|
| | | }
|
| | | };
|
| | |
|
| | | if (this.hadInitControl == true)
|
| | |
| | | /// <param name="isOpen"></param>
|
| | | private void SetSwitchCommand(bool isOpen)
|
| | | {
|
| | | //如果住宅是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
|
| | | //刷新开关状态
|
| | | this.RefreshSwitchStatu(isOpen);
|
| | | return;
|
| | | }
|
| | |
|
| | | //当按下开关按钮时,不能再发送进度值
|
| | | this.canSetProgressValue = false;
|
| | |
|
| | |
| | | });
|
| | | });
|
| | |
|
| | | //状态取反
|
| | | listControl[0].IsSelected = !listControl[0].IsSelected;
|
| | | //发送等待的时间内,不能滑动彩灯控件
|
| | | waveSeekBar.IsClickable = false;
|
| | | //状态取反
|
| | | listControl[0].IsSelected = !listControl[0].IsSelected;
|
| | | if (isOpen == true)
|
| | | {
|
| | | waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End);
|
| | | }
|
| | | else
|
| | | {
|
| | | waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
|
| | | }
|
| | |
|
| | | if (isOpen == true)
|
| | | {
|
| | | //打开
|
| | | this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
|
| | | this.device.SwitchControl(1);
|
| | | }
|
| | | else
|
| | | {
|
| | | waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
|
| | | //关闭
|
| | | this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
|
| | | this.device.SwitchControl(0);
|