示例#1
0
        protected void AnimateFabBackgroundColor(int backgroundColor)
        {
            var fabColorAnimator = ObjectAnimator.OfArgb(submitAnswer, "backgroundColor", Color.White, backgroundColor);

            fabColorAnimator.SetDuration(colorAnimationDuration).SetInterpolator(fastOutSlowInInterpolator);
            fabColorAnimator.Start();
        }
            public override void OnTransitionEnd(Transition transition)
            {
                var            hero  = da.FindViewById <ImageView> (Resource.Id.photo);
                ObjectAnimator color = ObjectAnimator.OfArgb(hero.Drawable, "tint",
                                                             da.Resources.GetColor(Resource.Color.photo_tint), 0);

                color.Start();

                da.FindViewById(Resource.Id.info).Animate().Alpha(1.0f);
                da.FindViewById(Resource.Id.star).Animate().Alpha(1.0f);
                da.Window.EnterTransition.RemoveListener(this);
            }
        public override void OnBackPressed()
        {
            var hero  = FindViewById <ImageView> (Resource.Id.photo);
            var color = ObjectAnimator.OfArgb(hero.Drawable, "tint", Resources.GetColor(Resource.Color.photo_tint), 0);

            color.AnimationEnd += delegate {
                FinishAfterTransition();
            };
            color.Start();
            FindViewById(Resource.Id.info).Animate().Alpha(0.0f);
            FindViewById(Resource.Id.star).Animate().Alpha(0.0f);
        }
 private void SetFadeAnimation(TextView text, long duration, bool show = true)
 {
     if (show)
     {
         ObjectAnimator colorAnimator = ObjectAnimator.OfArgb(text, "TextColor", Color.Argb(0, 255, 255, 255), Color.Argb(255, 255, 255, 255));
         colorAnimator.SetDuration(duration);
         colorAnimator.Start();
     }
     else
     {
         ObjectAnimator colorAnimator = ObjectAnimator.OfArgb(text, "TextColor", text.CurrentTextColor, Color.Argb(0, 255, 255, 255));
         colorAnimator.SetDuration(duration);
         colorAnimator.Start();
     }
 }