类android.support.v4.view.animation.FastOutLinearInInterpolator源码实例Demo

下面列出了怎么用android.support.v4.view.animation.FastOutLinearInInterpolator的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: android-topeka   文件: QuizActivity.java
@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);
}
 
源代码2 项目: delion   文件: PaymentRequestUI.java
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();
}
 
源代码3 项目: SegmentedButton   文件: SegmentedButtonGroup.java
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 项目: AndroidChromium   文件: PaymentRequestUI.java
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();
}
 
源代码5 项目: Skittles   文件: SkittleContainer.java
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;
  }
}
 
源代码6 项目: 365browser   文件: EditorDialog.java
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();
}
 
源代码7 项目: 365browser   文件: PaymentRequestUI.java
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();
}
 
源代码8 项目: MyBlogDemo   文件: HeaderView.java
/**
 * 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("");


}
 
public void updateTransition(View v) {
    mDrawerListenerAdapter.removeAllTransitions();

    ViewTransitionBuilder builder = ViewTransitionBuilder.transit(mGradient).translationX(-mGradient.getWidth(), 0);
    switch (v.getId()) {
        case R.id.interpolator_default:
            break;
        case R.id.interpolator_linear:
            builder.interpolator(new LinearInterpolator());
            break;
        case R.id.interpolator_accelerate:
            builder.interpolator(new AccelerateInterpolator());
            break;
        case R.id.interpolator_decelerate:
            builder.interpolator(new DecelerateInterpolator());
            break;
        case R.id.interpolator_fastout:
            builder.interpolator(new FastOutLinearInInterpolator());
            break;
        case R.id.interpolator_anticipate:
            builder.interpolator(new AnticipateInterpolator());
            break;
    }
    mDrawerListenerAdapter.addTransition(builder);
}
 
@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;
}
 
源代码11 项目: v9porn   文件: RightViewHideShowAnimation.java
public RightViewHideShowAnimation(View view, boolean toVisible, long duration) {
    super(false);
    this.toVisible = toVisible;
    this.animationView = view;

    //Creates the Alpha animation for the transition
    float startAlpha = toVisible ? 0 : 1;
    float endAlpha = toVisible ? 1 : 0;

    AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha);
    alphaAnimation.setDuration(duration);


    //Creates the Translate animation for the transition
    int startX = toVisible ? getHideShowDelta(view) : 0;
    int endX = toVisible ? 0 : getHideShowDelta(view);
    TranslateAnimation translateAnimation = new TranslateAnimation(startX, endX, 0, 0);
    translateAnimation.setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
    translateAnimation.setDuration(duration);


    //Adds the animations to the set
    addAnimation(alphaAnimation);
    addAnimation(translateAnimation);

    setAnimationListener(new Listener());
}
 
源代码12 项目: v9porn   文件: RightViewHideShowAnimation.java
public RightViewHideShowAnimation(View view, boolean toVisible, long duration) {
    super(false);
    this.toVisible = toVisible;
    this.animationView = view;

    //Creates the Alpha animation for the transition
    float startAlpha = toVisible ? 0 : 1;
    float endAlpha = toVisible ? 1 : 0;

    AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha);
    alphaAnimation.setDuration(duration);


    //Creates the Translate animation for the transition
    int startX = toVisible ? getHideShowDelta(view) : 0;
    int endX = toVisible ? 0 : getHideShowDelta(view);
    TranslateAnimation translateAnimation = new TranslateAnimation(startX, endX, 0, 0);
    translateAnimation.setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
    translateAnimation.setDuration(duration);


    //Adds the animations to the set
    addAnimation(alphaAnimation);
    addAnimation(translateAnimation);

    setAnimationListener(new Listener());
}
 
源代码13 项目: music_player   文件: MainActivity.java
private void changeVisibility() {
    View music_info_cardView = findViewById(R.id.music_info_cardView);
    View control_layout = findViewById(R.id.control_layout);
    View seekbar_layout = findViewById(R.id.seekbar_layout);
    View lrcView = findViewById(R.id.other_lrc_view);
    View gradient = findViewById(R.id.gradient);
    View gradient_bottom = findViewById(R.id.gradient_bottom);
    View gradient_top = findViewById(R.id.gradient_top);
    TransitionManager.beginDelayedTransition(transitionsContainer, new TransitionSet().addTransition(new Fade()).setInterpolator(visible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator()));
    if (music_info_cardView.getVisibility() == VISIBLE) {
        music_info_cardView.setVisibility(GONE);
        control_layout.setVisibility(GONE);
        seekbar_layout.setVisibility(GONE);
        lrcView.setVisibility(VISIBLE);
        gradient.setVisibility(VISIBLE);
        gradient_bottom.setVisibility(VISIBLE);
        gradient_top.setVisibility(VISIBLE);
    } else {
        music_info_cardView.setVisibility(VISIBLE);
        control_layout.setVisibility(VISIBLE);
        seekbar_layout.setVisibility(VISIBLE);
        lrcView.setVisibility(GONE);
        gradient.setVisibility(GONE);
        gradient_bottom.setVisibility(GONE);
        gradient_top.setVisibility(GONE);
    }
    visible = !visible;
}
 
源代码14 项目: MaterialMasterDetail   文件: ContainersLayout.java
private void animateOutFrameDetails() {
    ViewUtils.onLaidOut(frameDetails, new Runnable() {
        @Override
        public void run() {
            if (!frameDetails.isShown()) {
                return;
            }
            ObjectAnimator alpha = ObjectAnimator.ofFloat(frameDetails, View.ALPHA, 1f, 0f);
            ObjectAnimator translate = ofFloat(frameDetails, View.TRANSLATION_Y, 0f, frameDetails.getHeight() * 0.3f);

            AnimatorSet set = new AnimatorSet();
            set.playTogether(alpha, translate);
            set.setDuration(ANIM_DURATION);
            set.setInterpolator(new FastOutLinearInInterpolator());
            set.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);
                    frameDetails.setAlpha(1f);
                    frameDetails.setTranslationY(0);
                    frameDetails.setVisibility(View.GONE);
                }
            });
            set.start();
        }
    });
}
 
public void slideInFab() {
    if (mAnimatingFab) {
        return;
    }

    if (isFabExpanded()) {
        contractFab();
        return;
    }

    ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
    float dy = mFab.getHeight() + lp.bottomMargin;
    if (mFab.getTranslationY() != dy) {
        return;
    }

    mAnimatingFab = true;
    mFab.setVisibility(View.VISIBLE);
    mFab.animate()
            .setStartDelay(0)
            .setDuration(200)
            .setInterpolator(new FastOutLinearInInterpolator())
            .translationY(0f)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(final Animator animation) {
                    super.onAnimationEnd(animation);
                    mAnimatingFab = false;
                }
            })
            .start();
}
 
public void slideOutFab() {
    if (mAnimatingFab) {
        return;
    }

    if (isFabExpanded()) {
        contractFab();
        return;
    }

    ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
    if (mFab.getTranslationY() != 0f) {
        return;
    }

    mAnimatingFab = true;
    mFab.animate()
            .setStartDelay(0)
            .setDuration(200)
            .setInterpolator(new FastOutLinearInInterpolator())
            .translationY(mFab.getHeight() + lp.bottomMargin)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(final Animator animation) {
                    super.onAnimationEnd(animation);
                    mAnimatingFab = false;
                    mFab.setVisibility(View.INVISIBLE);
                }
            })
            .start();
}
 
源代码17 项目: Expert-Android-Programming   文件: FooterLayout.java
public void slideInFab() {
    if (mAnimatingFab) {
        return;
    }

    if (isFabExpanded()) {
        contractFab();
        return;
    }

    ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
    float dy = mFab.getHeight() + lp.bottomMargin;
    if (mFab.getTranslationY() != dy) {
        return;
    }

    mAnimatingFab = true;
    mFab.setVisibility(View.VISIBLE);
    mFab.animate()
            .setStartDelay(0)
            .setDuration(200)
            .setInterpolator(new FastOutLinearInInterpolator())
            .translationY(0f)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(final Animator animation) {
                    super.onAnimationEnd(animation);
                    mAnimatingFab = false;
                }
            })
            .start();
}
 
源代码18 项目: Expert-Android-Programming   文件: FooterLayout.java
public void slideOutFab() {
    if (mAnimatingFab) {
        return;
    }

    if (isFabExpanded()) {
        contractFab();
        return;
    }

    ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
    if (mFab.getTranslationY() != 0f) {
        return;
    }

    mAnimatingFab = true;
    mFab.animate()
            .setStartDelay(0)
            .setDuration(200)
            .setInterpolator(new FastOutLinearInInterpolator())
            .translationY(mFab.getHeight() + lp.bottomMargin)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(final Animator animation) {
                    super.onAnimationEnd(animation);
                    mAnimatingFab = false;
                    mFab.setVisibility(View.INVISIBLE);
                }
            })
            .start();
}
 
源代码19 项目: floatingMenu   文件: MainActivity.java
private void initUi() {
    fab_1 = (FloatingMenuButton) findViewById(R.id.fab_1);
    fab_1.setStartAngle(0)
            .setEndAngle(360)
            .setRadius(200)
            .setAnimationType(AnimationType.EXPAND)
            .setMovementStyle(MovementStyle.STICKED_TO_SIDES);

    fab_1.getAnimationHandler()
            .setOpeningAnimationDuration(500)
            .setClosingAnimationDuration(200)
            .setLagBetweenItems(0)
            .setOpeningInterpolator(new FastOutSlowInInterpolator())
            .setClosingInterpolator(new FastOutLinearInInterpolator())
            .shouldFade(true)
            .shouldScale(true)
            .shouldRotate(false);

    fab_2 = (FloatingMenuButton) findViewById(R.id.fab_2);
    fab_2.setStartAngle(0)
            .setEndAngle(360)
            .setTransparentAfterMilliseconds(0)
            .setAnimationType(AnimationType.RADIAL)
            .setMovementStyle(MovementStyle.FREE);

    fab_2.getAnimationHandler()
            .setOpeningAnimationDuration(500)
            .setClosingAnimationDuration(200)
            .setLagBetweenItems(0)
            .setOpeningInterpolator(new FastOutSlowInInterpolator())
            .setClosingInterpolator(new FastOutLinearInInterpolator())
            .shouldFade(true)
            .shouldScale(true)
            .shouldRotate(false);

}
 
源代码20 项目: android-topeka   文件: QuizFragment.java
@SuppressWarnings("ConstantConditions")
private void setAvatarDrawable(AvatarView avatarView) {
    Player player = PreferencesHelper.getPlayer(getActivity());
    avatarView.setAvatar(player.getAvatar().getDrawableId());
    ViewCompat.animate(avatarView)
            .setInterpolator(new FastOutLinearInInterpolator())
            .setStartDelay(500)
            .scaleX(1)
            .scaleY(1)
            .start();
}
 
源代码21 项目: RadioRealButton   文件: RadioRealButtonGroup.java
private void initInterpolations() {
    Class[] interpolations = {
            FastOutSlowInInterpolator.class,
            BounceInterpolator.class,
            LinearInterpolator.class,
            DecelerateInterpolator.class,
            CycleInterpolator.class,
            AnticipateInterpolator.class,
            AccelerateDecelerateInterpolator.class,
            AccelerateInterpolator.class,
            AnticipateOvershootInterpolator.class,
            FastOutLinearInInterpolator.class,
            LinearOutSlowInInterpolator.class,
            OvershootInterpolator.class};

    try {
        interpolatorText = (Interpolator) interpolations[animateTextsEnter].newInstance();
        interpolatorDrawablesEnter = (Interpolator) interpolations[animateDrawablesEnter].newInstance();
        interpolatorSelector = (Interpolator) interpolations[animateSelector].newInstance();

        interpolatorTextExit = (Interpolator) interpolations[animateTextsExit].newInstance();
        interpolatorDrawablesExit = (Interpolator) interpolations[animateDrawablesExit].newInstance();

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码22 项目: ExpandableLayout   文件: Utils.java
/**
 * Creates interpolator.
 *
 * @param interpolatorType
 * @return
 */
