Search in sources :

Example 21 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project JamsMusicPlayer by psaravan.

the class MusicFoldersFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mContext = getActivity().getApplicationContext();
    mApp = (Common) mContext;
    View rootView = (View) getActivity().getLayoutInflater().inflate(R.layout.fragment_welcome_screen_2, null);
    mFoldersLayout = (RelativeLayout) rootView.findViewById(R.id.folders_fragment_holder);
    if (mApp.getSharedPreferences().getInt("MUSIC_FOLDERS_SELECTION", 0) == 0) {
        mFoldersLayout.setVisibility(View.INVISIBLE);
        mFoldersLayout.setEnabled(false);
    } else {
        mFoldersLayout.setVisibility(View.VISIBLE);
        mFoldersLayout.setEnabled(true);
    }
    mSlideInAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 2.0f, Animation.RELATIVE_TO_SELF, 0.0f);
    mSlideInAnimation.setDuration(600);
    mSlideInAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    mSlideInAnimation.setAnimationListener(slideInListener);
    mSlideOutAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 2.0f);
    mSlideOutAnimation.setDuration(600);
    mSlideOutAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    mSlideOutAnimation.setAnimationListener(slideOutListener);
    mChildFragmentManager = this.getChildFragmentManager();
    mChildFragmentManager.beginTransaction().add(R.id.folders_fragment_holder, getMusicFoldersSelectionFragment()).commit();
    mWelcomeHeader = (TextView) rootView.findViewById(R.id.welcome_header);
    mWelcomeHeader.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Light"));
    mMusicFoldersOptions = (RadioGroup) rootView.findViewById(R.id.music_library_welcome_radio_group);
    RadioButton getAllSongsRadioButton = (RadioButton) mMusicFoldersOptions.findViewById(R.id.get_all_songs_radio);
    RadioButton letMePickFoldersRadioButton = (RadioButton) mMusicFoldersOptions.findViewById(R.id.pick_folders_radio);
    getAllSongsRadioButton.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Regular"));
    letMePickFoldersRadioButton.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Regular"));
    mMusicFoldersOptions.setOnCheckedChangeListener(onCheckedChangeListener);
    return rootView;
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) RadioButton(android.widget.RadioButton) TextView(android.widget.TextView) View(android.view.View)

Example 22 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project WaveSwipeRefreshLayout by recruit-lifestyle.

the class WaveView method startDropAnimation.

public void startDropAnimation() {
    // show dropBubble again
    mDisappearCircleAnimator = ValueAnimator.ofFloat(1.f, 1.f);
    mDisappearCircleAnimator.setDuration(1);
    mDisappearCircleAnimator.start();
    mDropCircleAnimator = ValueAnimator.ofFloat(500 * (mWidth / 1440.f), mMaxDropHeight);
    mDropCircleAnimator.setDuration(DROP_CIRCLE_ANIMATOR_DURATION);
    mDropCircleAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mCurrentCircleCenterY = (float) animation.getAnimatedValue();
            ViewCompat.postInvalidateOnAnimation(WaveView.this);
        }
    });
    mDropCircleAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    mDropCircleAnimator.start();
    mDropVertexAnimator = ValueAnimator.ofFloat(0.f, mMaxDropHeight - mDropCircleRadius);
    mDropVertexAnimator.setDuration(DROP_VERTEX_ANIMATION_DURATION);
    mDropVertexAnimator.addUpdateListener(mAnimatorUpdateListener);
    mDropVertexAnimator.start();
    mDropBounceVerticalAnimator = ValueAnimator.ofFloat(0.f, 1.f);
    mDropBounceVerticalAnimator.setDuration(DROP_BOUNCE_ANIMATOR_DURATION);
    mDropBounceVerticalAnimator.addUpdateListener(mAnimatorUpdateListener);
    mDropBounceVerticalAnimator.setInterpolator(new DropBounceInterpolator());
    mDropBounceVerticalAnimator.setStartDelay(DROP_VERTEX_ANIMATION_DURATION);
    mDropBounceVerticalAnimator.start();
    mDropBounceHorizontalAnimator = ValueAnimator.ofFloat(0.f, 1.f);
    mDropBounceHorizontalAnimator.setDuration(DROP_BOUNCE_ANIMATOR_DURATION);
    mDropBounceHorizontalAnimator.addUpdateListener(mAnimatorUpdateListener);
    mDropBounceHorizontalAnimator.setInterpolator(new DropBounceInterpolator());
    mDropBounceHorizontalAnimator.setStartDelay((long) (DROP_VERTEX_ANIMATION_DURATION + DROP_BOUNCE_ANIMATOR_DURATION * 0.25));
    mDropBounceHorizontalAnimator.start();
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 23 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class DropAnimation method createAnimator.

@NonNull
@Override
public AnimatorSet createAnimator() {
    AnimatorSet animator = new AnimatorSet();
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    return animator;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnimatorSet(android.animation.AnimatorSet) NonNull(android.support.annotation.NonNull)

Example 24 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class DropAnimation method createValueAnimation.

private ValueAnimator createValueAnimation(int fromValue, int toValue, long duration, final AnimationType type) {
    ValueAnimator anim = ValueAnimator.ofInt(fromValue, toValue);
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration(duration);
    anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            int value = (int) animation.getAnimatedValue();
            onAnimatorUpdate(value, type);
        }
    });
    return anim;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 25 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.

the class ThinWormAnimation method createHeightAnimator.

private ValueAnimator createHeightAnimator(int fromHeight, int toHeight, long startDelay) {
    ValueAnimator anim = ValueAnimator.ofInt(fromHeight, toHeight);
    anim.setInterpolator(new AccelerateDecelerateInterpolator());
    anim.setDuration((long) (animationDuration * PERCENTAGE_HEIGHT_DURATION));
    anim.setStartDelay(startDelay);
    anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            height = (int) animation.getAnimatedValue();
            listener.onThinWormAnimationUpdated(rectLeftX, rectRightX, height);
        }
    });
    return anim;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Aggregations

AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)152 ObjectAnimator (android.animation.ObjectAnimator)30 ValueAnimator (android.animation.ValueAnimator)30 Animator (android.animation.Animator)28 View (android.view.View)28 AnimatorSet (android.animation.AnimatorSet)19 Animation (android.view.animation.Animation)19 Handler (android.os.Handler)14 TranslateAnimation (android.view.animation.TranslateAnimation)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)10 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)10 AlphaAnimation (android.view.animation.AlphaAnimation)10 ImageView (android.widget.ImageView)10 Paint (android.graphics.Paint)9 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)9 LinearInterpolator (android.view.animation.LinearInterpolator)9 ScaleAnimation (android.view.animation.ScaleAnimation)9 PropertyValuesHolder (android.animation.PropertyValuesHolder)8 TextView (android.widget.TextView)8 Point (android.graphics.Point)7