Exemplo n.º 1
0
        public ProgressView()
        {
            downloadProgess = new CustomProgress()
            {
                ProgressTintColor = UIColor.DarkGray,
                BackgroundColor   = UIColor.White,
            };
            downloadProgess.SizeToFit();
            var style = this.GetStyle();

            sliderProgress = new CustomProgress()
            {
                ProgressTintColor = style.AccentColorHorizontal,
            };
            slider = new OBSlider();
            slider.AccessibilityIdentifier = "Progress";
            slider.BackgroundColor         = UIColor.Clear;
            slider.MinimumTrackTintColor   = style.AccentColorHorizontal;
            slider.MaximumTrackTintColor   = UIColor.Clear;
            slider.SizeToFit();
            slider.ValueChanged    += (object sender, EventArgs e) => { sliderProgress.Progress = slider.Value; };
            slider.EditingDidBegin += (object sender, EventArgs e) => { EditingStarted?.Invoke(); };
            slider.EditingDidEnd   += (sender, args) => {
                EditingEnded?.Invoke();
                PlaybackManager.Shared.Seek(slider.Value);
            };
            slider.SetThumbImage(Images.GetPlaybackSliderThumb(), UIControlState.Normal);
            this.Frame = slider.Frame;
            this.AddSubview(downloadProgess);
            this.AddSubview(sliderProgress);
            this.AddSubview(slider);
        }