Search in sources :

Example 11 with FastOutLinearInInterpolator

use of android.support.v4.view.animation.FastOutLinearInInterpolator in project android_packages_apps_Dialer by MoKee.

the class VideoCallFragment method enterFullscreenMode.

private void enterFullscreenMode() {
    LogUtil.i("VideoCallFragment.enterFullscreenMode", null);
    hideSystemUI();
    Interpolator fastOutLinearInInterpolator = new FastOutLinearInInterpolator();
    // Animate controls to the hidden state.
    Point offset = getControlsOffsetEndHidden(controls);
    controls.animate().translationX(offset.x).translationY(offset.y).setInterpolator(fastOutLinearInInterpolator).alpha(0).start();
    // Animate onHold to the hidden state.
    offset = getSwitchOnHoldOffsetEndHidden(switchOnHoldButton);
    switchOnHoldButton.animate().translationX(offset.x).translationY(offset.y).setInterpolator(fastOutLinearInInterpolator).alpha(0);
    View contactGridView = contactGridManager.getContainerView();
    // Animate contact grid to the hidden state.
    offset = getContactGridOffsetEndHidden(contactGridView);
    contactGridView.animate().translationX(offset.x).translationY(offset.y).setInterpolator(fastOutLinearInInterpolator).alpha(0);
    offset = getEndCallOffsetEndHidden(endCallButton);
    // Use a fast out interpolator to quickly fade out the button. This is important because the
    // button can't draw under the navigation bar which means that it'll look weird if it just
    // abruptly disappears when it reaches the edge of the naivgation bar.
    endCallButton.animate().translationX(offset.x).translationY(offset.y).setInterpolator(fastOutLinearInInterpolator).alpha(0).withEndAction(new Runnable() {

        @Override
        public void run() {
            endCallButton.setVisibility(View.INVISIBLE);
        }
    }).setInterpolator(new FastOutLinearInInterpolator()).start();
    // a fixed position.
    if (!isInGreenScreenMode) {
        for (View view : getAllPreviewRelatedViews()) {
            // Animate down with the navigation bar hidden.
            view.animate().translationX(0).translationY(0).setInterpolator(new AccelerateDecelerateInterpolator()).start();
        }
    }
    updateOverlayBackground();
}
Also used : FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) LinearOutSlowInInterpolator(android.support.v4.view.animation.LinearOutSlowInInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Interpolator(android.view.animation.Interpolator) FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) Point(android.graphics.Point) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) TextureView(android.view.TextureView)

Example 12 with FastOutLinearInInterpolator

use of android.support.v4.view.animation.FastOutLinearInInterpolator in project android_packages_apps_Dialer by MoKee.

the class FlingUpDownMethod method createBreatheAnimation.

private Animator createBreatheAnimation() {
    AnimatorSet breatheAnimation = new AnimatorSet();
    float textOffset = DpUtil.dpToPx(getContext(), 42);
    Animator textUp = ObjectAnimator.ofFloat(swipeToAnswerText, View.TRANSLATION_Y, 0, /* begin pos */
    -textOffset);
    textUp.setInterpolator(new FastOutSlowInInterpolator());
    textUp.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    Animator textDown = ObjectAnimator.ofFloat(swipeToAnswerText, View.TRANSLATION_Y, -textOffset, 0);
    textDown.setInterpolator(new FastOutSlowInInterpolator());
    textDown.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    // "Swipe down to reject" text fade in
    Animator rejectTextShow = ObjectAnimator.ofFloat(swipeToRejectText, View.ALPHA, 1f);
    rejectTextShow.setInterpolator(new LinearOutSlowInInterpolator());
    rejectTextShow.setDuration(ANIMATE_DURATION_SHORT_MILLIS);
    rejectTextShow.setStartDelay(SWIPE_TO_DECLINE_FADE_IN_DELAY_MILLIS);
    // reject hint text translate in
    Animator rejectTextTranslate = ObjectAnimator.ofFloat(swipeToRejectText, View.TRANSLATION_Y, DpUtil.dpToPx(getContext(), HINT_REJECT_FADE_TRANSLATION_Y_DP), 0f);
    rejectTextTranslate.setInterpolator(new FastOutSlowInInterpolator());
    rejectTextTranslate.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    // reject hint text fade out
    Animator rejectTextHide = ObjectAnimator.ofFloat(swipeToRejectText, View.ALPHA, 0f);
    rejectTextHide.setInterpolator(new FastOutLinearInInterpolator());
    rejectTextHide.setDuration(ANIMATE_DURATION_SHORT_MILLIS);
    Interpolator curve = PathInterpolatorCompat.create(0.4f, /* controlX1 */
    0, /* controlY1 */
    0, /* controlX2 */
    1);
    float puckOffset = DpUtil.dpToPx(getContext(), 42);
    Animator puckUp = ObjectAnimator.ofFloat(contactPuckContainer, View.TRANSLATION_Y, -puckOffset);
    puckUp.setInterpolator(curve);
    puckUp.setDuration(ANIMATE_DURATION_LONG_MILLIS);
    final float scale = 1.0625f;
    Animator puckScaleUp = createUniformScaleAnimators(contactPuckBackground, 1, /* beginScale */
    scale, ANIMATE_DURATION_NORMAL_MILLIS, curve);
    Animator puckDown = ObjectAnimator.ofFloat(contactPuckContainer, View.TRANSLATION_Y, 0);
    puckDown.setInterpolator(new FastOutSlowInInterpolator());
    puckDown.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    Animator puckScaleDown = createUniformScaleAnimators(contactPuckBackground, scale, 1, /* endScale */
    ANIMATE_DURATION_NORMAL_MILLIS, new FastOutSlowInInterpolator());
    // Bounce upward animation chain.
    breatheAnimation.play(textUp).with(rejectTextHide).with(puckUp).with(puckScaleUp).after(167);
    // Bounce downward animation chain.
    breatheAnimation.play(puckDown).with(textDown).with(puckScaleDown).with(rejectTextShow).with(rejectTextTranslate).after(puckUp);
    // Add vibration animation to the animator set.
    addVibrationAnimator(breatheAnimation);
    return breatheAnimation;
}
Also used : LinearOutSlowInInterpolator(android.support.v4.view.animation.LinearOutSlowInInterpolator) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) ValueAnimator(android.animation.ValueAnimator) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) AnimatorSet(android.animation.AnimatorSet) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) LinearOutSlowInInterpolator(android.support.v4.view.animation.LinearOutSlowInInterpolator) BounceInterpolator(android.view.animation.BounceInterpolator) Interpolator(android.view.animation.Interpolator) FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator)

