Java Code Examples for com.nineoldandroids.animation.ObjectAnimator#start()

The following examples show how to use com.nineoldandroids.animation.ObjectAnimator#start() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Delegate.java    From MousePaint with MIT License 6 votes vote down vote up
/**
 * 隐藏模糊背景
 */
protected void dismissShowdown() {

    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 1, 0);
    objectAnimator.setDuration(400);
    objectAnimator.start();
    objectAnimator.addListener(new SimpleAnimationListener() {

        @Override
        public void onAnimationEnd(Animator animation) {

            mParentVG.removeView(mBg);
        }


    });
}
 
Example 2
Source File: Delegate.java    From AndroidSweetSheet with Apache License 2.0 6 votes vote down vote up
/**
 * 显示模糊背景
 */
protected void showShowdown() {

    ViewHelper.setTranslationY(mRootView, 0);
    mEffect.effect(mParentVG,mBg);
    ViewGroup.LayoutParams lp =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    if(mBg.getParent()!= null){
        mParentVG.removeView(mBg);
    }

    mParentVG.addView(mBg, lp);
    ViewHelper.setAlpha(mBg, 0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
    objectAnimator.setDuration(400);
    objectAnimator.start();
}
 
Example 3
Source File: Switch.java    From MoeGallery with GNU General Public License v3.0 5 votes vote down vote up
public void animateCheck() {
	changeBackground();
	ObjectAnimator objectAnimator;
	if (eventCheck) {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xFin);

	} else {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xIni);
	}
	objectAnimator.setDuration(300);
	objectAnimator.start();
}
 
Example 4
Source File: Switch.java    From XERUNG with Apache License 2.0 5 votes vote down vote up
public void animateCheck() {
	changeBackground();
	ObjectAnimator objectAnimator;
	if (iSchecked) {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xFin);

	} else {
		objectAnimator = ObjectAnimator.ofFloat(this, "x", ball.xIni);
	}
	objectAnimator.setDuration(300);
	objectAnimator.start();
}
 
Example 5
Source File: AnimUtil.java    From PullRefreshView with Apache License 2.0 5 votes vote down vote up
public static Animator startHide(final View view, long duration, long startDelay) {
    view.setVisibility(View.VISIBLE);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "alpha", ViewHelper.getAlpha(view), 0f).setDuration(duration);
    objectAnimator.setStartDelay(startDelay);
    objectAnimator.start();
    return objectAnimator;
}
 
Example 6
Source File: TimePickerDialog.java    From DateTimepicker with Apache License 2.0 5 votes vote down vote up
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate,
        boolean announce) {
    mTimePicker.setCurrentItemShowing(index, animateCircle);

    TextView labelToAnimate;
    if (index == HOUR_INDEX) {
        int hours = mTimePicker.getHours();
        if (!mIs24HourMode) {
            hours = hours % 12;
        }
        mTimePicker.setContentDescription(mHourPickerDescription+": "+hours);
        if (announce) {
            Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
        }
        labelToAnimate = mHourView;
    } else {
        int minutes = mTimePicker.getMinutes();
        mTimePicker.setContentDescription(mMinutePickerDescription+": "+minutes);
        if (announce) {
            Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
        }
        labelToAnimate = mMinuteView;
    }

    int hourColor = (index == HOUR_INDEX)? mBlue : mBlack;
    int minuteColor = (index == MINUTE_INDEX)? mBlue : mBlack;
    mHourView.setTextColor(hourColor);
    mMinuteView.setTextColor(minuteColor);

    ObjectAnimator pulseAnimator = Utils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
    if (delayLabelAnimate) {
        pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
    }
    pulseAnimator.start();
}
 
Example 7
Source File: ScrollManager.java    From Mover with Apache License 2.0 5 votes vote down vote up
public void show(final View target){
    ObjectAnimator animator = ObjectAnimator.ofFloat(target, "translationY",
            ViewHelper.getTranslationY(target), 0f);
    animator.setAutoCancel(true);
    animator.setInterpolator(ACCELERATE);
    animator.start();
}
 
