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;
}
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();
}
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;
}
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;
}
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;
}
Aggregations