Example #1
0
        /// <summary>Add a child animation to this animation set.</summary>
        /// <remarks>
        /// Add a child animation to this animation set.
        /// The transforms of the child animations are applied in the order
        /// that they were added
        /// </remarks>
        /// <param name="a">Animation to add.</param>
        public virtual void addAnimation(android.view.animation.Animation a)
        {
            mAnimations.add(a);
            bool noMatrix = (mFlags & PROPERTY_MORPH_MATRIX_MASK) == 0;

            if (noMatrix && a.willChangeTransformationMatrix())
            {
                mFlags |= PROPERTY_MORPH_MATRIX_MASK;
            }
            bool changeBounds = (mFlags & PROPERTY_CHANGE_BOUNDS_MASK) == 0;

            if (changeBounds && a.willChangeTransformationMatrix())
            {
                mFlags |= PROPERTY_CHANGE_BOUNDS_MASK;
            }
            if ((mFlags & PROPERTY_DURATION_MASK) == PROPERTY_DURATION_MASK)
            {
                mLastEnd = mStartOffset + mDuration;
            }
            else
            {
                if (mAnimations.size() == 1)
                {
                    mDuration = a.getStartOffset() + a.getDuration();
                    mLastEnd  = mStartOffset + mDuration;
                }
                else
                {
                    mLastEnd  = System.Math.Max(mLastEnd, a.getStartOffset() + a.getDuration());
                    mDuration = mLastEnd - mStartOffset;
                }
            }
            mDirty = true;
        }
Example #2
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);
             }
         }
     }
 }
        /// <summary>Returns the animation to be applied to the specified view.</summary>
        /// <remarks>
        /// Returns the animation to be applied to the specified view. The returned
        /// animation is delayed by an offset computed according to the information
        /// provided by
        /// <see cref="AnimationParameters">AnimationParameters</see>
        /// .
        /// This method is called by view groups to obtain the animation to set on
        /// a specific child.
        /// </remarks>
        /// <param name="view">the view to animate</param>
        /// <returns>
        /// an animation delayed by the number of milliseconds returned by
        /// <see cref="getDelayForView(android.view.View)">getDelayForView(android.view.View)
        ///     </see>
        /// </returns>
        /// <seealso cref="getDelay()">getDelay()</seealso>
        /// <seealso cref="setDelay(float)">setDelay(float)</seealso>
        /// <seealso cref="getDelayForView(android.view.View)">getDelayForView(android.view.View)
        ///     </seealso>
        public android.view.animation.Animation getAnimationForView(android.view.View view
                                                                    )
        {
            long delay = getDelayForView(view) + mAnimation.getStartOffset();

            mMaxDelay = System.Math.Max(mMaxDelay, delay);
            android.view.animation.Animation animation = mAnimation.clone();
            animation.setStartOffset(delay);
            return(animation);
        }