public static TimeInterpolator createInterpolator(@IntRange(from = 0, to = 10) final int interpolatorType) {
    switch (interpolatorType) {
        case ACCELERATE_DECELERATE_INTERPOLATOR:
            return new AccelerateDecelerateInterpolator();
        case ACCELERATE_INTERPOLATOR:
            return new AccelerateInterpolator();
        case ANTICIPATE_INTERPOLATOR:
            return new AnticipateInterpolator();
        case ANTICIPATE_OVERSHOOT_INTERPOLATOR:
            return new AnticipateOvershootInterpolator();
        case BOUNCE_INTERPOLATOR:
            return new BounceInterpolator();
        case DECELERATE_INTERPOLATOR:
            return new DecelerateInterpolator();
        case FAST_OUT_LINEAR_IN_INTERPOLATOR:
            return new FastOutLinearInInterpolator();
        case FAST_OUT_SLOW_IN_INTERPOLATOR:
            return new FastOutSlowInInterpolator();
        case LINEAR_INTERPOLATOR:
            return new LinearInterpolator();
        case LINEAR_OUT_SLOW_IN_INTERPOLATOR:
            return new LinearOutSlowInInterpolator();
        case OVERSHOOT_INTERPOLATOR:
            return new OvershootInterpolator();
        default:
            return new LinearInterpolator();
    }
}
 
