本文整理匯總了Java中android.support.v4.view.animation.FastOutLinearInInterpolator類的典型用法代碼示例。如果您正苦於以下問題:Java FastOutLinearInInterpolator類的具體用法?Java FastOutLinearInInterpolator怎麽用?Java FastOutLinearInInterpolator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FastOutLinearInInterpolator類屬於android.support.v4.view.animation包,在下文中一共展示了FastOutLinearInInterpolator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DisappearingAnimator
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
public DisappearingAnimator(boolean removeDialog) {
mIsDialogClosing = removeDialog;
Animator sheetFader = ObjectAnimator.ofFloat(
mRequestView, View.ALPHA, mRequestView.getAlpha(), 0f);
Animator sheetTranslator = ObjectAnimator.ofFloat(
mRequestView, View.TRANSLATION_Y, 0f, mAnimatorTranslation);
AnimatorSet current = new AnimatorSet();
current.setDuration(DIALOG_EXIT_ANIMATION_MS);
current.setInterpolator(new FastOutLinearInInterpolator());
if (mIsDialogClosing) {
Animator scrimFader = ObjectAnimator.ofInt(mFullContainer.getBackground(),
AnimatorProperties.DRAWABLE_ALPHA_PROPERTY, 127, 0);
current.playTogether(sheetFader, sheetTranslator, scrimFader);
} else {
current.playTogether(sheetFader, sheetTranslator);
}
mSheetAnimator = current;
mSheetAnimator.addListener(this);
mSheetAnimator.start();
}
示例2: startAnimationExpand
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private void startAnimationExpand(int position, float startZ, float startY, float scaleX, float scaleY) {
transitionAnimHiddenView = new TransitionAnimation(hiddenViews.get(position));
transitionAnimHiddenView.setInterpolator(new FastOutLinearInInterpolator());
transitionAnimHiddenView.startAnimation(startZ,
0,
TransitionAnimation.AnimationType.TRANSLATION_Z);
transitionAnimHiddenView.startAnimation(startY,
0,
TransitionAnimation.AnimationType.TRANSLATION_Y);
transitionAnimHiddenView.startAnimation(scaleX,
valueHandler.getMaxScale(),
TransitionAnimation.AnimationType.SCALE_X);
transitionAnimHiddenView.startAnimation(scaleY,
valueHandler.getMaxScale(),
TransitionAnimation.AnimationType.SCALE_Y);
}
示例3: initInterpolations
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private void initInterpolations() {
ArrayList<Class> interpolatorList = new ArrayList<Class>() {{
add(FastOutSlowInInterpolator.class);
add(BounceInterpolator.class);
add(LinearInterpolator.class);
add(DecelerateInterpolator.class);
add(CycleInterpolator.class);
add(AnticipateInterpolator.class);
add(AccelerateDecelerateInterpolator.class);
add(AccelerateInterpolator.class);
add(AnticipateOvershootInterpolator.class);
add(FastOutLinearInInterpolator.class);
add(LinearOutSlowInInterpolator.class);
add(OvershootInterpolator.class);
}};
try {
interpolatorSelector = (Interpolator) interpolatorList.get(animateSelector).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: createBaseAfiAnimator
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private ValueAnimator createBaseAfiAnimator(int current,
int desired,
float velocity,
final View afiView) {
int difference = Math.abs(desired - current);
long duration = (long) (difference / velocity);
final ValueAnimator valueAnimator = ValueAnimator.ofInt(current, desired);
valueAnimator.setDuration(duration);
valueAnimator.setInterpolator(new FastOutLinearInInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
afiView.getLayoutParams().height = (int) animation.getAnimatedValue();
afiView.requestLayout();
}
});
return valueAnimator;
}
示例5: collapse
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
/**
* Collapse any view with a cool animation
*
* @param v
*/
public static void collapse(final View v) {
final int initialHeight = v.getMeasuredHeight();
Animation a = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
if (interpolatedTime == 1) {
v.setVisibility(View.GONE);
} else {
v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime);
v.requestLayout();
}
}
@Override
public boolean willChangeBounds() {
return true;
}
};
//a.setDuration((int)(initialHeight / v.getContext().getResources().getDisplayMetrics().density));
a.setDuration(300);
a.setInterpolator(new FastOutLinearInInterpolator());
v.startAnimation(a);
}
示例6: prepareCircularReveal
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void prepareCircularReveal(View startView, FrameLayout targetView) {
int centerX = (startView.getLeft() + startView.getRight()) / 2;
// Subtract the start view's height to adjust for relative coordinates on screen.
int centerY = (startView.getTop() + startView.getBottom()) / 2 - startView.getHeight();
float endRadius = (float) Math.hypot(centerX, centerY);
mCircularReveal = ViewAnimationUtils.createCircularReveal(
targetView, centerX, centerY, startView.getWidth(), endRadius);
mCircularReveal.setInterpolator(new FastOutLinearInInterpolator());
mCircularReveal.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mIcon.setVisibility(View.GONE);
mCircularReveal.removeListener(this);
}
});
// Adding a color animation from the FAB's color to transparent creates a dissolve like
// effect to the circular reveal.
int accentColor = ContextCompat.getColor(this, mCategory.getTheme().getAccentColor());
mColorChange = ObjectAnimator.ofInt(targetView,
ViewUtils.FOREGROUND_COLOR, accentColor, Color.TRANSPARENT);
mColorChange.setEvaluator(new ArgbEvaluator());
mColorChange.setInterpolator(mInterpolator);
}
示例7: onSingleTapUp
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
@Override public boolean onSingleTapUp(MotionEvent e) {
View nextView = getNext();
nextView.bringToFront();
nextView.setVisibility(View.VISIBLE);
final float finalRadius =
(float) Math.hypot(nextView.getWidth() / 2f, nextView.getHeight() / 2f) + hypo(
nextView, e);
Animator revealAnimator =
ViewAnimationUtils.createCircularReveal(nextView, (int) e.getX(), (int) e.getY(), 0,
finalRadius, View.LAYER_TYPE_HARDWARE);
revealAnimator.setDuration(MainActivity.SLOW_DURATION);
revealAnimator.setInterpolator(new FastOutLinearInInterpolator());
revealAnimator.start();
return true;
}
示例8: validateSetOfObjectAnimatorAlphaMotionTiming
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
@Test
public void validateSetOfObjectAnimatorAlphaMotionTiming() {
MotionSpec spec =
MotionSpec.createFromResource(
activityTestRule.getActivity(), R.animator.valid_set_of_object_animator_motion_spec);
MotionTiming alpha = spec.getTiming("alpha");
assertEquals(3, alpha.getDelay());
assertEquals(5, alpha.getDuration());
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
assertThat(alpha.getInterpolator(), instanceOf(PathInterpolator.class));
} else {
assertThat(alpha.getInterpolator(), instanceOf(FastOutLinearInInterpolator.class));
}
assertEquals(7, alpha.getRepeatCount());
assertEquals(ValueAnimator.RESTART, alpha.getRepeatMode());
}
示例9: launchCirclesAnimation
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private void launchCirclesAnimation() {
circleTwo.setScaleX(0f);
circleTwo.setScaleY(0f);
circleThree.setScaleX(0f);
circleThree.setScaleY(0f);
ObjectAnimator animator = getCircleAnimation(circleOne, CIRCLE_ANIMATION_TIME);
animator.setRepeatMode(ValueAnimator.RESTART);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new FastOutLinearInInterpolator());
animator.start();
ObjectAnimator animator2 = getCircleAnimation(circleTwo, CIRCLE_ANIMATION_TIME);
animator2.setStartDelay(CIRCLE_ANIMATION_DELAY_ONE);
animator2.setRepeatMode(ValueAnimator.RESTART);
animator2.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new BounceInterpolator());
animator2.start();
ObjectAnimator animator3 = getCircleAnimation(circleThree, CIRCLE_ANIMATION_TIME);
animator3.setStartDelay(CIRCLE_ANIMATION_DELAY_TWO);
animator3.setRepeatMode(ValueAnimator.RESTART);
animator3.setRepeatCount(ValueAnimator.INFINITE);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator3.start();
}
示例10: executeTransition
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
public void executeTransition() {
postponeEnterTransition();
final View decorView = getWindow().getDecorView();
getWindow().getDecorView().getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
decorView.getViewTreeObserver().removeOnPreDrawListener(this);
supportStartPostponedEnterTransition();
return true;
}
});
MyTransition transition = new MyTransition();
transition.setPositionDuration(300);
transition.setSizeDuration(300);
transition.setPositionInterpolator(new FastOutLinearInInterpolator());
transition.setSizeInterpolator(new FastOutSlowInInterpolator());
transition.addTarget("message");
getWindow().setSharedElementEnterTransition(transition);
}
示例11: animateInText
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
/**
* Animates the tooltip into view with a simple slide and fade animation,
* then schedules the tooltip to automatically dismiss itself.
*
* @param onDismissListener A functor to call if the tooltip is dismissed without user intervention.
*/
private void animateInText(final @NonNull OnDismissListener onDismissListener) {
final int overlap = getResources().getDimensionPixelSize(R.dimen.view_info_tooltip_overlap);
animatorFor(text, animatorContext)
.withInterpolator(new FastOutLinearInInterpolator())
.slideYAndFade(overlap, 0f, 0f, 1f)
.addOnAnimationCompleted(new OnAnimationCompleted() {
@Override
public void onAnimationCompleted(boolean finished) {
postDelayed(new Runnable() {
@Override
public void run() {
if (Anime.isAnimating(text) || !isShown()) {
return;
}
onDismissListener.onInfoTooltipDismissed();
dismiss(false);
}
}, VISIBLE_DURATION);
}
})
.start();
}
示例12: updateFabTranslationForSnackbar
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private void updateFabTranslationForSnackbar(CoordinatorLayout parent,
SkittleContainer container, View snackbar) {
float translationY = this.getFabTranslationYForSnackbar(parent, container);
if ((translationY == -snackbar.getHeight())) {
ViewCompat.animate(container)
.translationY(-translationY)
.setInterpolator(new FastOutLinearInInterpolator())
.setListener(null);
} else if (translationY != this.mTranslationY) {
ViewCompat.animate(container).cancel();
if (Math.abs(translationY - this.mTranslationY) == (float) snackbar.getHeight()) {
ViewCompat.animate(container)
.translationY(translationY)
.setInterpolator(new FastOutLinearInInterpolator())
.setListener(null);
} else {
ViewCompat.setTranslationY(container, translationY);
}
this.mTranslationY = translationY;
}
}
示例13: dismissDialog
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private void dismissDialog() {
if (mDialogInOutAnimator != null || !isShowing()) return;
Animator dropDown =
ObjectAnimator.ofFloat(mLayout, View.TRANSLATION_Y, 0f, mLayout.getHeight());
Animator fadeOut = ObjectAnimator.ofFloat(mLayout, View.ALPHA, mLayout.getAlpha(), 0f);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(dropDown, fadeOut);
mDialogInOutAnimator = animatorSet;
mDialogInOutAnimator.setDuration(DIALOG_EXIT_ANIMATION_MS);
mDialogInOutAnimator.setInterpolator(new FastOutLinearInInterpolator());
mDialogInOutAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mDialogInOutAnimator = null;
dismiss();
}
});
mDialogInOutAnimator.start();
}
示例14: onHeaderRefreshComplete
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
/**
* header view 完成更新後恢複初始狀態
*/
public void onHeaderRefreshComplete() {
mHeaderState = PULL_TO_REFRESH;
upAnimator = ValueAnimator.ofInt(getHeaderTopMargin(), -mHeaderViewHeight);
upAnimator.setDuration(100);
upAnimator.setInterpolator(new FastOutLinearInInterpolator());
upAnimator.start();
upAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int value = (int) animation.getAnimatedValue();
setHeaderTopMargin(value);
}
});
mHeaderImageView.setVisibility(View.VISIBLE);
mHeaderImageView.setImageResource(android.R.drawable.arrow_down_float);
mHeaderTextView.setText(R.string.pull_to_refresh_pull_label);
mHeaderProgressBar.setVisibility(View.GONE);
if (mOnHeaderRefreshListener != null) {
mOnHeaderRefreshListener.onHeaderRefreshFinished();
}
// mHeaderUpdateTextView.setText("");
}
示例15: toggleSkittles
import android.support.v4.view.animation.FastOutLinearInInterpolator; //導入依賴的package包/類
private void toggleSkittles(View child, int index) {
int duration = 200;
FastOutLinearInInterpolator interpolator = new FastOutLinearInInterpolator();
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(child,
PropertyValuesHolder.ofFloat("Y", child.getY() + child.getMeasuredHeight() / 2,
child.getY()), PropertyValuesHolder.ofFloat("alpha", 0, 1))
.setDuration(duration);
animator.setInterpolator(interpolator);
if (flag == 0) {
animator.setStartDelay((skittleContainer.getChildCount() - index) * 15);
Log.d("Skittle Layout", "Animation");
animator.start();
} else {
animator.setStartDelay(index * 15);
animator.addListener(this);
animator.reverse();
}
}