xm
2020-08-14 a45fe56aeeac8f28a9891b83362954067c8166dc
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SeekBarControl.cs
@@ -11,7 +11,18 @@
    {
        #region ■ 变量声明___________________________
        private uint nowProgressBarColor = 0;
        /// <summary>
        /// 进度条可用时的背景色
        /// </summary>
        private uint ProgressBarEnableColor = 0;
        /// <summary>
        /// 进度条不可用时的背景色(默认灰色)
        /// </summary>
        public uint ProgressBarUnEnableColor = 0xffe8e8e8;
        /// <summary>
        /// 当前可用状态
        /// </summary>
        private bool nowEnable = true;
        /// <summary>
        /// 控件能否使用
        /// </summary>
@@ -19,16 +30,20 @@
        {
            set
            {
                //状态没有改变
                if (nowEnable == value) { return; }
                nowEnable = value;
                this.IsClickable = value;
                if (value == true)
                {
                    //原来的颜色
                    base.ProgressBarColor = nowProgressBarColor;
                    base.ProgressBarColor = ProgressBarEnableColor;
                }
                else
                {
                    //灰色
                    base.ProgressBarColor = 0xffe8e8e8;
                    base.ProgressBarColor = ProgressBarUnEnableColor;
                }
            }
        }
@@ -40,7 +55,7 @@
        {
            set
            {
                nowProgressBarColor = value;
                ProgressBarEnableColor = value;
                base.ProgressBarColor = value;
            }
        }
@@ -49,6 +64,14 @@
        /// 进度值改变,如果要设置初始进度值,此变量要在设置初始进度值之前进行设置(第一个参数0:滑动的时候,1:手指弹起的时候)
        /// </summary>
        public Action<int, int> ProgressChangedEvent = null;
        /// <summary>
        /// 进度条事件的触发时间间隔(默认没有间隔,单位为毫秒)
        /// </summary>
        public int EventWaitTime = -1;
        /// <summary>
        /// 前回时间
        /// </summary>
        private DateTime oldTime = DateTime.Now;
        #endregion
@@ -62,10 +85,14 @@
        {
            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;
@@ -92,6 +119,13 @@
                this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
                return;
            }
            //时间间隔
            if (EventWaitTime != -1)
            {
                if ((DateTime.Now - oldTime).TotalMilliseconds < EventWaitTime) { return; }
                oldTime = DateTime.Now;
            }
            this.ProgressChangedEvent(0, value);
        }
@@ -107,6 +141,7 @@
                this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
                return;
            }
            //弹起事件不需要判断时间
            this.ProgressChangedEvent(1, value);
        }