public MainPage() { InitializeComponent(); this.progressbar = new SfCircularProgressBar(); this.border = new SfBorder(); this.border.BorderColor = Color.LightGray; this.border.BackgroundColor = Color.White; this.border.CornerRadius = 35; this.border.Content = this.progressbar; this.border.BorderWidth = 0.2; this.progressbar.SegmentCount = 10; this.progressbar.IndicatorInnerRadius = 0.5; this.progressbar.IndicatorOuterRadius = 0.7; this.progressbar.ShowProgressValue = true; this.progressbar.GapWidth = 0.5; this.progressbar.WidthRequest = 70; this.progressbar.HeightRequest = 55; this.progressbar.IndeterminateAnimationDuration = 750; var pullingTemplate = new DataTemplate(() => { return(new ViewCell { View = this.border }); }); this.pullToRefresh.Refreshing += this.PullToRefresh_Refreshing; this.pullToRefresh.Pulling += this.PullToRefresh_Pulling; this.pullToRefresh.PullingViewTemplate = pullingTemplate; this.pullToRefresh.RefreshingViewTemplate = pullingTemplate; }
private View GetCircularRangeColors() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; RangeColorCollection rangeColorCollection = new RangeColorCollection { new RangeColor { Color = Color.ParseColor("#36BBE1"), Start = 0, End = 25 }, new RangeColor { Color = Color.ParseColor("#9AEDE1"), Start = 25, End = 50 }, new RangeColor { Color = Color.ParseColor("#FFDC28"), Start = 50, End = 75 }, new RangeColor { Color = Color.ParseColor("#E15E0D"), Start = 75, End = 100 } }; SfCircularProgressBar progressBar = new SfCircularProgressBar(this.context) { Progress = 100, ShowProgressValue = false, RangeColors = rangeColorCollection, LayoutParameters = this.layoutParams }; progressBar.ValueChanged += this.ProgressBar_ValueChanged100; linearLayout.AddView(progressBar); return(linearLayout); }
private void ProgressBar_ValueChanged75(object sender, ProgressValueEventArgs e) { SfCircularProgressBar progressbar = sender as SfCircularProgressBar; if (e.Progress.Equals(75)) { progressbar.AnimationDuration = 1; progressbar.Progress = 0; } if (e.Progress.Equals(0)) { progressbar.AnimationDuration = 2000; progressbar.Progress = 75; } }
private View GetCircularVideoPlayer() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; this.videoPlayerProgressBar = new SfCircularProgressBar(this.context) { Progress = 100, ShowProgressValue = true, TrackInnerRadius = 0f, IndicatorOuterRadius = 0.7f, IndicatorInnerRadius = 0.65f, AnimationDuration = 10000, LayoutParameters = this.layoutParams }; GridLayout.LayoutParams gridLayoutParams = new GridLayout.LayoutParams { RowSpec = GridLayout.InvokeSpec(0), ColumnSpec = GridLayout.InvokeSpec(0) }; GridLayout custContentLayout = new GridLayout(this.context); this.playButton = new ImageButton(this.context) { Visibility = ViewStates.Invisible }; this.playButton.SetImageResource(Resource.Drawable.SfProgressPlay); this.playButton.SetBackgroundColor(Color.ParseColor("#00FFFFFF")); this.playButton.Click += this.PlayButton_Click; custContentLayout.AddView(this.playButton, gridLayoutParams); this.pauseButton = new ImageButton(this.context); this.pauseButton.SetImageResource(Resource.Drawable.SfProgressPause); this.pauseButton.SetBackgroundColor(Color.ParseColor("#00FFFFFF")); this.pauseButton.Click += this.PauseButton_Click; custContentLayout.AddView(this.pauseButton, gridLayoutParams); this.videoPlayerProgressBar.Content = custContentLayout; this.videoPlayerProgressBar.ValueChanged += this.ProgressBar_ValueChanged100; linearLayout.AddView(this.videoPlayerProgressBar); return(linearLayout); }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">SampleView type parameter named as bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.viewModel = new DataGridPullToRefreshViewModel(); this.progressbar = new SfCircularProgressBar(); this.border = new SfBorder(); this.border.BorderColor = Color.LightGray; this.border.BackgroundColor = Color.White; this.border.CornerRadius = 35; this.border.Content = this.progressbar; this.border.BorderWidth = 0.2; this.progressbar.SegmentCount = 10; this.progressbar.IndicatorInnerRadius = 0.5; this.progressbar.IndicatorOuterRadius = 0.7; this.progressbar.ShowProgressValue = true; this.progressbar.GapWidth = 0.5; this.progressbar.WidthRequest = 70; this.progressbar.HeightRequest = 55; this.progressbar.IndeterminateAnimationDuration = 750; bindAble.BindingContext = this.viewModel; this.pullToRefresh = bindAble.FindByName <SfPullToRefresh>("pullToRefresh"); this.dataGrid = bindAble.FindByName <SfDataGrid>("dataGrid"); this.transitionType = bindAble.FindByName <PickerExt>("transitionType"); this.dataGrid.ItemsSource = this.viewModel.OrdersInfo; this.transitionType.Items.Add("SlideOnTop"); this.transitionType.Items.Add("Push"); this.transitionType.SelectedIndex = 0; this.transitionType.SelectedIndexChanged += this.OnSelectionChanged; this.pullToRefresh.Refreshing += this.PullToRefresh_Refreshing; this.pullToRefresh.Pulling += this.PullToRefresh_Pulling; var pullingTemplate = new DataTemplate(() => { return(new ViewCell { View = this.border }); }); this.pullToRefresh.PullingViewTemplate = pullingTemplate; this.pullToRefresh.RefreshingViewTemplate = pullingTemplate; base.OnAttachedTo(bindAble); }
private async void ProgressBar_ValueChanged100(object sender, ProgressValueEventArgs e) { SfCircularProgressBar progressbar = sender as SfCircularProgressBar; if (e.Progress.Equals(100)) { progressbar.AnimationDuration = 0; progressbar.Progress = 0; } if (e.Progress.Equals(0)) { progressbar.AnimationDuration = 10000; await Task.Delay(100); progressbar.Progress = 100; } }
private View GetCircularCustomContent() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; this.circularCustomContentProgressBar = new SfCircularProgressBar(this.context) { Progress = 75, AnimationDuration = 0, LayoutParameters = this.layoutParams }; this.SetCustomContentProgress(); linearLayout.AddView(this.circularCustomContentProgressBar); return(linearLayout); }
private View GetCircularAngleCustomization() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; SfCircularProgressBar progressBar = new SfCircularProgressBar(this.context) { Progress = 100, StartAngle = 130, EndAngle = 410, ShowProgressValue = false, LayoutParameters = this.layoutParams }; progressBar.ValueChanged += this.ProgressBar_ValueChanged100; linearLayout.AddView(progressBar); return(linearLayout); }
private View GetCircularSegment() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; SfCircularProgressBar progressBar = new SfCircularProgressBar(this.context) { Progress = 75, ShowProgressValue = false, SegmentCount = 4, AnimationDuration = 10000, LayoutParameters = this.layoutParams }; progressBar.ValueChanged += this.ProgressBar_ValueChanged75; linearLayout.AddView(progressBar); return(linearLayout); }
private View GetCircularSegmentFillStyle() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; this.segmentedFillingStyle = new SfCircularProgressBar(this.context) { ShowProgressValue = false, SegmentCount = 20, AnimationDuration = 0, LayoutParameters = this.layoutParams }; this.SetSegmentedFillingStyleProgress(); linearLayout.AddView(this.segmentedFillingStyle); return(linearLayout); }
private View GetCircularTrackInside() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; this.trackInsideStyle = new SfCircularProgressBar(this.context) { TrackOuterRadius = 0.7f, TrackInnerRadius = 0f, ShowProgressValue = true, AnimationDuration = 0, LayoutParameters = this.layoutParams }; this.SetTrackInsideStyleProgress(); linearLayout.AddView(this.trackInsideStyle); return(linearLayout); }
private View GetCircularFilledIndicator() { LinearLayout linearLayout = new LinearLayout(this.context) { Orientation = Orientation.Vertical }; SfCircularProgressBar progressBar = new SfCircularProgressBar(this.context) { Progress = 100, IndicatorOuterRadius = 0.7f, IndicatorInnerRadius = 0f, ShowProgressValue = false, AnimationDuration = 10000, LayoutParameters = this.layoutParams }; progressBar.ValueChanged += this.ProgressBar_ValueChanged100; linearLayout.AddView(progressBar); return(linearLayout); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { _timerTxtView = new TextView(Context.ApplicationContext); _timerTxtView.Text = $"{_min:00} : {_sec:00}"; _timerTxtView.SetTextColor(Color.White); _timerTxtView.TextSize = 28; _timerTxtView.TextAlignment = TextAlignment.Center; _circularProgressBar = new SfCircularProgressBar(Context.ApplicationContext); _circularProgressBar.Maximum = 100; _circularProgressBar.Minimum = 0; _circularProgressBar.AnimationDuration = 0; _circularProgressBar.TrackColor = Color.White; _circularProgressBar.ProgressColor = new Color(ContextCompat.GetColor(Context.ApplicationContext, Resource.Color.colorPrimaryDark)); _circularProgressBar.Content = _timerTxtView; ThreadPool.QueueUserWorkItem(o => BeginTimer()); return(_circularProgressBar); }
public Circular() { scrollView = new UIScrollView(); this.AddSubview(scrollView); CircularDeterminateLabel = this.GetLabel("Detminate and indeterminate"); CircularDeterminate = new SfCircularProgressBar { Progress = 75 }; CircularInDeterminate = new SfCircularProgressBar { IsIndeterminate = true }; scrollView.AddSubview(CircularDeterminateLabel); scrollView.AddSubview(CircularDeterminate); scrollView.AddSubview(CircularInDeterminate); CircularCustomContentLabel = this.GetLabel("Custom content"); CircularCustomContent = new SfCircularProgressBar() { Progress = 75, AnimationDuration = 1, }; this.SetCustomContentProgress(); this.CircularVideoPlayer = new SfCircularProgressBar() { Progress = 100, TrackInnerRadius = 0f, IndicatorOuterRadius = 0.7f, IndicatorInnerRadius = 0.65f, AnimationDuration = 2000, }; this.CircularVideoPlayer.ValueChanged += this.ProgressBar_ValueChanged100; scrollView.AddSubview(this.CircularCustomContentLabel); scrollView.AddSubview(this.CircularCustomContent); scrollView.AddSubview(this.CircularVideoPlayer); UIView customView = new UIView(); customView.Frame = new CGRect(0, 40, 100, 80); playButton = new UIButton(); playButton.Hidden = true; playButton.Frame = new CGRect(0, 23, 100, 33); playButton.SetImage(UIImage.FromFile("SfProgressPlay.png"), UIControlState.Normal); playButton.BackgroundColor = UIColor.Clear; pauseButton = new UIButton(); pauseButton.Frame = new CGRect(0, 23, 100, 33); pauseButton.BackgroundColor = UIColor.Clear; pauseButton.SetImage(UIImage.FromFile("SfProgressPause.png"), UIControlState.Normal); customView.AddSubview(playButton); customView.AddSubview(pauseButton); playButton.TouchUpInside += (sender, e) => { this.CircularVideoPlayer.Progress = 100; this.pauseButton.Hidden = false; this.playButton.Hidden = true; }; pauseButton.TouchUpInside += (sender, e) => { this.CircularVideoPlayer.Progress = (double)GetInternalPropertyValue(typeof(ProgressBarBase), this.CircularVideoPlayer, "ActualProgress"); this.playButton.Hidden = false; this.pauseButton.Hidden = true; }; this.CircularVideoPlayer.Content = customView; this.CircularRadiusCustomizationLabel = this.GetLabel("Radius customization"); this.CircularTrackOutside = new SfCircularProgressBar() { Progress = 100, IndicatorOuterRadius = 0.7f, IndicatorInnerRadius = 0.65f, ShowProgressValue = false, AnimationDuration = 2000, }; this.CircularTrackOutside.ValueChanged += this.ProgressBar_ValueChanged100; this.CircularFilledIndicator = new SfCircularProgressBar() { Progress = 100, IndicatorOuterRadius = 0.7f, IndicatorInnerRadius = 0f, ShowProgressValue = false, AnimationDuration = 2000, }; this.CircularFilledIndicator.ValueChanged += this.ProgressBar_ValueChanged100; CircularTrackInside = new SfCircularProgressBar() { TrackOuterRadius = 0.7f, TrackInnerRadius = 0f, ShowProgressValue = true, AnimationDuration = 1, }; this.SetTrackInsideStyleProgress(); this.CircularThinTrackStyle = new SfCircularProgressBar() { Progress = 100, IndicatorOuterRadius = 0.75f, IndicatorInnerRadius = 0.6f, TrackOuterRadius = 0.7f, TrackInnerRadius = 0.65f, AnimationDuration = 2000, ShowProgressValue = false, }; this.CircularThinTrackStyle.ValueChanged += this.ProgressBar_ValueChanged100; scrollView.AddSubview(CircularRadiusCustomizationLabel); scrollView.AddSubview(CircularTrackOutside); scrollView.AddSubview(CircularFilledIndicator); scrollView.AddSubview(CircularTrackInside); scrollView.AddSubview(CircularThinTrackStyle); this.CircularSegmentLabel = this.GetLabel("Segment"); this.CircularSegment = new SfCircularProgressBar() { Progress = 75, ShowProgressValue = false, SegmentCount = 4, AnimationDuration = 2000, }; this.CircularSegment.ValueChanged += this.ProgressBar_ValueChanged75; this.CircularSegmentPadding = new SfCircularProgressBar() { Progress = 75, ShowProgressValue = false, TrackInnerRadius = 0.6f, IndicatorInnerRadius = 0.65f, IndicatorOuterRadius = 0.7f, AnimationDuration = 2000, SegmentCount = 4 }; this.CircularSegmentPadding.ValueChanged += this.ProgressBar_ValueChanged75; CircularSegmentFillStyle = new SfCircularProgressBar() { ShowProgressValue = false, SegmentCount = 20, AnimationDuration = 1, }; this.SetSegmentedFillingStyleProgress(); scrollView.AddSubview(CircularSegmentLabel); scrollView.AddSubview(CircularSegment); scrollView.AddSubview(CircularSegmentPadding); scrollView.AddSubview(CircularSegmentFillStyle); this.CircularAngleCustomizationLabel = this.GetLabel("Angle customization"); this.CircularAngleCustomization = new SfCircularProgressBar() { Progress = 100, StartAngle = 130, EndAngle = 410, AnimationDuration = 2000, ShowProgressValue = false }; this.CircularAngleCustomization.ValueChanged += this.ProgressBar_ValueChanged100; scrollView.AddSubview(CircularAngleCustomizationLabel); scrollView.AddSubview(CircularAngleCustomization); }