private android.animation.Animator makeOutAnimation() { android.animation.ObjectAnimator buttonAnimator = android.animation.ObjectAnimator .ofFloat(mClose, "translationX", -mClose.getWidth() - ((android.view.ViewGroup.MarginLayoutParams )mClose.getLayoutParams()).leftMargin); buttonAnimator.setDuration(200); buttonAnimator.addListener(this); buttonAnimator.setInterpolator(new android.view.animation.DecelerateInterpolator( )); android.animation.AnimatorSet set = new android.animation.AnimatorSet(); android.animation.AnimatorSet.Builder b = set.play(buttonAnimator); if (mMenuView != null) { int count = mMenuView.getChildCount(); if (count > 0) { { for (int i = 0; i < 0; i++) { android.view.View child = mMenuView.getChildAt(i); child.setScaleY(0); android.animation.ObjectAnimator a = android.animation.ObjectAnimator.ofFloat(child , "scaleY", 0); a.setDuration(100); a.setStartDelay(i * 70); b.with(a); } } } } return(set); }
/// <summary> /// @brief /// </summary> /// <param name="view"> </param> /// <param name="duration"> </param> /// <param name="dx"> </param> /// <param name="dy"> /// @return </param> public virtual Animator createScaleAnimator(View view, long duration, float dx, float dy) { Animator scaleX = ObjectAnimator.ofFloat(view, View.SCALE_X, 1.0f, 1.0f - dx); Animator scaleY = ObjectAnimator.ofFloat(view, View.SCALE_Y, 1.0f, 1.0f - dy); scaleX.Interpolator = new CycleInterpolator(1.0f); scaleY.Interpolator = new CycleInterpolator(1.0f); AnimatorSet animator = new AnimatorSet(); animator.Duration = duration; animator.playTogether(scaleX, scaleY); return(animator); }
/// <summary> /// @brief /// </summary> /// <param name="toHide"> </param> /// <param name="duration"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public android.animation.Animator createCollapseActionsAnimator(final android.view.View toHide, long duration) public virtual Animator createCollapseActionsAnimator(View toHide, long duration) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final float baseAlpha = toHide.getAlpha(); float baseAlpha = toHide.Alpha; Animator fadeOutAnimator = ObjectAnimator.ofFloat(toHide, View.ALPHA, baseAlpha, 0.0f); fadeOutAnimator.Duration = FcConstants.DEFAULT_FADE_ANIM_DURATION; AnimatorSet animator = new AnimatorSet(); animator.playSequentially(fadeOutAnimator, createCollapseAnimator(toHide, duration - FcConstants.DEFAULT_FADE_ANIM_DURATION)); return(animator); }
/// <summary> /// @brief /// </summary> /// <param name="toShow"> </param> /// <param name="duration"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public android.animation.Animator createExpandActionsAnimator(final android.view.View toShow, long duration) public virtual Animator createExpandActionsAnimator(View toShow, long duration) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final float baseAlpha = toShow.getAlpha(); float baseAlpha = toShow.Alpha; Animator fadeInAnimator = ObjectAnimator.ofFloat(toShow, View.ALPHA, baseAlpha, 1.0f); fadeInAnimator.Duration = FcConstants.DEFAULT_FADE_ANIM_DURATION; AnimatorSet animator = new AnimatorSet(); animator.playSequentially(createExpandAnimator(toShow, duration - FcConstants.DEFAULT_FADE_ANIM_DURATION), fadeInAnimator); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper4(this, toShow)); return(animator); }
internal virtual void show(bool markHiddenBeforeMode) { if (mCurrentShowAnim != null) { mCurrentShowAnim.end(); } if (mContainerView.getVisibility() == android.view.View.VISIBLE) { if (markHiddenBeforeMode) { mWasHiddenBeforeMode = false; } return; } mContainerView.setVisibility(android.view.View.VISIBLE); if (mShowHideAnimationEnabled) { mContainerView.setAlpha(0); android.animation.AnimatorSet anim = new android.animation.AnimatorSet(); android.animation.AnimatorSet.Builder b = anim.play(android.animation.ObjectAnimator .ofFloat(mContainerView, "alpha", 1)); if (mContentView != null) { b.with(android.animation.ObjectAnimator.ofFloat(mContentView, "translationY", -mContainerView .getHeight(), 0)); mContainerView.setTranslationY(-mContainerView.getHeight()); b.with(android.animation.ObjectAnimator.ofFloat(mContainerView, "translationY", 0 )); } if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { mSplitView.setAlpha(0); mSplitView.setVisibility(android.view.View.VISIBLE); b.with(android.animation.ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); } anim.addListener(mShowListener); mCurrentShowAnim = anim; anim.start(); } else { mContainerView.setAlpha(1); mContainerView.setTranslationY(0); mShowListener.onAnimationEnd(null); } }
public override void hide() { if (mCurrentShowAnim != null) { mCurrentShowAnim.end(); } if (mContainerView.getVisibility() == android.view.View.GONE) { return; } if (mShowHideAnimationEnabled) { mContainerView.setAlpha(1); mContainerView.setTransitioning(true); android.animation.AnimatorSet anim = new android.animation.AnimatorSet(); android.animation.AnimatorSet.Builder b = anim.play(android.animation.ObjectAnimator .ofFloat(mContainerView, "alpha", 0)); if (mContentView != null) { b.with(android.animation.ObjectAnimator.ofFloat(mContentView, "translationY", 0, -mContainerView.getHeight())); b.with(android.animation.ObjectAnimator.ofFloat(mContainerView, "translationY", - mContainerView.getHeight())); } if (mSplitView != null && mSplitView.getVisibility() == android.view.View.VISIBLE) { mSplitView.setAlpha(1); b.with(android.animation.ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); } anim.addListener(mHideListener); mCurrentShowAnim = anim; anim.start(); } else { mHideListener.onAnimationEnd(null); } }
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception> /// <exception cref="System.IO.IOException"></exception> private static android.animation.Animator createAnimatorFromXml(android.content.Context c, org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs, android.animation.AnimatorSet parent, int sequenceOrdering) { android.animation.Animator anim = null; java.util.ArrayList<android.animation.Animator> childAnims = 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("objectAnimator")) { anim = loadObjectAnimator(c, attrs); } else { if (name.Equals("animator")) { anim = loadAnimator(c, attrs, null); } else { if (name.Equals("set")) { anim = new android.animation.AnimatorSet(); android.content.res.TypedArray a = c.obtainStyledAttributes(attrs, [email protected] .styleable.AnimatorSet); int ordering = a.getInt([email protected]_ordering, TOGETHER ); createAnimatorFromXml(c, parser, attrs, (android.animation.AnimatorSet)anim, ordering ); a.recycle(); } else { throw new java.lang.RuntimeException("Unknown animator name: " + parser.getName() ); } } } if (parent != null) { if (childAnims == null) { childAnims = new java.util.ArrayList<android.animation.Animator>(); } childAnims.add(anim); } } if (parent != null && childAnims != null) { android.animation.Animator[] animsArray = new android.animation.Animator[childAnims .size()]; int index = 0; foreach (android.animation.Animator a in Sharpen.IterableProxy.Create(childAnims)) { animsArray[index++] = a; } if (sequenceOrdering == TOGETHER) { parent.playTogether(animsArray); } else { parent.playSequentially(animsArray); } } return anim; }
internal AnimatorSetListener(AnimatorSet _enclosing, android.animation.AnimatorSet animatorSet) { throw new System.NotImplementedException(); }
public DependencyListener(android.animation.AnimatorSet animatorSet, android.animation.AnimatorSet .Node node, int rule) { throw new System.NotImplementedException(); }
/// <summary> /// @brief /// </summary> /// <param name="view"> </param> /// <param name="duration"> </param> /// <param name="dx"> </param> /// <param name="dy"> /// @return </param> public virtual Animator createScaleAnimator(View view, long duration, float dx, float dy) { Animator scaleX = ObjectAnimator.ofFloat(view, View.SCALE_X, 1.0f, 1.0f - dx); Animator scaleY = ObjectAnimator.ofFloat(view, View.SCALE_Y, 1.0f, 1.0f - dy); scaleX.Interpolator = new CycleInterpolator(1.0f); scaleY.Interpolator = new CycleInterpolator(1.0f); AnimatorSet animator = new AnimatorSet(); animator.Duration = duration; animator.playTogether(scaleX, scaleY); return animator; }
/// <summary> /// @brief /// </summary> /// <param name="toHide"> </param> /// <param name="duration"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public android.animation.Animator createCollapseActionsAnimator(final android.view.View toHide, long duration) public virtual Animator createCollapseActionsAnimator(View toHide, long duration) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final float baseAlpha = toHide.getAlpha(); float baseAlpha = toHide.Alpha; Animator fadeOutAnimator = ObjectAnimator.ofFloat(toHide, View.ALPHA, baseAlpha, 0.0f); fadeOutAnimator.Duration = FcConstants.DEFAULT_FADE_ANIM_DURATION; AnimatorSet animator = new AnimatorSet(); animator.playSequentially(fadeOutAnimator, createCollapseAnimator(toHide, duration - FcConstants.DEFAULT_FADE_ANIM_DURATION)); return animator; }
/// <summary> /// @brief /// </summary> /// <param name="toShow"> </param> /// <param name="duration"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: public android.animation.Animator createExpandActionsAnimator(final android.view.View toShow, long duration) public virtual Animator createExpandActionsAnimator(View toShow, long duration) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final float baseAlpha = toShow.getAlpha(); float baseAlpha = toShow.Alpha; Animator fadeInAnimator = ObjectAnimator.ofFloat(toShow, View.ALPHA, baseAlpha, 1.0f); fadeInAnimator.Duration = FcConstants.DEFAULT_FADE_ANIM_DURATION; AnimatorSet animator = new AnimatorSet(); animator.playSequentially(createExpandAnimator(toShow, duration - FcConstants.DEFAULT_FADE_ANIM_DURATION), fadeInAnimator); animator.addListener(new FcAnimatorListenerAnonymousInnerClassHelper4(this, toShow)); return animator; }
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception> /// <exception cref="System.IO.IOException"></exception> private static android.animation.Animator createAnimatorFromXml(android.content.Context c, org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs, android.animation.AnimatorSet parent, int sequenceOrdering) { android.animation.Animator anim = null; java.util.ArrayList <android.animation.Animator> childAnims = 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("objectAnimator")) { anim = loadObjectAnimator(c, attrs); } else { if (name.Equals("animator")) { anim = loadAnimator(c, attrs, null); } else { if (name.Equals("set")) { anim = new android.animation.AnimatorSet(); android.content.res.TypedArray a = c.obtainStyledAttributes(attrs, [email protected] .styleable.AnimatorSet); int ordering = a.getInt([email protected]_ordering, TOGETHER ); createAnimatorFromXml(c, parser, attrs, (android.animation.AnimatorSet)anim, ordering ); a.recycle(); } else { throw new java.lang.RuntimeException("Unknown animator name: " + parser.getName() ); } } } if (parent != null) { if (childAnims == null) { childAnims = new java.util.ArrayList <android.animation.Animator>(); } childAnims.add(anim); } } if (parent != null && childAnims != null) { android.animation.Animator[] animsArray = new android.animation.Animator[childAnims .size()]; int index = 0; foreach (android.animation.Animator a in Sharpen.IterableProxy.Create(childAnims)) { animsArray[index++] = a; } if (sequenceOrdering == TOGETHER) { parent.playTogether(animsArray); } else { parent.playSequentially(animsArray); } } return(anim); }
/// <summary>Create a new number picker</summary> /// <param name="context">the application environment.</param> /// <param name="attrs">a collection of attributes.</param> /// <param name="defStyle">The default style to apply to this view.</param> public NumberPicker(android.content.Context context, android.util.AttributeSet attrs , int defStyle) : base(context, attrs, defStyle) { android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs , [email protected], defStyle, 0); mSolidColor = attributesArray.getColor([email protected]_solidColor , 0); mFlingable = attributesArray.getBoolean([email protected]_flingable , true); mSelectionDivider = attributesArray.getDrawable([email protected]_selectionDivider ); int defSelectionDividerHeight = (int)android.util.TypedValue.applyDimension(android.util.TypedValue .COMPLEX_UNIT_DIP, UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT, getResources().getDisplayMetrics ()); mSelectionDividerHeight = attributesArray.getDimensionPixelSize([email protected] .styleable.NumberPicker_selectionDividerHeight, defSelectionDividerHeight); attributesArray.recycle(); mShowInputControlsAnimimationDuration = getResources().getInteger([email protected] .integer.config_longAnimTime); setWillNotDraw(false); setSelectorWheelState(SELECTOR_WHEEL_STATE_NONE); android.view.LayoutInflater inflater = (android.view.LayoutInflater)getContext(). getSystemService(android.content.Context.LAYOUT_INFLATER_SERVICE); inflater.inflate([email protected]_picker, this, true); android.view.View.OnClickListener onClickListener = new _OnClickListener_537(this ); android.view.View.OnLongClickListener onLongClickListener = new _OnLongClickListener_552 (this); mIncrementButton = (android.widget.ImageButton)findViewById([email protected] .increment); mIncrementButton.setOnClickListener(onClickListener); mIncrementButton.setOnLongClickListener(onLongClickListener); mDecrementButton = (android.widget.ImageButton)findViewById([email protected] .decrement); mDecrementButton.setOnClickListener(onClickListener); mDecrementButton.setOnLongClickListener(onLongClickListener); mInputText = (android.widget.EditText)findViewById([email protected]_input ); mInputText.setOnFocusChangeListener(new _OnFocusChangeListener_576(this)); mInputText.setFilters(new android.text.InputFilter[] { new android.widget.NumberPicker .InputTextFilter(this) }); mInputText.setRawInputType(android.text.InputTypeClass.TYPE_CLASS_NUMBER); mTouchSlop = android.view.ViewConfiguration.getTapTimeout(); android.view.ViewConfiguration configuration = android.view.ViewConfiguration.get (context); mTouchSlop = configuration.getScaledTouchSlop(); mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity() / SELECTOR_MAX_FLING_VELOCITY_ADJUSTMENT; mTextSize = (int)mInputText.getTextSize(); android.graphics.Paint paint = new android.graphics.Paint(); paint.setAntiAlias(true); paint.setTextAlign(android.graphics.Paint.Align.CENTER); paint.setTextSize(mTextSize); paint.setTypeface(mInputText.getTypeface()); android.content.res.ColorStateList colors = mInputText.getTextColors(); int color = colors.getColorForState(ENABLED_STATE_SET, android.graphics.Color.WHITE ); paint.setColor(color); mSelectorWheelPaint = paint; mDimSelectorWheelAnimator = android.animation.ObjectAnimator.ofInt(this, PROPERTY_SELECTOR_PAINT_ALPHA , SELECTOR_WHEEL_BRIGHT_ALPHA, SELECTOR_WHEEL_DIM_ALPHA); android.animation.ObjectAnimator showIncrementButton = android.animation.ObjectAnimator .ofFloat(mIncrementButton, PROPERTY_BUTTON_ALPHA, BUTTON_ALPHA_TRANSPARENT, BUTTON_ALPHA_OPAQUE ); android.animation.ObjectAnimator showDecrementButton = android.animation.ObjectAnimator .ofFloat(mDecrementButton, PROPERTY_BUTTON_ALPHA, BUTTON_ALPHA_TRANSPARENT, BUTTON_ALPHA_OPAQUE ); mShowInputControlsAnimator = new android.animation.AnimatorSet(); mShowInputControlsAnimator.playTogether(mDimSelectorWheelAnimator, showIncrementButton , showDecrementButton); mShowInputControlsAnimator.addListener(new _AnimatorListenerAdapter_626(this)); // create the fling and adjust scrollers mFlingScroller = new android.widget.Scroller(getContext(), null, true); mAdjustScroller = new android.widget.Scroller(getContext(), new android.view.animation.DecelerateInterpolator (2.5f)); updateInputTextView(); updateIncrementAndDecrementButtonsVisibilityState(); if (mFlingable) { if (isInEditMode()) { setSelectorWheelState(SELECTOR_WHEEL_STATE_SMALL); } else { // Start with shown selector wheel and hidden controls. When made // visible hide the selector and fade-in the controls to suggest // fling interaction. setSelectorWheelState(SELECTOR_WHEEL_STATE_LARGE); hideInputControls(); } } }
public override void hide() { if (mCurrentShowAnim != null) { mCurrentShowAnim.end(); } if (mContainerView.getVisibility() == android.view.View.GONE) { return; } if (mShowHideAnimationEnabled) { mContainerView.setAlpha(1); mContainerView.setTransitioning(true); android.animation.AnimatorSet anim = new android.animation.AnimatorSet(); android.animation.AnimatorSet.Builder b = anim.play(android.animation.ObjectAnimator .ofFloat(mContainerView, "alpha", 0)); if (mContentView != null) { b.with(android.animation.ObjectAnimator.ofFloat(mContentView, "translationY", 0, -mContainerView.getHeight())); b.with(android.animation.ObjectAnimator.ofFloat(mContainerView, "translationY", - mContainerView.getHeight())); } if (mSplitView != null && mSplitView.getVisibility() == android.view.View.VISIBLE) { mSplitView.setAlpha(1); b.with(android.animation.ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); } anim.addListener(mHideListener); mCurrentShowAnim = anim; anim.start(); } else { mHideListener.onAnimationEnd(null); } }
internal virtual void show(bool markHiddenBeforeMode) { if (mCurrentShowAnim != null) { mCurrentShowAnim.end(); } if (mContainerView.getVisibility() == android.view.View.VISIBLE) { if (markHiddenBeforeMode) { mWasHiddenBeforeMode = false; } return; } mContainerView.setVisibility(android.view.View.VISIBLE); if (mShowHideAnimationEnabled) { mContainerView.setAlpha(0); android.animation.AnimatorSet anim = new android.animation.AnimatorSet(); android.animation.AnimatorSet.Builder b = anim.play(android.animation.ObjectAnimator .ofFloat(mContainerView, "alpha", 1)); if (mContentView != null) { b.with(android.animation.ObjectAnimator.ofFloat(mContentView, "translationY", -mContainerView .getHeight(), 0)); mContainerView.setTranslationY(-mContainerView.getHeight()); b.with(android.animation.ObjectAnimator.ofFloat(mContainerView, "translationY", 0 )); } if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { mSplitView.setAlpha(0); mSplitView.setVisibility(android.view.View.VISIBLE); b.with(android.animation.ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); } anim.addListener(mShowListener); mCurrentShowAnim = anim; anim.start(); } else { mContainerView.setAlpha(1); mContainerView.setTranslationY(0); mShowListener.onAnimationEnd(null); } }
private android.animation.Animator makeOutAnimation() { android.animation.ObjectAnimator buttonAnimator = android.animation.ObjectAnimator .ofFloat(mClose, "translationX", -mClose.getWidth() - ((android.view.ViewGroup.MarginLayoutParams )mClose.getLayoutParams()).leftMargin); buttonAnimator.setDuration(200); buttonAnimator.addListener(this); buttonAnimator.setInterpolator(new android.view.animation.DecelerateInterpolator( )); android.animation.AnimatorSet set = new android.animation.AnimatorSet(); android.animation.AnimatorSet.Builder b = set.play(buttonAnimator); if (mMenuView != null) { int count = mMenuView.getChildCount(); if (count > 0) { { for (int i = 0; i < 0; i++) { android.view.View child = mMenuView.getChildAt(i); child.setScaleY(0); android.animation.ObjectAnimator a = android.animation.ObjectAnimator.ofFloat(child , "scaleY", 0); a.setDuration(100); a.setStartDelay(i * 70); b.with(a); } } } } return set; }
public virtual void animateToVisibility(int visibility) { if (mVisibilityAnim != null) { mVisibilityAnim.cancel(); } if (visibility == VISIBLE) { if (getVisibility() != VISIBLE) { setAlpha(0); if (mSplitView != null && mMenuView != null) { mMenuView.setAlpha(0); } } android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat( this, "alpha", 1); anim.setDuration(FADE_DURATION); anim.setInterpolator(sAlphaInterpolator); if (mSplitView != null && mMenuView != null) { android.animation.AnimatorSet set = new android.animation.AnimatorSet(); android.animation.ObjectAnimator splitAnim = android.animation.ObjectAnimator.ofFloat (mMenuView, "alpha", 1); splitAnim.setDuration(FADE_DURATION); set.addListener(mVisAnimListener.withFinalVisibility(visibility)); set.play(anim).with(splitAnim); set.start(); } else { anim.addListener(mVisAnimListener.withFinalVisibility(visibility)); anim.start(); } } else { android.animation.ObjectAnimator anim = android.animation.ObjectAnimator.ofFloat( this, "alpha", 0); anim.setDuration(FADE_DURATION); anim.setInterpolator(sAlphaInterpolator); if (mSplitView != null && mMenuView != null) { android.animation.AnimatorSet set = new android.animation.AnimatorSet(); android.animation.ObjectAnimator splitAnim = android.animation.ObjectAnimator.ofFloat (mMenuView, "alpha", 0); splitAnim.setDuration(FADE_DURATION); set.addListener(mVisAnimListener.withFinalVisibility(visibility)); set.play(anim).with(splitAnim); set.start(); } else { anim.addListener(mVisAnimListener.withFinalVisibility(visibility)); anim.start(); } } }