| | |
| | | /// 进度值改变,如果要设置初始进度值,此变量要在设置初始进度值之前进行设置(第一个参数0:滑动的时候,1:手指弹起的时候)
|
| | | /// </summary>
|
| | | public Action<int, int> ProgressChangedEvent = null;
|
| | | /// <summary>
|
| | | /// 进度条事件的触发时间间隔(默认没有间隔,单位为毫秒)
|
| | | /// </summary>
|
| | | public int EventWaitTime = -1;
|
| | | /// <summary>
|
| | | /// 前回时间
|
| | | /// </summary>
|
| | | private DateTime oldTime = DateTime.Now;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | {
|
| | | this.Width = Application.GetRealWidth(i_width);
|
| | | this.Height = Application.GetRealHeight(84);
|
| | | //圆球的宽度
|
| | | this.ThumbImageHeight = Application.GetRealHeight(84);
|
| | | this.ThumbImagePath = "Item/SeekBarIcon.png";
|
| | | //进度条的宽度
|
| | | this.SeekBarViewHeight = Application.GetRealHeight(10);
|
| | | //进度条背景色
|
| | | this.SeekBarBackgroundColor = 0xfff5f5f5;
|
| | | //上方是否显示文本
|
| | | this.IsProgressTextShow = false;
|
| | | this.MaxValue = 100;
|
| | | this.Gravity = Gravity.CenterHorizontal;
|
| | |
| | | this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
|
| | | return;
|
| | | }
|
| | | //时间间隔
|
| | | if (EventWaitTime != -1)
|
| | | {
|
| | | if ((DateTime.Now - oldTime).TotalMilliseconds < EventWaitTime) { return; }
|
| | | oldTime = DateTime.Now;
|
| | | }
|
| | |
|
| | | this.ProgressChangedEvent(0, value);
|
| | | }
|
| | |
|
| | |
| | | this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
|
| | | return;
|
| | | }
|
| | | //弹起事件不需要判断时间
|
| | | this.ProgressChangedEvent(1, value);
|
| | | }
|
| | |
|