| | |
| | | /// <summary> |
| | | /// SeekBar |
| | | /// </summary> |
| | | public HorizontalSeekBar SeekBar; |
| | | public DiyImageSeekBar SeekBar; |
| | | /// <summary> |
| | | /// SeekBarTitle |
| | | /// </summary> |
| | |
| | | }; |
| | | AddChidren(ClickButton); |
| | | |
| | | SeekBar = new HorizontalSeekBar() |
| | | SeekBar = new DiyImageSeekBar() |
| | | { |
| | | X = Application.GetRealWidth(81), |
| | | Y = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(919), |
| | | Height = Application.GetRealHeight(127), |
| | | BackgroundColor = ZigbeeColor.Current.GXCSeekBarBackground, |
| | | ProgressColor = ZigbeeColor.Current.GXCProgressColor, |
| | | ThumbColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Max = MaxLevel, |
| | | Progress = MaxLevel |
| | | ProgressBarColor = ZigbeeColor.Current.GXCProgressColor, |
| | | MaxValue = MaxLevel, |
| | | Progress = MaxLevel, |
| | | IsProgressTextShow = false, |
| | | IsClickable = true, |
| | | ThumbImageHeight=Application.GetMinRealAverage(80), |
| | | SeekBarViewHeight=Application.GetRealHeight(6), |
| | | ThumbImagePath="Item/SeekBarIcon.png" |
| | | }; |
| | | AddChidren(SeekBar); |
| | | |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = $"{(int)(SeekBar.Progress * 1.0 / MaxLevel * 100)} %", |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextSize=12 |
| | | TextSize = 12, |
| | | IsBold = true |
| | | }; |
| | | AddChidren(SeekBarTitle); |
| | | |
| | |
| | | SelectBtn.Visible = statu; |
| | | if(statu) |
| | | { |
| | | SetProgress(100); |
| | | SetSeekBarProgress(SeekBar.Progress == 0 ? MaxLevel : SeekBar.Progress); |
| | | } |
| | | else |
| | | { |
| | | SetProgress(0); |
| | | SetSeekBarProgress(0); |
| | | } |
| | | } |
| | | |
| | |
| | | /// SetProgress |
| | | /// </summary> |
| | | /// <param name="progress"></param> |
| | | public void SetProgress(int progress) |
| | | public void SetSeekBarProgress(int progress) |
| | | { |
| | | SeekBar.Progress = progress; |
| | | SetSeekBarTitle(); |