源代码23 项目: ExoMedia   文件: BottomViewHideShowAnimation.java
public BottomViewHideShowAnimation(View view, boolean toVisible, long duration) {
    super(false);
    this.toVisible = toVisible;
    this.animationView = view;

    //Creates the Alpha animation for the transition
    float startAlpha = toVisible ? 0 : 1;
    float endAlpha = toVisible ? 1 : 0;

    AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha);
    alphaAnimation.setDuration(duration);


    //Creates the Translate animation for the transition
    int startY = toVisible ? getHideShowDelta(view) : 0;
    int endY = toVisible ? 0 : getHideShowDelta(view);
    TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, startY, endY);
    translateAnimation.setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
    translateAnimation.setDuration(duration);


    //Adds the animations to the set
    addAnimation(alphaAnimation);
    addAnimation(translateAnimation);

    setAnimationListener(new Listener());
}
 
源代码24 项目: ExoMedia   文件: TopViewHideShowAnimation.java
public TopViewHideShowAnimation(View view, boolean toVisible, long duration) {
    super(false);
    this.toVisible = toVisible;
    this.animationView = view;

    //Creates the Alpha animation for the transition
    float startAlpha = toVisible ? 0 : 1;
    float endAlpha = toVisible ? 1 : 0;

    AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha);
    alphaAnimation.setDuration(duration);


    //Creates the Translate animation for the transition
    int startY = toVisible ? -view.getHeight() : 0;
    int endY = toVisible ? 0 : -view.getHeight();
    TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, startY, endY);
    translateAnimation.setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
    translateAnimation.setDuration(duration);


    //Adds the animations to the set
    addAnimation(alphaAnimation);
    addAnimation(translateAnimation);

    setAnimationListener(new Listener());
}
 