Example 8
Source File: IndicatorView.java    From AndroidSweetSheet with Apache License 2.0 5 votes vote down vote up
public void alphaShow(boolean isAnimation){

        if(isAnimation) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 0, 1);
            objectAnimator.setDuration(300);
            objectAnimator.start();
        }else{
            ViewHelper.setAlpha(this,1);
        }
    }
 
Example 9
Source File: CurveAction.java    From android-player with Apache License 2.0 5 votes vote down vote up
@Override
public void animate(View view) {
    final ObjectAnimator anim = ObjectAnimator.ofObject(this, PATH_POINT_LOCATION,
            new PathEvaluator(), path.getPoints().toArray());

    anim.setInterpolator(getInterpolator());
    anim.setDuration(getDuration());
    anim.start();
}
 
Example 10
Source File: AnimatedPathView.java    From google-io-2014-compat with Apache License 2.0 5 votes vote down vote up
public void reveal() {
    ObjectAnimator svgAnimator = ObjectAnimator.ofFloat(this, "phase", 1.0f, 0.0f);
    svgAnimator.setDuration(mDuration);
    svgAnimator.start();

    setFillAlpha(0.0f);

    ObjectAnimator fillAnimator = ObjectAnimator.ofFloat(this, "fillAlpha", 0.0f, 1.0f);
    fillAnimator.setDuration(mFillDuration);
    fillAnimator.setStartDelay(mFillOffset);
    fillAnimator.start();
}
 
Example 11
Source File: DynamicFormActivity.java    From Android-Anim-Playground with MIT License 5 votes vote down vote up
@Override
public void focusOff(View v, View movableView, boolean animated) {
    v.getDrawingRect(mTmpRect);

    Log.d(TAG, "Movable view top: " + String.valueOf(movableView.getTop()));
    Log.d(TAG, "Container view top: " + String.valueOf(v.getTop()));

    ObjectAnimator anim = ObjectAnimator.ofFloat(v, "translationY", 0);
    anim.setInterpolator(ANIMATION_INTERPOLATOR);
    anim.setDuration(ANIMATION_DURATION);
    anim.start();

    slideInToBottom(v);
}
 
Example 12
Source File: JumpAnimater.java    From JPTabBar with Apache License 2.0 5 votes vote down vote up
@Override
public void onSelectChanged(View v, boolean selected) {
    int end = selected?-10:0;
    ObjectAnimator jumpAnimator = ObjectAnimator.ofFloat(v,"translationY",end);
    jumpAnimator.setDuration(300);
    jumpAnimator.setInterpolator(new AnticipateInterpolator());
    jumpAnimator.start();
}
 
Example 13
Source File: DetailActivity.java    From google-io-2014-compat with Apache License 2.0 5 votes vote down vote up
private void createShrinkAnimation(final SpotlightView spotlight) {
    mapContainer.setVisibility(View.INVISIBLE);
    spotlight.setVisibility(View.VISIBLE);
    hero.setVisibility(View.VISIBLE);
    spotlight.setMaskScale(maskScale);

    ObjectAnimator superShrink = ObjectAnimator.ofFloat(spotlight, "maskScale", maskScale, 0.5f);
    superShrink.addListener(new AnimatorListener() {
        @Override
        public void onAnimationEnd(Animator animation) {
            spotlight.setVisibility(View.GONE);
        }
    });
    superShrink.start();
}
 
Example 14
Source File: ScrollAnimator.java    From ButtonMenu with Apache License 2.0 5 votes vote down vote up
/**
 * Show the animated view using a "translationY" animation and configure an AnimatorListener to be notified during
 * the animation.
 */
public void showWithAnimationWithListener(Animator.AnimatorListener animatorListener) {
	scrollDirection = SCROLL_TO_TOP;
	ObjectAnimator objectAnimator = objectAnimatorFactory.getObjectAnimator(animatedView, ANIMATION_TYPE, HIDDEN_Y_POSITION);
	if (animatorListener != null) {
		objectAnimator.addListener(animatorListener);
	}
	objectAnimator.setDuration(durationInMillis);
	objectAnimator.start();
}
 