Example 13 with FastOutLinearInInterpolator

use of android.support.v4.view.animation.FastOutLinearInInterpolator in project android_packages_apps_Dialer by MoKee.

the class FlingUpDownMethod method startSwipeToAnswerEntryAnimation.

private void startSwipeToAnswerEntryAnimation() {
    LogUtil.i("FlingUpDownMethod.startSwipeToAnswerEntryAnimation", "Swipe entry animation.");
    endAnimation();
    lockEntryAnim = new AnimatorSet();
    Animator textUp = ObjectAnimator.ofFloat(swipeToAnswerText, View.TRANSLATION_Y, DpUtil.dpToPx(getContext(), 192), DpUtil.dpToPx(getContext(), -20));
    textUp.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    textUp.setInterpolator(new LinearOutSlowInInterpolator());
    Animator textDown = ObjectAnimator.ofFloat(swipeToAnswerText, View.TRANSLATION_Y, DpUtil.dpToPx(getContext(), -20), /* dp */
    0);
    textDown.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    textUp.setInterpolator(new FastOutSlowInInterpolator());
    // "Swipe down to reject" text fades in with a slight translation
    swipeToRejectText.setAlpha(0f);
    Animator rejectTextShow = ObjectAnimator.ofPropertyValuesHolder(swipeToRejectText, PropertyValuesHolder.ofFloat(View.ALPHA, 1f), PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, DpUtil.dpToPx(getContext(), HINT_REJECT_FADE_TRANSLATION_Y_DP), 0f));
    rejectTextShow.setInterpolator(new FastOutLinearInInterpolator());
    rejectTextShow.setDuration(ANIMATE_DURATION_SHORT_MILLIS);
    rejectTextShow.setStartDelay(SWIPE_TO_DECLINE_FADE_IN_DELAY_MILLIS);
    Animator puckUp = ObjectAnimator.ofFloat(contactPuckContainer, View.TRANSLATION_Y, DpUtil.dpToPx(getContext(), 400), DpUtil.dpToPx(getContext(), -12));
    puckUp.setDuration(ANIMATE_DURATION_LONG_MILLIS);
    puckUp.setInterpolator(PathInterpolatorCompat.create(0, /* controlX1 */
    0, /* controlY1 */
    0, /* controlX2 */
    1));
    Animator puckDown = ObjectAnimator.ofFloat(contactPuckContainer, View.TRANSLATION_Y, DpUtil.dpToPx(getContext(), -12), 0);
    puckDown.setDuration(ANIMATE_DURATION_NORMAL_MILLIS);
    puckDown.setInterpolator(new FastOutSlowInInterpolator());
    Animator puckScaleUp = createUniformScaleAnimators(contactPuckBackground, 0.33f, /* beginScale */
    1.1f, /* endScale */
    ANIMATE_DURATION_NORMAL_MILLIS, PathInterpolatorCompat.create(0.4f, /* controlX1 */
    0, /* controlY1 */
    0, /* controlX2 */
    1));
    Animator puckScaleDown = createUniformScaleAnimators(contactPuckBackground, 1.1f, /* beginScale */
    1, /* endScale */
    ANIMATE_DURATION_NORMAL_MILLIS, new FastOutSlowInInterpolator());
    // Upward animation chain.
    lockEntryAnim.play(textUp).with(puckScaleUp).with(puckUp);
    // Downward animation chain.
    lockEntryAnim.play(textDown).with(puckDown).with(puckScaleDown).after(puckUp);
    lockEntryAnim.play(rejectTextShow).after(puckUp);
    // Add vibration animation.
    addVibrationAnimator(lockEntryAnim);
    lockEntryAnim.addListener(new AnimatorListenerAdapter() {

        public boolean canceled;

        @Override
        public void onAnimationCancel(Animator animation) {
            super.onAnimationCancel(animation);
            canceled = true;
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            if (!canceled) {
                onEntryAnimationDone();
            }
        }
    });
    lockEntryAnim.start();
}
Also used : LinearOutSlowInInterpolator(android.support.v4.view.animation.LinearOutSlowInInterpolator) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) ValueAnimator(android.animation.ValueAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) AnimatorSet(android.animation.AnimatorSet)

