예제 #1
0
            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;
            }
예제 #2
0
        private PausableProgressBar CreateProgressBar()
        {
            PausableProgressBar p = new PausableProgressBar(Context)
            {
                LayoutParameters = ProgressBarLayoutParam
            };

            return(p);
        }
예제 #3
0
        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());
                }
            }
        }
예제 #4
0
        /// <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();
        }
예제 #5
0
        /// <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();
        }
예제 #6
0
 public MyAnimationListener(PausableProgressBar progressBar)
 {
     ProgressBar = progressBar;
 }