Example 15
Source File: ButtonFloat.java    From Social with Apache License 2.0 5 votes vote down vote up
public void hide(){
	
	ObjectAnimator animator = ObjectAnimator.ofFloat(ButtonFloat.this, "y", hidePosition);
	animator.setInterpolator(new BounceInterpolator());
	animator.setDuration(1500);
	animator.start();
	
	isShow = false;
}
 
Example 16
Source File: ButtonFloat.java    From Social with Apache License 2.0 5 votes vote down vote up
public void show(){
	ObjectAnimator animator = ObjectAnimator.ofFloat(ButtonFloat.this, "y", showPosition);
	animator.setInterpolator(new BounceInterpolator());
	animator.setDuration(1500);
	animator.start();
	isShow = true;
}
 
Example 17
Source File: ButtonFloat.java    From MaterialDesignLibrary with Apache License 2.0 5 votes vote down vote up
public void hide(){
	
	ObjectAnimator animator = ObjectAnimator.ofFloat(ButtonFloat.this, "y", hidePosition);
	animator.setInterpolator(new BounceInterpolator());
	animator.setDuration(1500);
	animator.start();
	
	isShow = false;
}
 
Example 18
Source File: AnimUtil.java    From PullRefreshView with Apache License 2.0 5 votes vote down vote up
public static Animator startScale(final View view, float fromScale, float toScale, long duration, long startDelay, Interpolator setInterpolator) {
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "scaleX", fromScale, toScale).setDuration(duration);
    objectAnimator.setStartDelay(startDelay);
    objectAnimator.setInterpolator(setInterpolator);
    objectAnimator.start();
    objectAnimator = ObjectAnimator.ofFloat(view, "scaleY", fromScale, toScale).setDuration(duration);
    objectAnimator.setStartDelay(startDelay);
    objectAnimator.setInterpolator(setInterpolator);
    objectAnimator.start();
    return objectAnimator;
}
 
Example 19
Source File: Ripple.java    From Mover with Apache License 2.0 5 votes vote down vote up
/**
 * Starts the enter animation.
 */
public void enter() {
    cancel();

    final int radiusDuration = (int)
            (1000 * Math.sqrt(mOuterRadius / WAVE_TOUCH_DOWN_ACCELERATION * mDensity) + 0.5);

    final ObjectAnimator radius = ObjectAnimator.ofFloat(this, "radiusGravity", 1);
    radius.setAutoCancel(true);
    radius.setDuration(radiusDuration);
    radius.setInterpolator(LINEAR_INTERPOLATOR);
    radius.setStartDelay(RIPPLE_ENTER_DELAY);

    final ObjectAnimator cX = ObjectAnimator.ofFloat(this, "xGravity", 1);
    cX.setAutoCancel(true);
    cX.setDuration(radiusDuration);
    cX.setInterpolator(LINEAR_INTERPOLATOR);
    cX.setStartDelay(RIPPLE_ENTER_DELAY);

    final ObjectAnimator cY = ObjectAnimator.ofFloat(this, "yGravity", 1);
    cY.setAutoCancel(true);
    cY.setDuration(radiusDuration);
    cY.setInterpolator(LINEAR_INTERPOLATOR);
    cY.setStartDelay(RIPPLE_ENTER_DELAY);

    mAnimRadius = radius;
    mAnimX = cX;
    mAnimY = cY;

    // Enter animations always run on the UI thread, since it's unlikely
    // that anything interesting is happening until the user lifts their
    // finger.
    radius.start();
    cX.start();
    cY.start();
}
 
Example 20
Source File: OverflowGestureListener.java    From MaterialContentOverflow with Apache License 2.0 4 votes vote down vote up
public void slide(float position) {
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(overflow.get(), "translationY", position);
    objectAnimator.setInterpolator(new LinearOutSlowInInterpolator());
    objectAnimator.setDuration(1000);
    objectAnimator.start();
}