| | |
| | | using System; |
| | | //using Shared.I; |
| | | using Shared.IOS.TBL; |
| | | |
| | | |
| | |
| | | /// <summary> |
| | | /// HDLWaveSeekbar 控件 |
| | | /// </summary> |
| | | public class WaveSeekBar : View |
| | | public class WaveSeekBar : BaseSeekBar |
| | | { |
| | | /// <summary> |
| | | /// 当前视图 |
| | |
| | | { |
| | | mHDLWaveSeekbar = new HDLWaveSeekbar |
| | | { |
| | | //Frame = new CoreGraphics.CGRect(0, 0, this.Width, this.Height), |
| | | //mHDLWaveSeekbar.Frame = new CoreGraphics.CGRect(0, 0, 1024, 1024); |
| | | MProgressChangedDelegate = new OnProgressChangeListener(this) |
| | | }; |
| | | |
| | |
| | | { |
| | | base.Width = value; |
| | | RefreshFrame(); |
| | | //mHDLWaveSeekbar.InitWithFrameArc(new CoreGraphics.CGRect(base.X, base.Y, base.Width, base.Height)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | base.X = value; |
| | | RefreshFrame(); |
| | | //mHDLWaveSeekbar.InitWithFrameArc(new CoreGraphics.CGRect(base.X, base.Y, base.Width, base.Height)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | base.Y = value; |
| | | RefreshFrame(); |
| | | //mHDLWaveSeekbar.InitWithFrameArc(new CoreGraphics.CGRect(base.X, base.Y, base.Width, base.Height)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | get |
| | | { |
| | | |
| | | return (int)mHDLWaveSeekbar.MProgress; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 波浪进度颜色 |
| | | /// </summary> |
| | | /// <value>波浪进度颜色</value> |
| | | public uint WaveColor |
| | | { |
| | | set |
| | | { |
| | | byte r, g, b, a; |
| | | r = (byte)(value / 256 / 256 % 256); |
| | | g = (byte)(value / 256 % 256); |
| | | b = (byte)(value % 256); |
| | | a = (byte)(value / 256 / 256 / 256 % 256); |
| | | mHDLWaveSeekbar.MWaveProgressBarColor = UIKit.UIColor.FromRGBA(r, g, b, a); |
| | | |
| | | } |
| | | } |
| | | ///// <summary> |
| | | ///// 波浪进度颜色 |
| | | ///// </summary> |
| | | ///// <value>波浪进度颜色</value> |
| | | //public uint WaveColor |
| | | //{ |
| | | // set |
| | | // { |
| | | // byte r, g, b, a; |
| | | // r = (byte)(value / 256 / 256 % 256); |
| | | // g = (byte)(value / 256 % 256); |
| | | // b = (byte)(value % 256); |
| | | // a = (byte)(value / 256 / 256 / 256 % 256); |
| | | // mHDLWaveSeekbar.MWaveProgressBarColor = UIKit.UIColor.FromRGBA(r, g, b, a); |
| | | // mHDLWaveSeekbar.SetNeedsDisplay(); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 设置进度条 渐变颜色的开始颜色和结束颜色 |
| | | /// </summary> |
| | | /// <value>开始颜色、结束颜色</value> |
| | | public void SetProgressBarColors(uint startColor, uint endColor) |
| | | { |
| | | byte r, g, b, a; |
| | | r = (byte)(startColor / 256 / 256 % 256); |
| | | g = (byte)(startColor / 256 % 256); |
| | | b = (byte)(startColor % 256); |
| | | a = (byte)(startColor / 256 / 256 / 256 % 256); |
| | | |
| | | var start = UIKit.UIColor.FromRGBA(r, g, b, a); |
| | | |
| | | byte r2, g2, b2, a2; |
| | | r2 = (byte)(endColor / 256 / 256 % 256); |
| | | g2 = (byte)(endColor / 256 % 256); |
| | | b2 = (byte)(endColor % 256); |
| | | a2 = (byte)(endColor / 256 / 256 / 256 % 256); |
| | | var end = UIKit.UIColor.FromRGBA(r2, g2, b2, a2); |
| | | |
| | | mHDLWaveSeekbar.SetProgressBarColors(start, end); |
| | | mHDLWaveSeekbar.SetNeedsDisplay(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 背景边框颜色 |
| | |
| | | b = (byte)(value % 256); |
| | | a = (byte)(value / 256 / 256 / 256 % 256); |
| | | mHDLWaveSeekbar.MWaveBorderColor = UIKit.UIColor.FromRGBA(r, g, b, a); |
| | | |
| | | mHDLWaveSeekbar.SetNeedsDisplay(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 进度区域背景默认颜色 |
| | | ///// </summary> |
| | | ///// <value>进度区域背景默认颜色</value> |
| | | //public uint WaveBgColor |
| | | //{ |
| | | // set |
| | | // { |
| | | // byte r, g, b, a; |
| | | // r = (byte)(value / 256 / 256 % 256); |
| | | // g = (byte)(value / 256 % 256); |
| | | // b = (byte)(value % 256); |
| | | // a = (byte)(value / 256 / 256 / 256 % 256); |
| | | |
| | | |
| | | // } |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | | /// 进度条与边框边距 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 当前进度值显示的文字颜色 |
| | | /// </summary> |
| | |
| | | { |
| | | set |
| | | { |
| | | |
| | | byte r, g, b, a; |
| | | r = (byte)(value / 256 / 256 % 256); |
| | | g = (byte)(value / 256 % 256); |
| | |
| | | a = (byte)(value / 256 / 256 / 256 % 256); |
| | | |
| | | mHDLWaveSeekbar.MProgressTextColor = UIKit.UIColor.FromRGBA(r, g, b, a); |
| | | //mHDLWaveSeekbar.SetProgressTextColor(UIKit.UIColor.FromRGBA(r, g, b, a)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | set |
| | | { |
| | | //set => mHDLWaveSeekbar.SetProgressTextSize(value); |
| | | mHDLWaveSeekbar.MProgressTextSize = value; |
| | | } |
| | | |
| | |
| | | set |
| | | { |
| | | mHDLWaveSeekbar.IsProgressTextShow = value; |
| | | mHDLWaveSeekbar.SetNeedsDisplay(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 当前进度值 Y坐标 |
| | | /// </summary> |
| | | /// <value>Y坐标</value> |
| | | public int NowProgressY |
| | | { |
| | | get |
| | | { |
| | | return (int)mHDLWaveSeekbar.ProgressY; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | public override void OnProgressChanged(int mProgress) |
| | | { |
| | | //if (_WaveSeekBar.IsProgressChangeDelay()) return; |
| | | |
| | | _WaveSeekBar.OnProgressChangedEvent?.Invoke(this, mProgress); |
| | | } |
| | | |
| | |
| | | |
| | | public override void OnStopTrackingTouch(int mProgress) |
| | | { |
| | | _WaveSeekBar.OnProgressChangedEvent?.Invoke(this, mProgress); |
| | | _WaveSeekBar.OnStopTrackingTouchEvent?.Invoke(this, mProgress); |
| | | } |
| | | } |