Example #4
0
 public virtual void setOutAnimation(android.view.animation.Animation arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.widget.ViewAnimator._setOutAnimation12413, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.widget.ViewAnimator.staticClass, global::android.widget.ViewAnimator._setOutAnimation12413, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Example #5
0
 public virtual void addAnimation(android.view.animation.Animation arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.view.animation.AnimationSet._addAnimation9967, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.view.animation.AnimationSet.staticClass, global::android.view.animation.AnimationSet._addAnimation9967, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Example #6
0
 void android.view.animation.Animation.AnimationListener.onAnimationEnd(android.view.animation.Animation arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.view.animation.Animation.AnimationListener_._onAnimationEnd9901, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.view.animation.Animation.AnimationListener_.staticClass, global::android.view.animation.Animation.AnimationListener_._onAnimationEnd9901, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Example #7
0
        public override void setStartTime(long startTimeMillis)
        {
            base.setStartTime(startTimeMillis);
            int count = mAnimations.size();

            java.util.ArrayList <android.view.animation.Animation> animations = mAnimations;
            {
                for (int i = 0; i < count; i++)
                {
                    android.view.animation.Animation a = animations.get(i);
                    a.setStartTime(startTimeMillis);
                }
            }
        }
Example #8
0
        public override long getStartTime()
        {
            long startTime = long.MaxValue;
            int  count     = mAnimations.size();

            java.util.ArrayList <android.view.animation.Animation> animations = mAnimations;
            {
                for (int i = 0; i < count; i++)
                {
                    android.view.animation.Animation a = animations.get(i);
                    startTime = System.Math.Min(startTime, a.getStartTime());
                }
            }
            return(startTime);
        }
Example #9
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);
        }
 /// <summary>
 /// Creates a new layout animation controller with the specified delay
 /// and the specified animation.
 /// </summary>
 /// <remarks>
 /// Creates a new layout animation controller with the specified delay
 /// and the specified animation.
 /// </remarks>
 /// <param name="animation">the animation to use on each child of the view group</param>
 /// <param name="delay">the delay by which each child's animation must be offset</param>
 public LayoutAnimationController(android.view.animation.Animation animation, float
                                  delay)
 {
     mDelay = delay;
     setAnimation(animation);
 }
		/// <summary>
		/// Sets the animation to be run on each child of the view group on which
		/// this layout animation controller is .
		/// </summary>
		/// <remarks>
		/// Sets the animation to be run on each child of the view group on which
		/// this layout animation controller is .
		/// </remarks>
		/// <param name="animation">the animation to run on each child of the view group</param>
		/// <seealso cref="setAnimation(android.content.Context, int)">setAnimation(android.content.Context, int)
		/// 	</seealso>
		/// <seealso cref="getAnimation()">getAnimation()</seealso>
		/// <attr>ref android.R.styleable#LayoutAnimation_animation</attr>
		public virtual void setAnimation(android.view.animation.Animation animation)
		{
			mAnimation = animation;
			mAnimation.setFillBefore(true);
		}
 /// <summary>
 /// Creates a new layout animation controller with the specified delays
 /// and the specified animation.
 /// </summary>
 /// <remarks>
 /// Creates a new layout animation controller with the specified delays
 /// and the specified animation.
 /// </remarks>
 /// <param name="animation">the animation to use on each child of the view group</param>
 /// <param name="columnDelay">the delay by which each column animation must be offset
 ///     </param>
 /// <param name="rowDelay">the delay by which each row animation must be offset</param>
 public GridLayoutAnimationController(android.view.animation.Animation animation,
                                      float columnDelay, float rowDelay) : base(animation)
 {
     mColumnDelay = columnDelay;
     mRowDelay    = rowDelay;
 }
Example #13
0
 public void onAnimationEnd(android.view.animation.Animation animation)
 {
     throw new System.NotImplementedException();
 }
Example #14
0
 /// <summary>Specifies the animation used to animate a View that exit the screen.</summary>
 /// <remarks>Specifies the animation used to animate a View that exit the screen.</remarks>
 /// <param name="outAnimation">The animation started when a View exit the screen.</param>
 /// <seealso cref="getOutAnimation()">getOutAnimation()</seealso>
 /// <seealso cref="setOutAnimation(android.content.Context, int)">setOutAnimation(android.content.Context, int)
 ///     </seealso>
 public virtual void setOutAnimation(android.view.animation.Animation outAnimation
                                     )
 {
     mOutAnimation = outAnimation;
 }
 public GridLayoutAnimationController(android.view.animation.Animation arg0, float arg1, float arg2)  : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
 {
     global::MonoJavaBridge.JNIEnv         @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.view.animation.GridLayoutAnimationController.staticClass, global::android.view.animation.GridLayoutAnimationController._GridLayoutAnimationController10014, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
     Init(@__env, handle);
 }
Example #16
0
		/// <summary>Specifies the animation used to animate a View that exit the screen.</summary>
		/// <remarks>Specifies the animation used to animate a View that exit the screen.</remarks>
		/// <param name="outAnimation">The animation started when a View exit the screen.</param>
		/// <seealso cref="getOutAnimation()">getOutAnimation()</seealso>
		/// <seealso cref="setOutAnimation(android.content.Context, int)">setOutAnimation(android.content.Context, int)
		/// 	</seealso>
		public virtual void setOutAnimation(android.view.animation.Animation outAnimation
			)
		{
			mOutAnimation = outAnimation;
		}
Example #17
0
		/// <summary>Specifies the animation used to animate a View that enters the screen.</summary>
		/// <remarks>Specifies the animation used to animate a View that enters the screen.</remarks>
		/// <param name="inAnimation">The animation started when a View enters the screen.</param>
		/// <seealso cref="getInAnimation()">getInAnimation()</seealso>
		/// <seealso cref="setInAnimation(android.content.Context, int)">setInAnimation(android.content.Context, int)
		/// 	</seealso>
		public virtual void setInAnimation(android.view.animation.Animation inAnimation)
		{
			mInAnimation = inAnimation;
		}
Example #18
0
        public override void initialize(int width, int height, int parentWidth, int parentHeight
                                        )
        {
            base.initialize(width, height, parentWidth, parentHeight);
            bool durationSet       = (mFlags & PROPERTY_DURATION_MASK) == PROPERTY_DURATION_MASK;
            bool fillAfterSet      = (mFlags & PROPERTY_FILL_AFTER_MASK) == PROPERTY_FILL_AFTER_MASK;
            bool fillBeforeSet     = (mFlags & PROPERTY_FILL_BEFORE_MASK) == PROPERTY_FILL_BEFORE_MASK;
            bool repeatModeSet     = (mFlags & PROPERTY_REPEAT_MODE_MASK) == PROPERTY_REPEAT_MODE_MASK;
            bool shareInterpolator = (mFlags & PROPERTY_SHARE_INTERPOLATOR_MASK) == PROPERTY_SHARE_INTERPOLATOR_MASK;
            bool startOffsetSet    = (mFlags & PROPERTY_START_OFFSET_MASK) == PROPERTY_START_OFFSET_MASK;

            if (shareInterpolator)
            {
                ensureInterpolator();
            }
            java.util.ArrayList <android.view.animation.Animation> children = mAnimations;
            int  count      = children.size();
            long duration   = mDuration;
            bool fillAfter  = mFillAfter;
            bool fillBefore = mFillBefore;
            int  repeatMode = mRepeatMode;

            android.view.animation.Interpolator interpolator = mInterpolator;
            long startOffset = mStartOffset;

            long[] storedOffsets = mStoredOffsets;
            if (startOffsetSet)
            {
                if (storedOffsets == null || storedOffsets.Length != count)
                {
                    storedOffsets = mStoredOffsets = new long[count];
                }
            }
            else
            {
                if (storedOffsets != null)
                {
                    storedOffsets = mStoredOffsets = null;
                }
            }
            {
                for (int i = 0; i < count; i++)
                {
                    android.view.animation.Animation a = children.get(i);
                    if (durationSet)
                    {
                        a.setDuration(duration);
                    }
                    if (fillAfterSet)
                    {
                        a.setFillAfter(fillAfter);
                    }
                    if (fillBeforeSet)
                    {
                        a.setFillBefore(fillBefore);
                    }
                    if (repeatModeSet)
                    {
                        a.setRepeatMode(repeatMode);
                    }
                    if (shareInterpolator)
                    {
                        a.setInterpolator(interpolator);
                    }
                    if (startOffsetSet)
                    {
                        long offset = a.getStartOffset();
                        a.setStartOffset(offset + startOffset);
                        storedOffsets[i] = offset;
                    }
                    a.initialize(width, height, parentWidth, parentHeight);
                }
            }
        }
 /// <summary>
 /// Sets the animation to be run on each child of the view group on which
 /// this layout animation controller is .
 /// </summary>
 /// <remarks>
 /// Sets the animation to be run on each child of the view group on which
 /// this layout animation controller is .
 /// </remarks>
 /// <param name="animation">the animation to run on each child of the view group</param>
 /// <seealso cref="setAnimation(android.content.Context, int)">setAnimation(android.content.Context, int)
 ///     </seealso>
 /// <seealso cref="getAnimation()">getAnimation()</seealso>
 /// <attr>ref android.R.styleable#LayoutAnimation_animation</attr>
 public virtual void setAnimation(android.view.animation.Animation animation)
 {
     mAnimation = animation;
     mAnimation.setFillBefore(true);
 }
Example #20
0
 /// <summary>Specifies the animation used to animate a View that enters the screen.</summary>
 /// <remarks>Specifies the animation used to animate a View that enters the screen.</remarks>
 /// <param name="inAnimation">The animation started when a View enters the screen.</param>
 /// <seealso cref="getInAnimation()">getInAnimation()</seealso>
 /// <seealso cref="setInAnimation(android.content.Context, int)">setInAnimation(android.content.Context, int)
 ///     </seealso>
 public virtual void setInAnimation(android.view.animation.Animation inAnimation)
 {
     mInAnimation = inAnimation;
 }
 /// <summary>
 /// Creates a new layout animation controller with a delay of 50%
 /// for both rows and columns and the specified animation.
 /// </summary>
 /// <remarks>
 /// Creates a new layout animation controller with a delay of 50%
 /// for both rows and columns and the specified animation.
 /// </remarks>
 /// <param name="animation">the animation to use on each child of the view group</param>
 public GridLayoutAnimationController(android.view.animation.Animation animation) :
     this(animation, 0.5f, 0.5f)
 {
 }
Example #22
0
        /// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
        /// <exception cref="System.IO.IOException"></exception>
        private static android.view.animation.Animation createAnimationFromXml(android.content.Context
                                                                               c, org.xmlpull.v1.XmlPullParser parser, android.view.animation.AnimationSet parent
                                                                               , android.util.AttributeSet attrs)
        {
            android.view.animation.Animation anim = null;
            // Make sure we are on a start tag.
            int type;
            int depth = parser.getDepth();

            while (((type = parser.next()) != org.xmlpull.v1.XmlPullParserClass.END_TAG || parser
                    .getDepth() > depth) && type != org.xmlpull.v1.XmlPullParserClass.END_DOCUMENT)
            {
                if (type != org.xmlpull.v1.XmlPullParserClass.START_TAG)
                {
                    continue;
                }
                string name = parser.getName();
                if (name.Equals("set"))
                {
                    anim = new android.view.animation.AnimationSet(c, attrs);
                    createAnimationFromXml(c, parser, (android.view.animation.AnimationSet)anim, attrs
                                           );
                }
                else
                {
                    if (name.Equals("alpha"))
                    {
                        anim = new android.view.animation.AlphaAnimation(c, attrs);
                    }
                    else
                    {
                        if (name.Equals("scale"))
                        {
                            anim = new android.view.animation.ScaleAnimation(c, attrs);
                        }
                        else
                        {
                            if (name.Equals("rotate"))
                            {
                                anim = new android.view.animation.RotateAnimation(c, attrs);
                            }
                            else
                            {
                                if (name.Equals("translate"))
                                {
                                    anim = new android.view.animation.TranslateAnimation(c, attrs);
                                }
                                else
                                {
                                    throw new java.lang.RuntimeException("Unknown animation name: " + parser.getName(
                                                                             ));
                                }
                            }
                        }
                    }
                }
                if (parent != null)
                {
                    parent.addAnimation(anim);
                }
            }
            return(anim);
        }
Example #23
0
 public virtual void startAnimation(android.view.animation.Animation anim1, android.view.animation.Animation
                                    anim2)
 {
     throw new System.NotImplementedException();
 }