源代码25 项目: AcDisplay   文件: CircleView.java
private void startAnimatorBy(float from, float to, int duration) {
    cancelAndClearAnimator();
    // Animate the circle
    mAnimator = ObjectAnimator.ofFloat(this, RADIUS_PROPERTY, from, to);
    mAnimator.setInterpolator(new FastOutLinearInInterpolator());
    mAnimator.setDuration(duration);
    mAnimator.start();
}
 
源代码26 项目: CircularReveal   文件: MainActivity.java
private void executeCardsSequentialAnimation() {
  final int length = cardsLine.getChildCount();
  cardsLine.setVisibility(View.VISIBLE);

  final Animator[] animators = new Animator[length];
  for (int i = 0; i < length; i++) {
    View target = cardsLine.getChildAt(i);
    final float x0 = 0;// i == 0 ? 0 : -10 * (1 + i * 0.2f);
    final float y0 = 10 * i;

    target.setTranslationX(x0);
    target.setTranslationY(y0);

    AnimatorPath path = new AnimatorPath();
    path.moveTo(x0, y0);
    path.lineTo(0, 0);

    PathPoint[] points = new PathPoint[path.getPoints().size()];
    path.getPoints().toArray(points);

    AnimatorSet set = new AnimatorSet();
    set.play(ObjectAnimator.ofObject(target, PATH_POINT, new PathEvaluator(), points))
        .with(ObjectAnimator.ofFloat(target, View.ALPHA, 0.8f, 1f));

    animators[i] = set;
    animators[i].setStartDelay(15 * i);
  }

  final AnimatorSet sequential = new AnimatorSet();
  sequential.playTogether(animators);
  sequential.setInterpolator(new FastOutLinearInInterpolator());
  sequential.setDuration(FAST_DURATION);
  sequential.start();
}
 
源代码27 项目: FABRevealMenu-master   文件: AnimationHelper.java
public AnimationHelper(ViewHelper viewHelper) {
    this.viewHelper = viewHelper;
    fabAnimInterpolator = new AccelerateDecelerateInterpolator();
    revealAnimInterpolator = new FastOutLinearInInterpolator();
}
 
 类所在包
 类方法
 同包方法