Exemplo n.º 1
0
        private void ExecuteAlphaAnimation(int from, int to, int duration)
        {
            CheckAttrsValues();

            ValueAnimator valueAnimator = ValueAnimator.OfInt(from, to);

            valueAnimator.SetDuration(duration);
            valueAnimator.AddUpdateListener(new AnonymousAnimatorUpdateListener(animation => {
                int newAlpha        = (int)animation.AnimatedValue;
                this.ForgroundAlpha = newAlpha;
                //anim finished
                if (newAlpha == to)
                {
                    valueAnimator.Cancel();
                    this.animList.Clear();
                    if (this.onAlphaFinishedListener != null)
                    {
                        if (from > to)
                        {
                            this.onAlphaFinishedListener.OnHideFinished();
                        }
                        else
                        {
                            this.onAlphaFinishedListener.OnShowFinished();
                        }
                    }
                }
            }));
            valueAnimator.Start();
            animList.Add(valueAnimator);
        }
Exemplo n.º 2
0
        public virtual void Select(bool setActiveColor, int animationDuration)
        {
            isActive = true;

            ValueAnimator animator = ValueAnimator.OfInt(containerView.PaddingTop, paddingTopActive);

            animator.AddUpdateListener(new AnimatorUpdateListenerAnonymousInnerClass(this));
            animator.SetDuration(animationDuration);
            animator.Start();

            iconView.Selected = true;
            if (setActiveColor)
            {
                labelView.SetTextColor(new Color(mActiveColor));
            }
            else
            {
                labelView.SetTextColor(new Color(mBackgroundColor));
            }

            if (badgeItem != null)
            {
                badgeItem.Select();
            }
        }
Exemplo n.º 3
0
        public virtual void unSelect(bool setActiveColor, int animationDuration)
        {
            isActive = false;

            ValueAnimator animator = ValueAnimator.OfInt(containerView.PaddingTop, paddingTopInActive);

            animator.AddUpdateListener(new AnimatorUpdateListenerAnonymousInnerClass2(this));
            animator.SetDuration(animationDuration);
            animator.Start();

            labelView.SetTextColor(new Color(mInActiveColor));
            iconView.Selected = false;

            if (badgeItem != null)
            {
                badgeItem.UnSelect();
            }
        }