Example 14 with FastOutLinearInInterpolator

use of android.support.v4.view.animation.FastOutLinearInInterpolator in project LabDayApp by jakdor.

the class LoginFragment method startAnimations.

public void startAnimations() {
    GlideApp.with(this).load(getString(R.string.login_background_url)).diskCacheStrategy(DiskCacheStrategy.NONE).centerCrop().transition(withCrossFade()).into(background);
    Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.login_anim);
    animation.setInterpolator(new FastOutLinearInInterpolator());
    animation.start();
    Animation animation2 = AnimationUtils.loadAnimation(getContext(), R.anim.login_card_anim);
    animation2.setInterpolator(new FastOutLinearInInterpolator());
    animation2.start();
    Animation animation3 = AnimationUtils.loadAnimation(getContext(), R.anim.login_text_anim);
    animation3.setInterpolator(new FastOutLinearInInterpolator());
    animation3.start();
    loginLogo.startAnimation(animation);
    loginCard.startAnimation(animation2);
    logoText.startAnimation(animation3);
}
Also used : FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) Animation(android.view.animation.Animation)

Example 15 with FastOutLinearInInterpolator

use of android.support.v4.view.animation.FastOutLinearInInterpolator in project opacclient by opacapp.

the class AccountItemDetailActivity method onCreate.

@Override
@TargetApi(21)
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_accountitem_detail);
    binding = DataBindingUtil.bind(findViewById(R.id.content));
    setSupportActionBar(binding.toolbar);
    item = (AccountItem) getIntent().getSerializableExtra(EXTRA_ITEM);
    binding.setItem(item);
    binding.btnDetails.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(AccountItemDetailActivity.this, SearchResultDetailActivity.class);
            intent.putExtra(SearchResultDetailFragment.ARG_ITEM_ID, item.getId());
            startActivity(intent);
        }
    });
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Transition enter = new ChangeBounds().setInterpolator(new LinearOutSlowInInterpolator()).setDuration(225);
        getWindow().setSharedElementEnterTransition(enter);
        enter.addListener(new Transition.TransitionListener() {

            @Override
            public void onTransitionStart(Transition transition) {
                ScrollView sv = (ScrollView) findViewById(R.id.scrollView);
                sv.scrollTo(0, 0);
            }

            @Override
            public void onTransitionEnd(Transition transition) {
                ScrollView sv = (ScrollView) findViewById(R.id.scrollView);
                sv.scrollTo(0, 0);
            }

            @Override
            public void onTransitionCancel(Transition transition) {
            }

            @Override
            public void onTransitionPause(Transition transition) {
            }

            @Override
            public void onTransitionResume(Transition transition) {
            }
        });
        Transition exit = new ChangeBounds().setInterpolator(new FastOutLinearInInterpolator()).setDuration(195);
        getWindow().setSharedElementReturnTransition(exit);
    }
    View outside = findViewById(R.id.outside);
    // finish when clicking outside dialog
    outside.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            ActivityCompat.finishAfterTransition(AccountItemDetailActivity.this);
        }
    });
}
Also used : LinearOutSlowInInterpolator(android.support.v4.view.animation.LinearOutSlowInInterpolator) ScrollView(android.widget.ScrollView) ChangeBounds(android.transition.ChangeBounds) Transition(android.transition.Transition) FastOutLinearInInterpolator(android.support.v4.view.animation.FastOutLinearInInterpolator) Intent(android.content.Intent) View(android.view.View) ScrollView(android.widget.ScrollView) TargetApi(android.annotation.TargetApi)

Aggregations

FastOutLinearInInterpolator (android.support.v4.view.animation.FastOutLinearInInterpolator)23 View (android.view.View)11 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)10 Animator (android.animation.Animator)9 ValueAnimator (android.animation.ValueAnimator)9 TextView (android.widget.TextView)9 ObjectAnimator (android.animation.ObjectAnimator)8 Interpolator (android.view.animation.Interpolator)7 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)6 AnimatorSet (android.animation.AnimatorSet)5 Point (android.graphics.Point)4 FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)4 Intent (android.content.Intent)3 Paint (android.graphics.Paint)3 ViewPropertyAnimatorListenerAdapter (android.support.v4.view.ViewPropertyAnimatorListenerAdapter)3 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)3 ImageView (android.widget.ImageView)3 ArgbEvaluator (android.animation.ArgbEvaluator)2 TargetApi (android.annotation.TargetApi)2 LinearGradient (android.graphics.LinearGradient)2