Search in sources :

Example 16 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.

the class FriendlyFloatingActionButton method show.

public void show() {
    if (mShowing) {
        return;
    }
    mShowing = true;
    cancelAnimator();
    mAnimator = ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), 0).setDuration(mAnimationDuration);
    mAnimator.setInterpolator(new FastOutSlowInInterpolator());
    mAnimator.start();
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 17 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Tapad by berict.

the class MainActivity method closeAbout.

private void closeAbout() {
    Log.d("closeAbout", "triggered");
    anim.circularRevealInPx(R.id.placeholder, coord[0], coord[1], (int) Math.hypot(coord[0], coord[1]) + 200, 0, new AccelerateDecelerateInterpolator(), circularRevealDuration, fadeAnimDuration, a);
    anim.fadeIn(R.id.placeholder, 0, fadeAnimDuration, "aboutOut", a);
    setAboutVisible(false);
    Handler closeAbout = new Handler();
    closeAbout.postDelayed(new Runnable() {

        @Override
        public void run() {
            setPresetInfo();
            w.getView(R.id.fragment_about_container, a).setVisibility(View.GONE);
        }
    }, fadeAnimDuration);
    // Firstrun tutorial
    if (prefs.getInt(qs, 0) == 8) {
        promptPreset = new MaterialTapTargetPrompt.Builder(a).setTarget(a.findViewById(R.id.toolbar_preset)).setPrimaryText(R.string.dialog_tap_target_preset_primary).setSecondaryText(R.string.dialog_tap_target_preset_secondary).setAnimationInterpolator(new FastOutSlowInInterpolator()).setFocalColourFromRes(R.color.blue_500).setAutoDismiss(false).setAutoFinish(false).setCaptureTouchEventOutsidePrompt(true).setOnHidePromptListener(new MaterialTapTargetPrompt.OnHidePromptListener() {

            @Override
            public void onHidePrompt(MotionEvent event, boolean tappedTarget) {
                if (tappedTarget) {
                    promptPreset.finish();
                    promptPreset = null;
                    prefs.edit().putInt(qs, 9).apply();
                    Log.i("sharedPrefs", "quickstart edited to 9");
                }
            }

            @Override
            public void onHidePromptComplete() {
            // idk why is this here
            //isTutorialVisible = false;
            }
        }).show();
    }
    // reset the touch coords
    coord[0] = 0;
    coord[1] = 0;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Handler(android.os.Handler) MaterialTapTargetPrompt(uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt) MotionEvent(android.view.MotionEvent)

Example 18 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project android-topeka by googlesamples.

the class QuizActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    mCountingIdlingResource = new CountingIdlingResource("Quiz");
    String categoryId = getIntent().getStringExtra(Category.TAG);
    mInterpolator = new FastOutSlowInInterpolator();
    if (null != savedInstanceState) {
        mSavedStateIsPlaying = savedInstanceState.getBoolean(STATE_IS_PLAYING);
    }
    super.onCreate(savedInstanceState);
    populate(categoryId);
    int categoryNameTextSize = getResources().getDimensionPixelSize(R.dimen.category_item_text_size);
    int paddingStart = getResources().getDimensionPixelSize(R.dimen.spacing_double);
    final int startDelay = getResources().getInteger(R.integer.toolbar_transition_duration);
    ActivityCompat.setEnterSharedElementCallback(this, new TextSharedElementCallback(categoryNameTextSize, paddingStart) {

        @Override
        public void onSharedElementStart(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {
            super.onSharedElementStart(sharedElementNames, sharedElements, sharedElementSnapshots);
            mToolbarBack.setScaleX(0f);
            mToolbarBack.setScaleY(0f);
        }

        @Override
        public void onSharedElementEnd(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {
            super.onSharedElementEnd(sharedElementNames, sharedElements, sharedElementSnapshots);
            // Make sure to perform this animation after the transition has ended.
            ViewCompat.animate(mToolbarBack).setStartDelay(startDelay).scaleX(1f).scaleY(1f).alpha(1f);
        }
    });
}
Also used : CountingIdlingResource(android.support.test.espresso.contrib.CountingIdlingResource) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) TextSharedElementCallback(com.google.samples.apps.topeka.widget.TextSharedElementCallback) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint)

