當前位置: 首頁>>代碼示例>>Java>>正文


Java FastOutLinearInInterpolator類代碼示例

本文整理匯總了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();
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:24,代碼來源:PaymentRequestUI.java

示例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);
}
 
開發者ID:AppliKey,項目名稱:Sunstrike,代碼行數:21,代碼來源:AnimationController.java

示例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();
    }
}
 
開發者ID:ceryle,項目名稱:SegmentedButton,代碼行數:23,代碼來源:SegmentedButtonGroup.java

示例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;
}
 
開發者ID:TapTrack,項目名稱:TappyBLE,代碼行數:20,代碼來源:DetectType4CommandAdapter.java

示例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);
}
 
開發者ID:RiccardoBusetti,項目名稱:Colombo,代碼行數:31,代碼來源:ExpandAnimationUtil.java

示例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);
}
 
開發者ID:vanpersie9987,項目名稱:android-topeka,代碼行數:26,代碼來源:QuizActivity.java

示例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;
}
 
開發者ID:joelan,項目名稱:CircleReveal,代碼行數:20,代碼來源:RadialTransformationActivity.java

示例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());
}
 
開發者ID:material-components,項目名稱:material-components-android,代碼行數:18,代碼來源:MotionSpecTest.java

示例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();
}
 
開發者ID:Aracem,項目名稱:android-complex-animation,代碼行數:27,代碼來源:PostAJobAnimatedView.java

示例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);
}
 
開發者ID:qibin0506,項目名稱:TransitionAnimator,代碼行數:23,代碼來源:MessageActivity.java

示例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();
}
 
開發者ID:hello,項目名稱:anime-android-go-99,代碼行數:30,代碼來源:InfoTooltipView.java

示例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;
  }
}
 
開發者ID:aashrairavooru,項目名稱:Skittles,代碼行數:23,代碼來源:SkittleContainer.java

示例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();
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:23,代碼來源:EditorDialog.java

示例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("");


}
 
開發者ID:lovejjfg,項目名稱:MyBlogDemo,代碼行數:28,代碼來源:HeaderView.java

示例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();
        }
    }
 
開發者ID:xu6148152,項目名稱:binea_project_for_android,代碼行數:22,代碼來源:SkittleLayout.java


注:本文中的android.support.v4.view.animation.FastOutLinearInInterpolator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。