/** * This method animates the image fragment into the background by both * scaling and rotating the fragment's view, as well as adding a * translucent dark hover view to inform the user that it is inactive. */ public void SlideBack() { View movingFragmentView = mImageFragment.View; PropertyValuesHolder rotateX = PropertyValuesHolder.OfFloat("rotationX", 40f); PropertyValuesHolder scaleX = PropertyValuesHolder.OfFloat("scaleX", 0.8f); PropertyValuesHolder scaleY = PropertyValuesHolder.OfFloat("scaleY", 0.8f); ObjectAnimator movingFragmentAnimator = ObjectAnimator. OfPropertyValuesHolder(movingFragmentView, rotateX, scaleX, scaleY); ObjectAnimator darkHoverViewAnimator = ObjectAnimator. OfFloat(mDarkHoverView, "alpha", 0.0f, 0.5f); ObjectAnimator movingFragmentRotator = ObjectAnimator. OfFloat(movingFragmentView, "rotationX", 0); movingFragmentRotator.StartDelay = Resources.GetInteger(Resource.Integer.half_slide_up_down_duration); AnimatorSet s = new AnimatorSet(); s.PlayTogether(movingFragmentAnimator, darkHoverViewAnimator, movingFragmentRotator); s.AnimationEnd += delegate { FragmentTransaction transaction = FragmentManager.BeginTransaction(); transaction.SetCustomAnimations(Resource.Animator.slide_fragment_in, 0, 0, Resource.Animator.slide_fragment_out); transaction.Add(Resource.Id.move_to_back_container, mTextFragment); transaction.AddToBackStack(null); transaction.Commit(); }; s.Start(); }
private AnimatorSet BuildExpandingAnimatorSet(ImageView expandedView, Rect startBounds, Rect finalBounds, float startScale) { // Each expanding animator is unique to the start location - we'll cache the AnimatorSet // instance based on the starting location. int key = startBounds.GetHashCode(); if (_expandingAnimators.ContainsKey(key)) { return(_expandingAnimators[key]); } AnimatorSet expandSet = new AnimatorSet(); expandSet.Play(ObjectAnimator.OfFloat(expandedView, View.X, startBounds.Left, finalBounds.Left)) .With(ObjectAnimator.OfFloat(expandedView, View.Y, startBounds.Top, finalBounds.Top)) .With(ObjectAnimator.OfFloat(expandedView, "ScaleX", startScale, 1f)) .With(ObjectAnimator.OfFloat(expandedView, "ScaleY", startScale, 1f)); expandSet.SetDuration(_shortAnimationDuration); expandSet.SetInterpolator(new DecelerateInterpolator()); expandSet.AnimationEnd += NullOutCurrentAnimator; expandSet.AnimationCancel += NullOutCurrentAnimator; _expandingAnimators.Add(key, expandSet); return(expandSet); }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.activity_main); easingList = FindViewById<ListView> (Resource.Id.easing_list); adapter = new EasingAdapter (this); easingList.Adapter = adapter; target = FindViewById (Resource.Id.target); history = FindViewById<DrawView> (Resource.Id.history); easingList.ItemClick += (sender, e) => { history.Clear (); var s = (Skill)e.View.Tag; var set = new AnimatorSet (); target.TranslationX = 0; target.TranslationY = 0; set.PlayTogether ( Glider.Glide (s, 1200, ObjectAnimator.OfFloat (target, "translationY", 0, DrawView.DipToPixels (this, -(160 - 3))), args => { history.DrawPoint (args.Time, args.Duration, args.Value - DrawView.DipToPixels (this, 60)); })); set.SetDuration (1200); set.Start (); }; }
/** * build FlexibleAnimation to control the progress * * @return Animatorset for control the progress */ private AnimatorSet BuildFlexibleAnimation() { var ring = _ring; var set = new AnimatorSet(); var increment = ValueAnimator.OfFloat(0, MaxProgressArc - MinProgressArc); increment.SetDuration(AnimatorDuration / 2); increment.SetInterpolator(new LinearInterpolator()); increment.Update += (sender, e) => { var sweeping = ring.sweeping; var value = (float)e.Animation.AnimatedValue; ring.sweep = sweeping + value; Invalidate(); }; increment.AddListener(_animatorListener); var reduce = ValueAnimator.OfFloat(0, MaxProgressArc - MinProgressArc); reduce.SetDuration(AnimatorDuration / 2); reduce.SetInterpolator(_interpolator); reduce.Update += (sender, e) => { var sweeping = ring.sweeping; var starting = ring.starting; var value = (float)e.Animation.AnimatedValue; ring.sweep = sweeping - value; ring.start = starting + value; }; set.Play(reduce).After(increment); return(set); }
private AnimatorSet BuildShrinkingAnimatorSet(View bigView, View thumbView, Rect startBounds, float scale) { if (_shrinkingAnimators.ContainsKey(thumbView.Id)) { return(_shrinkingAnimators[thumbView.Id]); } AnimatorSet shrinkSet = new AnimatorSet(); shrinkSet.Play(ObjectAnimator.OfFloat(bigView, View.X, startBounds.Left)) .With(ObjectAnimator.OfFloat(bigView, View.Y, startBounds.Top)) .With(ObjectAnimator.OfFloat(bigView, "ScaleX", scale)) .With(ObjectAnimator.OfFloat(bigView, "ScaleY", scale)); shrinkSet.SetDuration(_shortAnimationDuration); shrinkSet.SetInterpolator(new DecelerateInterpolator()); shrinkSet.AnimationEnd += (sender1, args1) => { thumbView.Alpha = 1.0f; bigView.Visibility = ViewStates.Gone; NullOutCurrentAnimator(sender1, args1); }; shrinkSet.AnimationCancel += (sender1, args1) => { thumbView.Alpha = 1.0f; bigView.Visibility = ViewStates.Gone; NullOutCurrentAnimator(sender1, args1); }; _shrinkingAnimators.Add(thumbView.Id, shrinkSet); return(shrinkSet); }
private void CreateCustomAnimation() { FloatingActionMenu menu3 = FindViewById <FloatingActionMenu>(Resource.Id.menu3); AnimatorSet set = new AnimatorSet(); ObjectAnimator scaleOutX = ObjectAnimator.OfFloat(menu3.MenuIconView, "scaleX", 1.0f, 0.2f); ObjectAnimator scaleOutY = ObjectAnimator.OfFloat(menu3.MenuIconView, "scaleY", 1.0f, 0.2f); ObjectAnimator scaleInX = ObjectAnimator.OfFloat(menu3.MenuIconView, "scaleX", 0.2f, 1.0f); ObjectAnimator scaleInY = ObjectAnimator.OfFloat(menu3.MenuIconView, "scaleY", 0.2f, 1.0f); scaleOutX.SetDuration(50); scaleOutY.SetDuration(50); scaleInX.SetDuration(150); scaleInY.SetDuration(150); scaleInX.AnimationStart += (object sender, EventArgs e) => { menu3.MenuIconView.SetImageResource(menu3.IsOpened ? Resource.Drawable.ic_close : Resource.Drawable.ic_star); }; set.Play(scaleOutX).With(scaleOutY); set.Play(scaleInX).With(scaleInY).After(scaleOutX); set.SetInterpolator(new OvershootInterpolator(2)); menu3.IconToggleAnimatorSet = set; }
/** * This method animates the image fragment into the foreground by both * scaling and rotating the fragment's view, while also removing the * previously added translucent dark hover view. Upon the completion of * this animation, the image fragment regains focus since this method is * called from the onBackStackChanged method. */ public void SlideForward() { View movingFragmentView = mImageFragment.View; PropertyValuesHolder rotateX = PropertyValuesHolder.OfFloat("rotationX", 40f); PropertyValuesHolder scaleX = PropertyValuesHolder.OfFloat("scaleX", 1.0f); PropertyValuesHolder scaleY = PropertyValuesHolder.OfFloat("scaleY", 1.0f); ObjectAnimator movingFragmentAnimator = ObjectAnimator. OfPropertyValuesHolder(movingFragmentView, rotateX, scaleX, scaleY); ObjectAnimator darkHoverViewAnimator = ObjectAnimator. OfFloat(mDarkHoverView, "alpha", 0.5f, 0.0f); ObjectAnimator movingFragmentRotator = ObjectAnimator. OfFloat(movingFragmentView, "rotationX", 0); movingFragmentRotator.StartDelay = Resources.GetInteger(Resource.Integer.half_slide_up_down_duration); AnimatorSet s = new AnimatorSet(); s.PlayTogether(movingFragmentAnimator, movingFragmentRotator, darkHoverViewAnimator); s.StartDelay = Resources.GetInteger(Resource.Integer.slide_up_down_duration); s.AnimationEnd += delegate { mIsAnimating = false; }; s.Start(); }
public ColorItem(Context context) : base(context) { View.Inflate(context, Resource.Layout.ColorPickerItem, this); label = FindViewById <TextView> (Resource.Id.Label); colorView = FindViewById <CircledImageView> (Resource.Id.Color); expandCircleRadius = colorView.CircleRadius; shrinkCircleRadius = expandCircleRadius * ShrinkCricleRatio; shrinkCircleAnimator = ObjectAnimator.OfFloat(colorView, "circleRadius", expandCircleRadius, shrinkCircleRadius); shrinkLabelAnimator = ObjectAnimator.OfFloat(label, "alpha", ExpandLabelAlpha, ShrinkLabelAlpha); // FIXME Xamarin: new AnimatorSet().SetDuration(long) should return an AnimatorSet shrinkAnimator = new AnimatorSet(); shrinkAnimator.SetDuration(AnimationDurationMs); shrinkAnimator.PlayTogether(shrinkCircleAnimator, shrinkLabelAnimator); expandCircleAnimator = ObjectAnimator.OfFloat(colorView, "circleRadius", shrinkCircleRadius, expandCircleRadius); expandLabelAnimator = ObjectAnimator.OfFloat(label, "alpha", ShrinkLabelAlpha, ExpandLabelAlpha); expandAnimator = new AnimatorSet(); expandAnimator.SetDuration(AnimationDurationMs); expandAnimator.PlayTogether(expandCircleAnimator, expandLabelAnimator); }
public void Animate(PathSegment segment) { lock (_lockObject) { if (!_animatorSet.IsRunning) { _pathSegment = segment; _animatorSet = new AnimatorSet(); _animatorSet.AddListener(this); var animators = new List <ObjectAnimator>(); foreach (var marker in _markers) { var positionAnimator = ObjectAnimator.OfObject( marker, "Position", new MarkerPositionEvaluator(), segment.FinalLocation.ToLatLng()); positionAnimator.AddListener(this); positionAnimator.AddUpdateListener(this); positionAnimator.SetDuration(Convert.ToInt64(segment.Duration.TotalMilliseconds)); animators.Add(positionAnimator); } _animatorSet.PlayTogether(animators.ToArray()); _animatorSet.Start(); } } }
public static void showPopupSettings() { RelativeLayout popupContainer = (RelativeLayout)Shared.Activity.FindViewById(Resource.Id.popup_container); popupContainer.RemoveAllViews(); // background ImageView imageView = new ImageView(Application.Context); imageView.SetBackgroundColor(Color.ParseColor("#88555555")); imageView.LayoutParameters = new RelativeLayout.LayoutParams(1, 1); imageView.Clickable = true; popupContainer.AddView(imageView); // popup PopupSettingsView popupSettingsView = new PopupSettingsView(Application.Context); int width = Application.Context.Resources.GetDimensionPixelSize(Resource.Dimension.popup_settings_width); int height = Application.Context.Resources.GetDimensionPixelSize(Resource.Dimension.popup_settings_height); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(width, height); layoutParams.AddRule(LayoutRules.CenterInParent); popupContainer.AddView(popupSettingsView, layoutParams); // animate all together ObjectAnimator scaleXAnimator = ObjectAnimator.OfFloat(popupSettingsView, "scaleX", 0f, 1f); ObjectAnimator scaleYAnimator = ObjectAnimator.OfFloat(popupSettingsView, "scaleY", 0f, 1f); ObjectAnimator alphaAnimator = ObjectAnimator.OfFloat(imageView, "alpha", 0f, 1f); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.PlayTogether(scaleXAnimator, scaleYAnimator, alphaAnimator); animatorSet.SetDuration(500); animatorSet.SetInterpolator(new DecelerateInterpolator(2)); animatorSet.Start(); }
public static void showPopupWon(GameState gameState) { RelativeLayout popupContainer = (RelativeLayout)Shared.Activity.FindViewById(Resource.Id.popup_container); popupContainer.RemoveAllViews(); // popup PopupWonView popupWonView = new PopupWonView(Application.Context); popupWonView.SetGameState(gameState); int width = Application.Context.Resources.GetDimensionPixelSize(Resource.Dimension.popup_won_width); int height = Application.Context.Resources.GetDimensionPixelSize(Resource.Dimension.popup_won_height); RelativeLayout.LayoutParams relparams = new RelativeLayout.LayoutParams(width, height); relparams.AddRule(LayoutRules.CenterInParent); popupContainer.AddView(popupWonView, relparams); // animate all together ObjectAnimator scaleXAnimator = ObjectAnimator.OfFloat(popupWonView, "scaleX", 0f, 1f); ObjectAnimator scaleYAnimator = ObjectAnimator.OfFloat(popupWonView, "scaleY", 0f, 1f); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.PlayTogether(scaleXAnimator, scaleYAnimator); animatorSet.SetDuration(500); animatorSet.SetInterpolator(new DecelerateInterpolator(2)); popupWonView.SetLayerType(LayerType.Hardware, null); animatorSet.Start(); }
private void AnimatoOnAppearance(TextView logo, Action onEnd = null) { logo.ScaleX = 0; logo.ScaleY = 0; var duration = 500; ObjectAnimator scaleDownX = ObjectAnimator.OfFloat(logo, "ScaleX", 1f); ObjectAnimator scaleDownY = ObjectAnimator.OfFloat(logo, "ScaleY", 1f); scaleDownX.SetDuration(duration); scaleDownY.SetDuration(duration); AnimatorSet scaleDown = new AnimatorSet(); // scaleDown.SetDuration(duration); scaleDown.Play(scaleDownX).With(scaleDownY); // scaleDown.AnimationEnd += (s, e) => onEnd?.Invoke(); scaleDown.Start(); /* * new Android.OS.Handler().PostDelayed(() => * { * var bar = FindViewById(Resource.Id.progressBar) as ProgressBar; * bar.Visibility = ViewStates.Visible; * }, 600);//*/ }
public FlippingView(Context context, int width, int height) : base(context) { flipOutView = new ImageView(context); flipInView = new ImageView(context); AddView(flipOutView, width, height); AddView(flipInView, width, height); flipInView.RotationY = -90; var flipOutAnimator = ObjectAnimator.OfFloat(flipOutView, "rotationY", 0, 90); flipOutAnimator.SetInterpolator(new AccelerateInterpolator()); var flipInAnimator = ObjectAnimator.OfFloat(flipInView, "rotationY", -90, 0); flipInAnimator.SetInterpolator(new DecelerateInterpolator()); animations = new AnimatorSet(); animations.PlaySequentially(flipOutAnimator, flipInAnimator); animations.AnimationEnd += (sender, e) => { flipOutView.RotationY = 0; flipInView.RotationY = -90; Flipped?.Invoke(this, EventArgs.Empty); }; }
private void CreateAnimation() { if (animation == null) { var anim1 = ObjectAnimator.OfFloat(balls[0], "y", 0f, Height - balls[0].Height); anim1.SetDuration(500); var anim2 = anim1.Clone(); anim2.SetTarget(balls[1]); anim1.Update += delegate { Invalidate(); }; var ball2 = balls[2]; var animDown = ObjectAnimator.OfFloat(ball2, "y", 0f, Height - ball2.Height); animDown.SetDuration(500); animDown.SetInterpolator(new AccelerateInterpolator()); var animUp = ObjectAnimator.OfFloat(ball2, "y", Height - ball2.Height, 0f); animUp.SetDuration(500); animUp.SetInterpolator(new DecelerateInterpolator()); var s1 = new AnimatorSet(); s1.PlaySequentially(animDown, animUp); animDown.Update += delegate { Invalidate(); }; animUp.Update += delegate { Invalidate(); }; var s2 = (AnimatorSet)s1.Clone(); s2.SetTarget(balls[3]); animation = new AnimatorSet(); animation.PlayTogether(anim1, anim2, s1); animation.PlaySequentially(s1, s2); } }
/** * build FlexibleAnimation to control the progress * * @return Animatorset for control the progress */ private AnimatorSet buildFlexibleAnimation() { Ring ring = mRing; AnimatorSet set = new AnimatorSet(); ValueAnimator increment = ValueAnimator.OfFloat(0, MAX_PROGRESS_ARC - MIN_PROGRESS_ARC); increment.SetDuration(ANIMATOR_DURATION / 2); increment.SetInterpolator(new LinearInterpolator()); increment.Update += (sender, e) => { float sweeping = ring.sweeping; float value = (float)e.Animation.AnimatedValue; ring.sweep = sweeping + value; Invalidate(); }; increment.AddListener(animatorListener); ValueAnimator reduce = ValueAnimator.OfFloat(0, MAX_PROGRESS_ARC - MIN_PROGRESS_ARC); reduce.SetDuration(ANIMATOR_DURATION / 2); reduce.SetInterpolator(interpolator); reduce.Update += (sender, e) => { float sweeping = ring.sweeping; float starting = ring.starting; float value = (float)e.Animation.AnimatedValue; ring.sweep = sweeping - value; ring.start = starting + value; }; set.Play(reduce).After(increment); return(set); }
private void Button_Touch(object sender, View.TouchEventArgs e) { ImageButton button = sender as ImageButton; switch (e.Event.Action) { case MotionEventActions.Down: ObjectAnimator animatorX = ObjectAnimator.OfFloat(button, "scaleX", button.ScaleX, 1.25f); animatorX.SetDuration(duration); ObjectAnimator animatorY = ObjectAnimator.OfFloat(button, "scaleY", button.ScaleY, 1.25f); animatorY.SetDuration(duration); var animSet = new AnimatorSet(); animSet.PlayTogether(animatorX, animatorY); animSet.Start(); break; case MotionEventActions.Move: break; case MotionEventActions.Up: ObjectAnimator animatorX1 = ObjectAnimator.OfFloat(button, "scaleX", button.ScaleX, 1f); animatorX1.SetDuration(duration); ObjectAnimator animatorY1 = ObjectAnimator.OfFloat(button, "scaleY", button.ScaleY, 1f); animatorY1.SetDuration(duration); var reverseanimSet = new AnimatorSet(); reverseanimSet.PlayTogether(animatorX1, animatorY1); reverseanimSet.Start(); break; } }
private void SetupEventHandlers() { capturePhotoButtonSatart.Click += async(sender, e) => { clickTypeBtn = "capturePhotoButtonSatart"; capturePhotoButtonStop.Visibility = ViewStates.Visible; animatorSet = new AnimatorSet(); animatorSet.PlayTogether( ObjectAnimator.OfFloat(capturePhotoButtonStop, "alpha", 0f, 1f).SetDuration(2000), ObjectAnimator.OfFloat(capturePhotoButtonSatart, "alpha", 1f, 0f).SetDuration(2000)); animatorSet.SetDuration(500); animatorSet.AnimationEnd += EndAnimation; animatorSet.Start(); AutoFocus(); }; capturePhotoButtonStop.Click += async(sender, e) => { clickTypeBtn = "capturePhotoButtonStop"; capturePhotoButtonSatart.Visibility = ViewStates.Visible; animatorSet = new AnimatorSet(); animatorSet.PlayTogether( ObjectAnimator.OfFloat(capturePhotoButtonSatart, "alpha", 0f, 1), ObjectAnimator.OfFloat(capturePhotoButtonStop, "alpha", 1f, 0f)); animatorSet.SetDuration(500); animatorSet.AnimationEnd += EndAnimation; animatorSet.Start(); await StopRecorddVideo(); }; liveView.SurfaceTextureListener = this; }
public void SwipeRight() { var spots = ExtractRemainingTouristSpots(); if (spots.Count == 0) { return; } View target = _cardStackView.TopView; ValueAnimator rotation = ObjectAnimator.OfPropertyValuesHolder(target, PropertyValuesHolder.OfFloat("rotation", 10f)); rotation.SetDuration(200); ValueAnimator translateX = ObjectAnimator.OfPropertyValuesHolder(target, PropertyValuesHolder.OfFloat("translationX", 0f, 2000f)); ValueAnimator translateY = ObjectAnimator.OfPropertyValuesHolder(target, PropertyValuesHolder.OfFloat("translationY", 0f, 500f)); translateX.StartDelay = 100; translateY.StartDelay = 100; translateX.SetDuration(500); translateY.SetDuration(500); var set = new AnimatorSet(); set.PlayTogether(rotation, translateX, translateY); _cardStackView.Swipe(SwipeDirection.Right, set); }
public void Stop() { try { AnimatorSet set = new AnimatorSet(); ObjectAnimator scaleY = ObjectAnimator.OfFloat(View, "scaleY", 1.0f); // scaleY.setDuration(250); // scaleY.setInterpolator(new DecelerateInterpolator()); ObjectAnimator scaleX = ObjectAnimator.OfFloat(View, "scaleX", 1.0f); // scaleX.setDuration(250); // scaleX.setInterpolator(new DecelerateInterpolator()); set.SetDuration(150); set.SetInterpolator(new AccelerateDecelerateInterpolator()); set.PlayTogether(scaleY, scaleX); set.Start(); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var btnRun = FindViewById <Button>(Resource.Id.btnRun); var imageView = FindViewById <ImageView>(Resource.Id.faceIcon); btnRun.Click += delegate { var animatorX = ObjectAnimator.OfFloat(imageView, "scaleX", 1f, 2f).SetDuration(1000); var animatorY = ObjectAnimator.OfFloat(imageView, "scaleY", 1f, 2f).SetDuration(1000); var animatorSet = new AnimatorSet(); //animatorSet.PlaySequentially(animatorX, animatorY); animatorSet.PlayTogether(animatorX, animatorY); animatorSet.SetDuration(3000); animatorSet.Start(); }; }
private void StartAnimation() { var sunYStart = _sunView.Top; var sunYEnd = _skyView.Height; var heightAnimator = ObjectAnimator .OfFloat(_sunView, "y", sunYStart, sunYEnd) .SetDuration(3000); heightAnimator.SetInterpolator(new AccelerateInterpolator()); var sunsetSkyAnimator = ObjectAnimator .OfInt(_skyView, "backgroundColor", _blueSkyColor, _sunsetSkyColor) .SetDuration(3000) as ObjectAnimator; sunsetSkyAnimator.SetEvaluator(new ArgbEvaluator()); var nightSkyAnimator = ObjectAnimator .OfInt(_skyView, "backgroundColor", _sunsetSkyColor, _nightSkyColor) .SetDuration(1500) as ObjectAnimator; nightSkyAnimator.SetEvaluator(new ArgbEvaluator()); var animatorSet = new AnimatorSet(); animatorSet .Play(heightAnimator) .With(sunsetSkyAnimator) .Before(nightSkyAnimator); animatorSet.Start(); }
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 SetDesLikeDirection() { try { ValueAnimator rotation = ObjectAnimator.OfPropertyValuesHolder(CardStack.TopView, PropertyValuesHolder.OfFloat("rotation", -10f)); rotation.SetDuration(200); ValueAnimator translateX = ObjectAnimator.OfPropertyValuesHolder(CardStack.TopView, PropertyValuesHolder.OfFloat("translationX", 0f, -2000f)); ValueAnimator translateY = ObjectAnimator.OfPropertyValuesHolder(CardStack.TopView, PropertyValuesHolder.OfFloat("translationY", 0f, -500f)); translateX.StartDelay = 100; translateY.StartDelay = 100; translateX.SetDuration(500); translateY.SetDuration(500); AnimatorSet cardAnimationSet = new AnimatorSet(); cardAnimationSet.PlayTogether(rotation, translateX, translateY); ObjectAnimator overlayAnimator = ObjectAnimator.OfFloat(CardStack.TopView.OverlayContainer, "alpha", 0f, 1f); overlayAnimator.SetDuration(200); AnimatorSet overlayAnimationSet = new AnimatorSet(); overlayAnimationSet.PlayTogether(overlayAnimator); CardStack.Swipe(SwipeDirection.Left, overlayAnimationSet); //int index = CardStack.TopIndex - 1; ////CardContainerView view = CardStack.BottomView; //if (index > -1) // CardDisappeared(index); } catch (Exception e) { Console.WriteLine(e); } }
private AnimatorSet createContentTextShowAnimation(View currentContentText, View newContentText) { int positionDeltaPx = dpToPixels(CONTENT_TEXT_POS_DELTA_Y_DP); AnimatorSet animations = new AnimatorSet(); Animator currentContentMoveUp = ObjectAnimator.OfFloat(currentContentText, "y", 0, -positionDeltaPx); currentContentMoveUp.SetDuration(ANIM_CONTENT_TEXT_HIDE_TIME); var endListener = new AnimatorEndListener(); endListener.OnEndAnimation += () => { mContentTextContainer.RemoveView(currentContentText); }; currentContentMoveUp.AddListener(endListener); Animator currentContentFadeOut = ObjectAnimator.OfFloat(currentContentText, "alpha", 1, 0); currentContentFadeOut.SetDuration(ANIM_CONTENT_TEXT_HIDE_TIME); animations.PlayTogether(currentContentMoveUp, currentContentFadeOut); Animator newContentMoveUp = ObjectAnimator.OfFloat(newContentText, "y", positionDeltaPx, 0); newContentMoveUp.SetDuration(ANIM_CONTENT_TEXT_SHOW_TIME); Animator newContentFadeIn = ObjectAnimator.OfFloat(newContentText, "alpha", 0, 1); newContentFadeIn.SetDuration(ANIM_CONTENT_TEXT_SHOW_TIME); animations.PlayTogether(newContentMoveUp, newContentFadeIn); animations.SetInterpolator(new DecelerateInterpolator()); return(animations); }
/** * Toogle the play/pause status * * @param withAnim false to change status without animation */ public void Toggle(bool withAnim) { if (withAnim) { if (mAnimatorSet != null) { mAnimatorSet.Cancel(); } mAnimatorSet = new AnimatorSet(); bool isPlay = mDrawable.IsPlay(); ObjectAnimator colorAnim = ObjectAnimator.OfInt(this, "color", isPlay ? mPauseBackgroundColor : mPlayBackgroundColor); colorAnim.SetEvaluator(new ArgbEvaluator()); Animator pausePlayAnim = mDrawable.GetPausePlayAnimator(); mAnimatorSet.SetInterpolator(new DecelerateInterpolator()); mAnimatorSet.SetDuration(PlayPauseAnimationDuration); mAnimatorSet.PlayTogether(colorAnim, pausePlayAnim); mAnimatorSet.Start(); } else { bool isPlay = mDrawable.IsPlay(); InitStatus(!isPlay); Invalidate(); } }
public static AnimatorSet CreateMovementAnimation(View view, float canvasX, float canvasY, float offsetStartX, float offsetStartY, float offsetEndX, float offsetEndY, EventHandler animationEndHandler) { view.Alpha = INVISIBLE; var alphaIn = ObjectAnimator.OfFloat(view, ALPHA, INVISIBLE, VISIBLE).SetDuration(500); var setUpX = ObjectAnimator.OfFloat(view, COORD_X, canvasX + offsetStartX).SetDuration(INSTANT); var setUpY = ObjectAnimator.OfFloat(view, COORD_Y, canvasY + offsetStartY).SetDuration(INSTANT); var moveX = ObjectAnimator.OfFloat(view, COORD_X, canvasX + offsetEndX).SetDuration(1000); var moveY = ObjectAnimator.OfFloat(view, COORD_Y, canvasY + offsetEndY).SetDuration(1000); moveX.StartDelay = 1000; moveY.StartDelay = 1000; var alphaOut = ObjectAnimator.OfFloat(view, ALPHA, INVISIBLE).SetDuration(500); alphaOut.StartDelay = 2500; var aset = new AnimatorSet(); aset.Play(setUpX).With(setUpY).Before(alphaIn).Before(moveX).With(moveY).Before(alphaOut); var handler = new Handler(); handler.PostDelayed(() => { animationEndHandler(view, EventArgs.Empty); }, 3000); return(aset); }
protected void ToggleContent(bool prev) { int oldElementIndex = mActiveElementIndex; PaperOnboardingPage newElement = prev ? toggleToPreviousElement() : toggleToNextElement(); if (newElement == null) { if (prev && mOnLeftOutListener != null) { mOnLeftOutListener.OnLeftOut(); } if (!prev && mOnRightOutListener != null) { mOnRightOutListener.OnRightOut(); } return; } int newPagerPosX = calculateNewPagerPosition(mActiveElementIndex); // 1 - animate BG AnimatorSet bgAnimation = createBGAnimatorSet(newElement.BackgroundColor); // 2 - animate pager position Animator pagerMoveAnimation = ObjectAnimator.OfFloat(mPagerIconsContainer, "x", mPagerIconsContainer.GetX(), newPagerPosX); pagerMoveAnimation.SetDuration(ANIM_PAGER_BAR_MOVE_TIME); // 3 - animate pager icons AnimatorSet pagerIconAnimation = createPagerIconAnimation(oldElementIndex, mActiveElementIndex); // 4 animate content text ViewGroup newContentText = createContentTextView(newElement); mContentTextContainer.AddView(newContentText); AnimatorSet contentTextShowAnimation = createContentTextShowAnimation( mContentTextContainer.GetChildAt(mContentTextContainer.ChildCount - 2), newContentText); // 5 animate content icon ImageView newContentIcon = createContentIconView(newElement); mContentIconContainer.AddView(newContentIcon); AnimatorSet contentIconShowAnimation = createContentIconShowAnimation( mContentIconContainer.GetChildAt(mContentIconContainer.ChildCount - 2), newContentIcon); // 6 animate centering of all content Animator centerContentAnimation = createContentCenteringVerticalAnimation(newContentText, newContentIcon); centerContentAnimation.Start(); bgAnimation.Start(); pagerMoveAnimation.Start(); pagerIconAnimation.Start(); contentIconShowAnimation.Start(); contentTextShowAnimation.Start(); if (mOnChangeListener != null) { mOnChangeListener.OnPageChanged(oldElementIndex, mActiveElementIndex); } }
public override void OnKeyboardHide() { base.OnKeyboardHide(); long duration = 300; AnimatorSet set = new AnimatorSet(); set.SetInterpolator(new AccelerateDecelerateInterpolator()); set.SetTarget(this.LogoImage); set.SetDuration(duration); set.PlayTogether(new[] { ObjectAnimator.OfFloat(this.LogoImage, "scaleX", 1f), ObjectAnimator.OfFloat(this.LogoImage, "scaleY", 1f), ObjectAnimator.OfFloat(this.LogoImage, "translationY", 0f) }); set.Start(); AnimatorSet set2 = new AnimatorSet(); set2.SetInterpolator(new AccelerateDecelerateInterpolator()); set2.SetTarget(this.InputLayout); set2.SetDuration(duration); set2.PlayTogether(new[] { ObjectAnimator.OfFloat(this.InputLayout, "translationY", 0f) }); set2.Start(); }
public override void OnKeyboardShow() { base.OnKeyboardShow(); long duration = 500; AnimatorSet set1 = new AnimatorSet(); set1.SetInterpolator(new AccelerateDecelerateInterpolator()); set1.SetTarget(this.LogoImage); set1.SetDuration(duration); set1.PlayTogether(new[] { ObjectAnimator.OfFloat(this.LogoImage, "scaleX", .45f), ObjectAnimator.OfFloat(this.LogoImage, "scaleY", .45f), ObjectAnimator.OfFloat(this.LogoImage, "translationY", ViewBuilder.AsPixels(-58f)) }); set1.Start(); AnimatorSet set2 = new AnimatorSet(); set2.SetInterpolator(new AccelerateDecelerateInterpolator()); set2.SetTarget(this.InputLayout); set2.SetDuration(duration); set2.PlayTogether(new[] { ObjectAnimator.OfFloat(this.InputLayout, "translationY", ViewBuilder.AsPixels(-130f)) }); set2.Start(); }
private void ReverseAnimator() { var width = Resources.GetDimensionPixelSize(Resource.Dimension.image_width); var height = Resources.GetDimensionPixelSize(Resource.Dimension.image_height); var margin = Resources.GetDimensionPixelSize(Resource.Dimension.image_margin); var padding = Resources.GetDimensionPixelSize(Resource.Dimension.image_padding); var scrollAnimator = ViewPropertyObjectAnimator .Animate(scrollView) .ScrollY(0) .Get(); var imageAnimator = ViewPropertyObjectAnimator .Animate(imageView) .Width(width) .Height(height) .Margin(margin) .Padding(padding) .RotationX(0) .RotationY(0) .Get(); animatorSet?.Cancel(); animatorSet = new AnimatorSet(); animatorSet.PlayTogether(scrollAnimator, imageAnimator); animatorSet.SetDuration(2000); animatorSet.Start(); }
private void Animator() { var paddingTop = Resources.GetDimensionPixelSize(Resource.Dimension.scroll_padding_top); var scrollAnimator = ViewPropertyObjectAnimator .Animate(scrollView) .ScrollY(paddingTop) .Get(); var imageAnimator = ViewPropertyObjectAnimator .Animate(imageView) .VerticalMargin(140) .RightMarginBy(10) .Width(600) .Height(700) .RotationXBy(20) .TopPadding(10) .RotationY(360) .LeftPaddingBy(100) .RightPadding(300) .Get(); animatorSet?.Cancel(); animatorSet = new AnimatorSet(); animatorSet.PlayTogether(scrollAnimator, imageAnimator); animatorSet.SetDuration(2000); animatorSet.Start(); }
public FcAnimatorListenerAnonymousInnerClassHelper6(FcItemAnimator outerInstance, com.samsung.android.sdk.professionalaudio.widgets.refactor.OrdinalAppViewHolder holder, View oldView, View newView, AnimatorSet animator) { this.outerInstance = outerInstance; this.holder = holder; this.oldView = oldView; this.newView = newView; this.animator = animator; }
/// <summary> /// This method will be called when app root layout is to be expanded from 0 to some width /// /// Old holder will contain a root layout with with = 0, new holder will contain a root layout /// with some width greater than 0. /// </summary> /// <param name="changeInfo"> </param> /// <param name="oldHolder"> </param> /// <param name="newHolder"> </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: private void animateOrdinalAppExpanding(final ChangeInfo changeInfo, final OrdinalAppViewHolder oldHolder, final OrdinalAppViewHolder newHolder) private void animateOrdinalAppExpanding(ChangeInfo changeInfo, OrdinalAppViewHolder oldHolder, OrdinalAppViewHolder newHolder) { if (FcConstants.OPT_DETAILED_LOGS) { Log.d(TAG, "animateOrdinalAppExpanding"); Log.d(TAG, " change info: " + changeInfo); Log.d(TAG, " old holder : " + oldHolder); if (null != oldHolder) { Log.d(TAG, " old view: " + oldHolder.itemView); Log.d(TAG, " needs scroll focus: " + oldHolder.needsScrollFocus()); } if (null != newHolder) { Log.d(TAG, " new view: " + newHolder.itemView); Log.d(TAG, " needs scroll focus: " + newHolder.needsScrollFocus()); } } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View oldView = (null == oldHolder) ? null : oldHolder.itemView; View oldView = (null == oldHolder) ? null : oldHolder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View newView = (null == newHolder) ? null : newHolder.itemView; View newView = (null == newHolder) ? null : newHolder.itemView; if (null != oldView) { IList<Animator> oldAnimatorList = new List<Animator>(); addOrdinalAppButtonClickedAnimation(oldAnimatorList, oldHolder); addTranslateOldAnimator(oldAnimatorList, changeInfo, oldHolder); acquireUserScrolling(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.Animator expandAnimator = mFactory.createExpandActionsAnimator(oldHolder.mDeviceRootLayout, getChangeDuration()); Animator expandAnimator = mFactory.createExpandActionsAnimator(oldHolder.mDeviceRootLayout, ChangeDuration); expandAnimator.Duration = ChangeDuration; expandAnimator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper10(this, oldHolder, oldView, newView, expandAnimator)); oldAnimatorList.Add(expandAnimator); AnimatorSet mainAnimator = new AnimatorSet(); mainAnimator.Duration = ChangeDuration; mainAnimator.playTogether(oldAnimatorList); mRunningAnimators[oldHolder] = mainAnimator; mainAnimator.start(); } if (null != newView) { acquireUserScrolling(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet translationAnimators = new android.animation.AnimatorSet(); AnimatorSet translationAnimators = new AnimatorSet(); if (RtlDirection) { if (FcConstants.OPT_DETAILED_LOGS) { Log.v(TAG, "RTL direction: setting animation duration to 0"); } translationAnimators.Duration = 0; } else { translationAnimators.Duration = ChangeDuration; } translationAnimators.playTogether(ObjectAnimator.ofFloat(newHolder.itemView, View.TRANSLATION_X, 0), ObjectAnimator.ofFloat(newHolder.itemView, View.TRANSLATION_Y, 0)); translationAnimators.addListener(new FcAnimatorListenerAnonymousInnerClassHelper11(this, newHolder, oldView, newView, translationAnimators)); mRunningAnimators[newHolder] = translationAnimators; translationAnimators.start(); } }
public FcAnimatorListenerAnonymousInnerClassHelper5(FcItemAnimator outerInstance, RecyclerView.ViewHolder newHolder, View oldView, View newView, AnimatorSet animator) { this.outerInstance = outerInstance; this.newHolder = newHolder; this.oldView = oldView; this.newView = newView; this.animator = animator; }
public FcAnimatorListenerAnonymousInnerClassHelper9(FcItemAnimator outerInstance, com.samsung.android.sdk.professionalaudio.widgets.refactor.OrdinalAppViewHolder newHolder, View oldView, View newView, AnimatorSet translationAnimators) { this.outerInstance = outerInstance; this.newHolder = newHolder; this.oldView = oldView; this.newView = newView; this.translationAnimators = translationAnimators; }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: @Override protected void animateMoveImpl(final android.support.v7.widget.RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) protected internal override void animateMoveImpl(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View view = holder.itemView; View view = holder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int deltaX = toX - fromX; int deltaX = toX - fromX; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int deltaY = toY - fromY; int deltaY = toY - fromY; if (FcConstants.OPT_DETAILED_LOGS) { Log.d(TAG, "animateMoveImpl(delta: " + deltaX + ", " + deltaY + ")"); Log.d(TAG, " duration: " + MoveDuration); Log.d(TAG, " translation: " + view.TranslationX + ", " + view.TranslationY); } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet animator = new android.animation.AnimatorSet(); AnimatorSet animator = new AnimatorSet(); animator.playTogether(ObjectAnimator.ofFloat(view, View.TRANSLATION_X, 0), ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, 0)); acquireUserScrolling(); animator.Duration = MoveDuration; animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper3(this, holder)); mRunningAnimators[holder] = animator; animator.start(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: private void animateOrdinalAppUpdate(final ChangeInfo changeInfo, final OrdinalAppViewHolder holder, final OrdinalAppViewHolder newHolder) private void animateOrdinalAppUpdate(ChangeInfo changeInfo, OrdinalAppViewHolder holder, OrdinalAppViewHolder newHolder) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View oldView = (null == holder) ? null : holder.itemView; View oldView = (null == holder) ? null : holder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View newView = (null == newHolder) ? null : newHolder.itemView; View newView = (null == newHolder) ? null : newHolder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final boolean hasNoTranslations = changeInfo.hasNoTranslation(); bool hasNoTranslations = changeInfo.hasNoTranslation(); if (FcConstants.OPT_DETAILED_LOGS) { Log.d(TAG, "animateOrdinalAppUpdate(" + holder + ")"); Log.d(TAG, " change info: " + changeInfo); Log.d(TAG, " no translations: " + changeInfo.hasNoTranslation()); } if (oldView != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet animator = new android.animation.AnimatorSet(); AnimatorSet animator = new AnimatorSet(); animator.playTogether(ObjectAnimator.ofFloat(oldView, View.TRANSLATION_X, changeInfo.toX - changeInfo.fromX), ObjectAnimator.ofFloat(oldView, View.TRANSLATION_Y, changeInfo.toY - changeInfo.fromY)); if (hasNoTranslations) { if (FcConstants.OPT_DETAILED_LOGS) { Log.v(TAG, "animateOrdinalAppUpdate -> oldHolder -> no translations, setting duration to 0"); } animator.Duration = 0; } else { animator.Duration = ChangeDuration; } // acquireUserScrolling(); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper6(this, holder, oldView, newView, animator)); mRunningAnimators[holder] = animator; animator.start(); } if (newView != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet animator = new android.animation.AnimatorSet(); AnimatorSet animator = new AnimatorSet(); animator.playTogether(ObjectAnimator.ofFloat(newView, View.TRANSLATION_X, 0), ObjectAnimator.ofFloat(newView, View.TRANSLATION_Y, 0)); if (hasNoTranslations) { if (FcConstants.OPT_DETAILED_LOGS) { Log.v(TAG, "animateOrdinalAppUpdate -> oldHolder -> no translations, setting duration to 0"); } animator.Duration = 0; } else { animator.Duration = ChangeDuration; } acquireUserScrolling(); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper7(this, newHolder, oldView, newView, animator)); mRunningAnimators[newHolder] = animator; animator.start(); } }
private void addTranslateOldAnimator(IList<Animator> animatorList, ChangeInfo change, OrdinalAppViewHolder holder) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet translationAnimators = new android.animation.AnimatorSet(); AnimatorSet translationAnimators = new AnimatorSet(); translationAnimators.playTogether(ObjectAnimator.ofFloat(holder.itemView, View.TRANSLATION_X, change.toX - change.fromX), ObjectAnimator.ofFloat(holder.itemView, View.TRANSLATION_Y, change.toY - change.fromY)); translationAnimators.Duration = ChangeDuration; animatorList.Add(translationAnimators); }
/// <summary> /// @brief /// </summary> /// <param name="changeInfo"> </param> /// <param name="holder"> </param> /// <param name="newHolder"> </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: private void animateChangeDefault(final ChangeInfo changeInfo, final android.support.v7.widget.RecyclerView.ViewHolder holder, final android.support.v7.widget.RecyclerView.ViewHolder newHolder) private void animateChangeDefault(ChangeInfo changeInfo, RecyclerView.ViewHolder holder, RecyclerView.ViewHolder newHolder) { if (FcConstants.OPT_DETAILED_LOGS) { Log.d(TAG, "animateChangeDefault"); Log.d(TAG, " duration = " + ChangeDuration); Log.d(TAG, " changeInfo: " + changeInfo); Log.d(TAG, " old = " + holder); Log.d(TAG, " new = " + newHolder); } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View oldView = holder == null ? null : holder.itemView; View oldView = holder == null ? null : holder.itemView; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View newView = newHolder != null ? newHolder.itemView : null; View newView = newHolder != null ? newHolder.itemView : null; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final boolean hasNoTranslations = changeInfo.hasNoTranslation(); bool hasNoTranslations = changeInfo.hasNoTranslation(); if (FcConstants.OPT_DETAILED_LOGS) { Log.d(TAG, " old view = " + oldView); Log.d(TAG, " new view = " + newView); Log.d(TAG, " has no translations = " + hasNoTranslations); } if (oldView != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet animator = new android.animation.AnimatorSet(); AnimatorSet animator = new AnimatorSet(); if (hasNoTranslations) { animator.Duration = 0; } else { animator.Duration = ChangeDuration; } // acquireUserScrolling(); animator.playSequentially(ObjectAnimator.ofFloat(oldView, View.TRANSLATION_X, changeInfo.toX - changeInfo.fromX), ObjectAnimator.ofFloat(oldView, View.TRANSLATION_Y, changeInfo.toY - changeInfo.fromY)); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper4(this, holder, oldView, newView, animator)); mRunningAnimators[holder] = animator; animator.start(); } if (newView != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.animation.AnimatorSet animator = new android.animation.AnimatorSet(); AnimatorSet animator = new AnimatorSet(); if (hasNoTranslations) { animator.Duration = 0; } else { animator.Duration = ChangeDuration; } acquireUserScrolling(); animator.playTogether(ObjectAnimator.ofFloat(newView, View.TRANSLATION_X, 0), ObjectAnimator.ofFloat(newView, View.TRANSLATION_Y, 0)); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper5(this, newHolder, oldView, newView, animator)); mRunningAnimators[newHolder] = animator; animator.start(); } }