Example 19 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project kickmaterial by byoutline.

the class CategoriesListActivity method animateCircleReveal.

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void animateCircleReveal(final int color, Category category) {
    // get the center for the clipping circle
    int cx = (binding.categoryCircleRevealIv.getLeft() + binding.categoryCircleRevealIv.getRight()) / 2;
    int cy = (binding.categoryCircleRevealIv.getTop() + binding.categoryCircleRevealIv.getBottom());
    int finalRadius = Math.max(binding.categoryCircleRevealIv.getWidth(), binding.categoryCircleRevealIv.getHeight());
    if (LUtils.hasL()) {
        if (revealAnimation != null && revealAnimation.isRunning()) {
            revealAnimation.end();
        }
        revealAnimation = ViewAnimationUtils.createCircularReveal(binding.categoryCircleRevealIv, cx, cy, 0.4f * finalRadius, finalRadius);
        revealAnimation.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationStart(Animator animation) {
                super.onAnimationStart(animation);
                ViewUtils.showView(binding.categoryCircleRevealIv, true);
                binding.selectCategoryTv.setBackgroundColor(Color.TRANSPARENT);
                LUtils.setStatusBarColor(CategoriesListActivity.this, color);
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                if (binding.categoryCircleIv != null) {
                    binding.categoryCircleIv.setColorFilter(color);
                    binding.selectCategoryTv.setBackgroundColor(color);
                    binding.selectCategoryTv.getBackground().setAlpha(85);
                    binding.categoryCircleRevealIv.setVisibility(View.INVISIBLE);
                }
            }
        });
        revealAnimation.setDuration(REVEAL_ANIM_DURATION);
        revealAnimation.setInterpolator(new FastOutSlowInInterpolator());
        revealAnimation.start();
    } else {
        binding.categoryCircleIv.setColorFilter(color);
    }
    if (category != null) {
        finishWithResult(category);
    }
}
Also used : Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) TargetApi(android.annotation.TargetApi)

Example 20 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TextSurface by elevenetc.

the class ShapeReveal method start.

@Override
public void start(@Nullable final IEndListener listener) {
    text.setAlpha(255);
    animator = revealShape.getAnimator();
    animator.setInterpolator(new FastOutSlowInInterpolator());
    Utils.addEndListener(this, animator, new IEndListener() {

        @Override
        public void onAnimationEnd(ISurfaceAnimation animation) {
            text.removeEffect(ShapeReveal.this);
            if (hideOnEnd)
                text.setAlpha(0);
            if (listener != null)
                listener.onAnimationEnd(ShapeReveal.this);
        }
    });
    animator.setDuration(duration);
    animator.start();
}
Also used : ISurfaceAnimation(su.levenetc.android.textsurface.interfaces.ISurfaceAnimation) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) IEndListener(su.levenetc.android.textsurface.interfaces.IEndListener)

Aggregations

FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)35 View (android.view.View)11 Animator (android.animation.Animator)8 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)6 AnimatorSet (android.animation.AnimatorSet)6 ObjectAnimator (android.animation.ObjectAnimator)6 BindView (butterknife.BindView)6 PropertyValuesHolder (android.animation.PropertyValuesHolder)4 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)4 RecyclerView (android.support.v7.widget.RecyclerView)4 MotionEvent (android.view.MotionEvent)3 ViewGroup (android.view.ViewGroup)3 TextView (android.widget.TextView)3 ExitFragmentTransition (com.kogitune.activity_transition.fragment.ExitFragmentTransition)3 IEndListener (su.levenetc.android.textsurface.interfaces.IEndListener)3 ISurfaceAnimation (su.levenetc.android.textsurface.interfaces.ISurfaceAnimation)3 TargetApi (android.annotation.TargetApi)2 Rect (android.graphics.Rect)2 Nullable (android.support.annotation.Nullable)2 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)2