Exemple #1
0
 public override void initializeInvalidateRegion(int left, int top, int right, int
                                                 bottom)
 {
     android.graphics.RectF region = mPreviousRegion;
     region.set(left, top, right, bottom);
     region.inset(-1.0f, -1.0f);
     if (mFillBefore)
     {
         int count = mAnimations.size();
         java.util.ArrayList <android.view.animation.Animation> animations = mAnimations;
         android.view.animation.Transformation temp = mTempTransformation;
         android.view.animation.Transformation previousTransformation = mPreviousTransformation;
         {
             for (int i = count - 1; i >= 0; --i)
             {
                 android.view.animation.Animation a = animations.get(i);
                 temp.clear();
                 android.view.animation.Interpolator interpolator = a.mInterpolator;
                 a.applyTransformation(interpolator != null ? interpolator.getInterpolation(0.0f) :
                                       0.0f, temp);
                 previousTransformation.compose(temp);
             }
         }
     }
 }
Exemple #2
0
        public override bool getTransformation(long currentTime, android.view.animation.Transformation
                                               t)
        {
            int count = mAnimations.size();

            java.util.ArrayList <android.view.animation.Animation> animations = mAnimations;
            android.view.animation.Transformation temp = mTempTransformation;
            bool more    = false;
            bool started = false;
            bool ended   = true;

            t.clear();
            {
                for (int i = count - 1; i >= 0; --i)
                {
                    android.view.animation.Animation a = animations.get(i);
                    temp.clear();
                    more = a.getTransformation(currentTime, temp, getScaleFactor()) || more;
                    t.compose(temp);
                    started = started || a.hasStarted();
                    ended   = a.hasEnded() && ended;
                }
            }
            if (started && !mStarted)
            {
                if (mListener != null)
                {
                    mListener.onAnimationStart(this);
                }
                mStarted = true;
            }
            if (ended != mEnded)
            {
                if (mListener != null)
                {
                    mListener.onAnimationEnd(this);
                }
                mEnded = ended;
            }
            return(more);
        }