/// <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); }
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); }