Пример #1
0
        public void SetCardStreamAnimator(CardStreamAnimator animators)
        {
            if (animators == null)
            {
                mAnimators = new CardStreamAnimator.EmptyAnimator();
            }
            else
            {
                mAnimators = animators;
            }

            LayoutTransition layoutTransition = LayoutTransition;

            if (layoutTransition != null)
            {
                layoutTransition.SetAnimator(LayoutTransitionType.Appearing, mAnimators.GetAppearingAnimator(Context));
                layoutTransition.SetAnimator(LayoutTransitionType.Disappearing, mAnimators.GetDisappearingAnimator(Context));
            }
        }
Пример #2
0
        protected override void OnLayout(bool changed, int l, int t, int r, int b)
        {
            base.OnLayout(changed, l, t, r, b);
            Log.Debug(TAG, "OnLayout: " + changed);

            if (changed && !mLayouted)
            {
                mLayouted = true;

                ObjectAnimator   animator;
                LayoutTransition layoutTransition = new LayoutTransition();

                animator = mAnimators.GetDisappearingAnimator(Context);
                layoutTransition.SetAnimator(LayoutTransitionType.Disappearing, animator);

                animator = mAnimators.GetAppearingAnimator(Context);
                layoutTransition.SetAnimator(LayoutTransitionType.Appearing, animator);

                layoutTransition.AddTransitionListener(mTransitionListener);

                if (animator != null)
                {
                    layoutTransition.SetDuration(animator.Duration);
                }

                LayoutTransition = layoutTransition;

                if (mShowInitialAnimation)
                {
                    RunInitialAnimations();
                }

                if (mFirstVisibleCardTag != null)
                {
                    ScrollToCard(mFirstVisibleCardTag);
                    mFirstVisibleCardTag = null;
                }
            }
        }