本文整理匯總了Java中com.nineoldandroids.animation.AnimatorSet.setInterpolator方法的典型用法代碼示例。如果您正苦於以下問題:Java AnimatorSet.setInterpolator方法的具體用法?Java AnimatorSet.setInterpolator怎麽用?Java AnimatorSet.setInterpolator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.nineoldandroids.animation.AnimatorSet
的用法示例。
在下文中一共展示了AnimatorSet.setInterpolator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildScaleDownAnimation
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
/**
* A helper method to build scale down animation;
*
* @param target
* @param targetScaleX
* @param targetScaleY
* @return
*/
private AnimatorSet buildScaleDownAnimation(View target, float targetScaleX, float targetScaleY) {
AnimatorSet scaleDown = new AnimatorSet();
scaleDown.playTogether(
ObjectAnimator.ofFloat(target, "scaleX", targetScaleX),
ObjectAnimator.ofFloat(target, "scaleY", targetScaleY)
);
if (mUse3D) {
int angle = scaleDirection == DIRECTION_LEFT ? -ROTATE_Y_ANGLE : ROTATE_Y_ANGLE;
scaleDown.playTogether(ObjectAnimator.ofFloat(target, "rotationY", angle));
}
scaleDown.setInterpolator(AnimationUtils.loadInterpolator(activity,
android.R.anim.decelerate_interpolator));
scaleDown.setDuration(250);
return scaleDown;
}
示例2: getPullDownAnimIn
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
public Animator getPullDownAnimIn(View view) {
ObjectAnimator in = ObjectAnimator.ofFloat(view, "translationY", -view.getMeasuredHeight(), 0);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0.6f, 1);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0.6f, 1);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new DecelerateInterpolator());
in.setDuration(ANIMATION_DURATION);
scaleY.setDuration(ANIMATION_DURATION);
scaleX.setDuration(ANIMATION_DURATION);
set.setDuration(ANIMATION_DURATION);
set.playTogether(scaleY, scaleX, in);
return set;
}
示例3: getPullUpAnimIn
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private Animator getPullUpAnimIn(View view) {
ObjectAnimator in = ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight(), 0);
// ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "rotationX", 20, 0);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0.6f, 1);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0.6f, 1f);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new DecelerateInterpolator());
in.setDuration(ANIMATION_DURATION);
scaleY.setDuration(ANIMATION_DURATION);
scaleX.setDuration(ANIMATION_DURATION);
set.setDuration(ANIMATION_DURATION);
set.playTogether(scaleY, scaleX, in);
return set;
}
示例4: start
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void start() {
if (canAnimate()) {
clearAnimation();
}
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 1.0f));
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.setDuration(getDuration());
animatorSet.start();
}
示例5: setOpenCloseAnimation
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
/**
* Creates Open / Close AnimatorSet
*/
private AnimatorSet setOpenCloseAnimation(boolean isCloseAnimation) {
List<Animator> textAnimations = new ArrayList<>();
List<Animator> imageAnimations = new ArrayList<>();
if (isCloseAnimation) {
for (int i = getItemCount() - 1; i >= 0; i--) {
fillOpenClosingAnimations(true, textAnimations, imageAnimations, i);
}
} else {
for (int i = 0; i < getItemCount(); i++) {
fillOpenClosingAnimations(false, textAnimations, imageAnimations, i);
}
}
AnimatorSet textCloseAnimatorSet = new AnimatorSet();
textCloseAnimatorSet.playSequentially(textAnimations);
AnimatorSet imageCloseAnimatorSet = new AnimatorSet();
imageCloseAnimatorSet.playSequentially(imageAnimations);
AnimatorSet animatorFullSet = new AnimatorSet();
animatorFullSet.playTogether(imageCloseAnimatorSet, textCloseAnimatorSet);
animatorFullSet.setDuration(mAnimationDurationMilis);
animatorFullSet.addListener(mCloseOpenAnimatorListener);
animatorFullSet.setStartDelay(0);
animatorFullSet.setInterpolator(new HesitateInterpolator());
return animatorFullSet;
}
示例6: end
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void end() {
if (canAnimate()) {
clearAnimation();
}
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 0.85f));
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 0.85f));
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.setDuration(getDuration());
animatorSet.start();
}
示例7: init
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void init(Context context, AttributeSet attrs) {
setOrientation(LinearLayout.HORIZONTAL);
setGravity(Gravity.CENTER);
handleTypedArray(context, attrs);
mAnimationOut = (AnimatorSet) AnimatorInflater.loadAnimator(context, mAnimatorResId);
mAnimationOut.setInterpolator(new LinearInterpolator());
mAnimationIn = (AnimatorSet) AnimatorInflater.loadAnimator(context, mAnimatorResId);
mAnimationIn.setInterpolator(new ReverseInterpolator());
}
示例8: init
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private void init(Context context, AttributeSet attrs) {
setOrientation(LinearLayout.HORIZONTAL);
setGravity(Gravity.CENTER);
handleTypedArray(context, attrs);
mAnimationOut = (AnimatorSet) AnimatorInflater.loadAnimator(context, mAnimatorResId);
mAnimationOut.setInterpolator(new LinearInterpolator());
mAnimationIn = (AnimatorSet) AnimatorInflater.loadAnimator(context, mAnimatorResId);
mAnimationIn.setInterpolator(new ReverseInterpolator());
}
示例9: getAnimator
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private Animator getAnimator(View target){
AnimatorSet set = getEnterAnimtor(target);
ValueAnimator bezierValueAnimator = getBezierValueAnimator(target);
AnimatorSet finalSet = new AnimatorSet();
finalSet.playSequentially(set);
finalSet.playSequentially(set, bezierValueAnimator);
finalSet.setInterpolator(mInterpolators[mRandom.nextInt(4)]);
finalSet.setTarget(target);
return finalSet;
}
示例10: getEnterAnimtor
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
private AnimatorSet getEnterAnimtor(final View target) {
ObjectAnimator alpha = ObjectAnimator.ofFloat(target, "alpha", 0.2f, 1f);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(target,"scaleX", 0.2f, 1f);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(target,"scaleY", 0.2f, 1f);
AnimatorSet enter = new AnimatorSet();
enter.setDuration(500);
enter.setInterpolator(new LinearInterpolator());
enter.playTogether(alpha,scaleX, scaleY);
enter.setTarget(target);
return enter;
}
示例11: buildScaleDownAnimation
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
/**
* a helper method to build scale down animation;
*
* @param target
* @param targetScaleX
* @param targetScaleY
* @return
*/
private AnimatorSet buildScaleDownAnimation(View target,float targetScaleX,float targetScaleY){
AnimatorSet scaleDown = new AnimatorSet();
scaleDown.playTogether(
ObjectAnimator.ofFloat(target, "scaleX", targetScaleX),
ObjectAnimator.ofFloat(target, "scaleY", targetScaleY)
);
scaleDown.setInterpolator(AnimationUtils.loadInterpolator(activity,
android.R.anim.decelerate_interpolator));
scaleDown.setDuration(250);
return scaleDown;
}
示例12: getPullDownAnim
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
public Animator getPullDownAnim(View showView, View dismissView) {
Animator out = getPullDownAnimOut(dismissView);
Animator in = getPullDownAnimIn(showView);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new DecelerateInterpolator());
set.setDuration(ANIMATION_DURATION);
set.playTogether(out, in);
return set;
}
示例13: getPullUpAnim
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
public Animator getPullUpAnim(View showView, View dismissView) {
Animator out = getPullUpAnimOut(dismissView);
Animator in =getPullUpAnimIn(showView);
AnimatorSet set = new AnimatorSet();
set.setDuration(ANIMATION_DURATION);
set.setInterpolator(new DecelerateInterpolator());
set.playTogether(out, in);
return set;
}
示例14: getDeleteItemShowAnimation
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
public Animator getDeleteItemShowAnimation(View view) {
ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0.7f, 1);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0.7f, 1);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new DecelerateInterpolator());
scaleY.setDuration(ANIMATION_DURATION);
scaleX.setDuration(ANIMATION_DURATION);
set.setDuration(ANIMATION_DURATION);
set.playTogether(scaleY, scaleX);
return set;
}
示例15: getDeleteItemAnim
import com.nineoldandroids.animation.AnimatorSet; //導入方法依賴的package包/類
@Override
public Animator getDeleteItemAnim(View showView, View dismissView) {
Animator out = getDeleteItemDisMissAnimation(dismissView);
Animator in =getDeleteItemShowAnimation(showView);
AnimatorSet set = new AnimatorSet();
set.setDuration(ANIMATION_DURATION);
set.setInterpolator(new DecelerateInterpolator());
set.playTogether(out, in);
return set;
}