public void OnFinishProgress() { if (ProgressView.IsReverseStart) { ProgressView.StoriesListener?.OnPrev(); if (0 <= ProgressView.Current - 1) { PausableProgressBar p = ProgressView.ProgressBars[ProgressView.Current - 1]; p.SetMinWithoutCallback(); ProgressView.ProgressBars[--ProgressView.Current].StartProgress(); } else { ProgressView.ProgressBars[ProgressView.Current].StartProgress(); } ProgressView.IsReverseStart = false; return; } int next = ProgressView.Current + 1; if (next <= ProgressView.ProgressBars.Count - 1) { ProgressView.StoriesListener?.OnNext(); ProgressView.ProgressBars[next].StartProgress(); } else { ProgressView.IsComplete = true; ProgressView.StoriesListener?.OnComplete(); } ProgressView.IsSkipStart = false; }
private PausableProgressBar CreateProgressBar() { PausableProgressBar p = new PausableProgressBar(Context) { LayoutParameters = ProgressBarLayoutParam }; return(p); }
private void BindViews() { ProgressBars.Clear(); RemoveAllViews(); for (int i = 0; i < StoriesCount; i++) { PausableProgressBar p = CreateProgressBar(); ProgressBars.Add(p); AddView(p); if (i + 1 < StoriesCount) { AddView(CreateSpace()); } } }
/// <summary> /// Reverse current story /// </summary> public void Reverse() { if (IsSkipStart || IsReverseStart) { return; } if (IsComplete) { return; } if (Current < 0) { return; } PausableProgressBar p = ProgressBars[Current]; IsReverseStart = true; p.SetMin(); }
/// <summary> /// Reverse current story /// </summary> public void Reverse() { if (IsSkipStart || IsReverseStart) { return; } switch (IsComplete) { case true: return; } switch (Current) { case < 0: return; } PausableProgressBar p = ProgressBars[Current]; IsReverseStart = true; p.SetMin(); }
public MyAnimationListener(PausableProgressBar progressBar) { ProgressBar = progressBar; }