public void AnimateBars()
        {
            try
            {
                Animating = true;
                if (PlayingSet == null)
                {
                    ObjectAnimator scaleYbar1 = ObjectAnimator.OfFloat(MusicBar1, "scaleY", 0.2f, 0.8f, 0.1f, 0.1f, 0.3f, 0.1f, 0.2f, 0.8f, 0.7f, 0.2f, 0.4f, 0.9f, 0.7f, 0.6f, 0.1f, 0.3f, 0.1f, 0.4f, 0.1f, 0.8f, 0.7f, 0.9f, 0.5f, 0.6f, 0.3f, 0.1f);
                    scaleYbar1.RepeatCount = ValueAnimator.Infinite;
                    ObjectAnimator scaleYbar2 = ObjectAnimator.OfFloat(MusicBar2, "scaleY", 0.2f, 0.5f, 1.0f, 0.5f, 0.3f, 0.1f, 0.2f, 0.3f, 0.5f, 0.1f, 0.6f, 0.5f, 0.3f, 0.7f, 0.8f, 0.9f, 0.3f, 0.1f, 0.5f, 0.3f, 0.6f, 1.0f, 0.6f, 0.7f, 0.4f, 0.1f);
                    scaleYbar2.RepeatCount = ValueAnimator.Infinite;
                    ObjectAnimator scaleYbar3 = ObjectAnimator.OfFloat(MusicBar3, "scaleY", 0.6f, 0.5f, 1.0f, 0.6f, 0.5f, 1.0f, 0.6f, 0.5f, 1.0f, 0.5f, 0.6f, 0.7f, 0.2f, 0.3f, 0.1f, 0.5f, 0.4f, 0.6f, 0.7f, 0.1f, 0.4f, 0.3f, 0.1f, 0.4f, 0.3f, 0.7f);
                    scaleYbar3.RepeatCount = ValueAnimator.Infinite;

                    PlayingSet = new AnimatorSet();
                    PlayingSet.PlayTogether(scaleYbar2, scaleYbar3, scaleYbar1);
                    PlayingSet.SetDuration(Duration);
                    PlayingSet.SetInterpolator(new LinearInterpolator());
                    PlayingSet.Start();
                }
                else if (Build.VERSION.SdkInt < (BuildVersionCodes)19)
                {
                    if (!PlayingSet.IsStarted)
                    {
                        PlayingSet.Start();
                    }
                }
                else
                {
                    if (PlayingSet.IsPaused)
                    {
                        PlayingSet.Resume();
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #2
0
 public void Resume()
 {
     waterAnimator?.Resume();
     wavesAnimator?.Resume();
 }