Пример #1
0
        void InternalReveal(bool revealed)
        {
            // make sure we're not doubly requesting the same thing. That would
            // cause a hitch in the animation.
            if (Revealed != revealed)
            {
                Revealed = revealed;

                // if we're currently animating, cancel the animation
                if (Animator != null)
                {
                    Animator.Cancel( );
                }

                int yOffset = revealed ? 0 : ButtonLayout.LayoutParameters.Height;

                // setup an animation from our current mask scale to the new one.
                Animator = ValueAnimator.OfInt((int)ButtonLayout.GetY( ), yOffset);

                Animator.AddUpdateListener(this);
                Animator.AddListener(new NavToolbarAnimationListener()
                {
                    NavbarToolbar = this
                });
                Animator.SetDuration((long)(PrivateSubNavToolbarConfig.SlideRate * 1000.0f));

                Animator.Start( );
            }
        }
        protected void Init(float duration, AnimationUpdate updateDelegate, AnimationComplete completeDelegate)
        {
            Animator = ValueAnimator.OfFloat(0.00f, 1.00f);

            Animator.AddUpdateListener(this);
            Animator.AddListener(this);

            // convert duration to milliseconds
            Animator.SetDuration((int)(duration * 1000.0f));

            AnimationUpdateDelegate   = updateDelegate;
            AnimationCompleteDelegate = completeDelegate;
        }