public override void Start(GoogleMap googleMap, IList <PositionModel> route) { _googleMap = googleMap; if (_firstRunAnimSet == null) { _firstRunAnimSet = new AnimatorSet(); } else { _firstRunAnimSet.RemoveAllListeners(); _firstRunAnimSet.End(); _firstRunAnimSet.Cancel(); _firstRunAnimSet = new AnimatorSet(); } LatLng[] bangaloreRoute = route.Select(e => new LatLng(e.Lat.GetValueOrDefault(0), e.Lng.GetValueOrDefault(0))).ToArray(); if (bangaloreRoute.Length == 0) { return; } var foregroundRouteAnimator = ObjectAnimator.OfObject(this, "routeIncreaseForward", new RouteEvaluator(), bangaloreRoute.ToArray <Object>()); foregroundRouteAnimator.SetInterpolator(new LinearInterpolator()); foregroundRouteAnimator.SetDuration((long)TimeSpan.FromMinutes(3).TotalMilliseconds); foregroundRouteAnimator.RepeatCount = ValueAnimator.Infinite; _firstRunAnimSet.PlaySequentially(foregroundRouteAnimator); _firstRunAnimSet.Start(); }
public void stop() { if (mAnimSet == null) { return; } mAnimSet.End(); }
public void StopRippleAnimation() { if (IsRippleAnimationRunning) { animatorSet.End(); foreach (RippleView rippleView in rippleViewList) { rippleView.Visibility = Android.Views.ViewStates.Invisible; } animationRunning = false; } }
public void StopBars() { try { Animating = false; if (PlayingSet != null && PlayingSet.IsRunning && PlayingSet.IsStarted) { if (Build.VERSION.SdkInt < (BuildVersionCodes)19) { PlayingSet.End(); } else { PlayingSet.Pause(); } } if (StopSet == null) { // Animate stopping bars ObjectAnimator scaleY1 = ObjectAnimator.OfFloat(MusicBar1, "scaleY", 0.1f); ObjectAnimator scaleY2 = ObjectAnimator.OfFloat(MusicBar2, "scaleY", 0.1f); ObjectAnimator scaleY3 = ObjectAnimator.OfFloat(MusicBar3, "scaleY", 0.1f); StopSet = new AnimatorSet(); StopSet.PlayTogether(scaleY3, scaleY2, scaleY1); StopSet.SetDuration(200); StopSet.Start(); } else if (!StopSet.IsStarted) { StopSet.Start(); } } catch (Exception e) { Console.WriteLine(e); } }
private void CreateAnimation() { if (animation == null) { var yAnim = ObjectAnimator.OfFloat(ball, "y", ball.Y, Height - 50f); yAnim.SetDuration(1000); yAnim.RepeatCount = 0; yAnim.RepeatMode = ValueAnimatorRepeatMode.Reverse; yAnim.SetInterpolator(new AccelerateInterpolator(2f)); yAnim.Update += delegate { Invalidate(); }; yAnim.AnimationStart += delegate { activity.startTextAnimator.SetTextColor(On); if (endImmediately) { animation.End(); } }; yAnim.AnimationEnd += delegate { activity.endTextAnimator.SetTextColor(On); }; yAnim.AnimationCancel += delegate { activity.cancelTextAnimator.SetTextColor(On); }; yAnim.AnimationRepeat += delegate { activity.repeatTextAnimator.SetTextColor(On); }; var xAnim = ObjectAnimator.OfFloat(ball, "x", ball.X, ball.X + 300); xAnim.SetDuration(1000); xAnim.StartDelay = 0; xAnim.RepeatCount = 0; xAnim.RepeatMode = ValueAnimatorRepeatMode.Reverse; xAnim.SetInterpolator(new AccelerateInterpolator(2f)); var alphaAnim = ObjectAnimator.OfFloat(ball, "alpha", 1.0f, 0.5f); alphaAnim.SetDuration(1000); animation = new AnimatorSet(); animation.PlayTogether(yAnim, xAnim, alphaAnim); animation.AnimationStart += delegate { activity.startText.SetTextColor(On); if (endImmediately) { animation.End(); } }; animation.AnimationEnd += delegate { activity.endText.SetTextColor(On); }; animation.AnimationCancel += delegate { activity.cancelText.SetTextColor(On); }; animation.AnimationRepeat += delegate { activity.repeatText.SetTextColor(On); }; } }
public void EndAnimation() { CreateAnimation(); animation.End(); }
public void End() { waterAnimator.End(); }