List of usage examples for android.view.animation AnticipateOvershootInterpolator AnticipateOvershootInterpolator
public AnticipateOvershootInterpolator()
From source file:Main.java
public static AnticipateOvershootInterpolator getAnticipateOvershootInterpolator() { return new AnticipateOvershootInterpolator(); }
From source file:com.bobomee.android.navigator.expandable.Utils.java
/** * Creates interpolator./*from ww w . j a va 2s .com*/ * @return a timeinterpolator * @param interpolatorType a int value from 0 to 10 */ public static TimeInterpolator createInterpolator(@IntRange(from = 0, to = 10) final int interpolatorType) { switch (interpolatorType) { case ACCELERATE_DECELERATE_INTERPOLATOR: return new AccelerateDecelerateInterpolator(); case ACCELERATE_INTERPOLATOR: return new AccelerateInterpolator(); case ANTICIPATE_INTERPOLATOR: return new AnticipateInterpolator(); case ANTICIPATE_OVERSHOOT_INTERPOLATOR: return new AnticipateOvershootInterpolator(); case BOUNCE_INTERPOLATOR: return new BounceInterpolator(); case DECELERATE_INTERPOLATOR: return new DecelerateInterpolator(); case FAST_OUT_LINEAR_IN_INTERPOLATOR: return new FastOutLinearInInterpolator(); case FAST_OUT_SLOW_IN_INTERPOLATOR: return new FastOutSlowInInterpolator(); case LINEAR_INTERPOLATOR: return new LinearInterpolator(); case LINEAR_OUT_SLOW_IN_INTERPOLATOR: return new LinearOutSlowInInterpolator(); case OVERSHOOT_INTERPOLATOR: return new OvershootInterpolator(); default: return new LinearInterpolator(); } }
From source file:com.savvasdalkitsis.betwixt.Interpolators.java
/** * <strong>ANDROID INTERPOLATOR</strong><br/><br/> * An interpolator where the change starts backward then flings forward and overshoots the * target value and finally goes back to the final value. *///from www . j ava2s.c o m @NonNull public static Interpolator anticipateOvershoot() { return new AnticipateOvershootInterpolator(); }
From source file:pl.mg6.android.maps.extensions.demo.AnimateMarkersActivity.java
private Interpolator randomInterpolator() { int val = random.nextInt(14); switch (val) { case 0:/*from w ww .j av a 2 s.co m*/ return new LinearInterpolator(); case 1: return new AccelerateDecelerateInterpolator(); case 2: return new AccelerateInterpolator(); case 3: return new AccelerateInterpolator(6.0f); case 4: return new DecelerateInterpolator(); case 5: return new DecelerateInterpolator(6.0f); case 6: return new BounceInterpolator(); case 7: return new AnticipateOvershootInterpolator(); case 8: return new AnticipateOvershootInterpolator(6.0f); case 9: return new AnticipateInterpolator(); case 10: return new AnticipateInterpolator(6.0f); case 11: return new OvershootInterpolator(); case 12: return new OvershootInterpolator(6.0f); case 13: return new CycleInterpolator(1.25f); } throw new RuntimeException(); }
From source file:zjut.com.laowuguanli.activity.MainActivity.java
private void initViews() { parentLayout = (LinearLayout) findViewById(R.id.mainLayout); mLinearLayoutL = (LinearLayout) findViewById(R.id.line2); mLinearLayoutQ = (LinearLayout) findViewById(R.id.line1); mLinearLayoutW = (LinearLayout) findViewById(R.id.line3); mLinearLayoutDateTime = (LinearLayout) findViewById(R.id.current_Date_Time); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); imageView = (ImageView) findViewById(R.id.image); navigationView = (NavigationView) findViewById(R.id.navigation); mTextViewTime = (TextView) findViewById(R.id.times); mTextViewDate = (TextView) findViewById(R.id.dates); mTextViewTitleFlag = (TextView) findViewById(R.id.title_flag); mInterpolator = new AnticipateOvershootInterpolator(); fabLaowu = (FloatingActionButton) findViewById(R.id.fab2); fabLaowu.setOnClickListener(new View.OnClickListener() { @Override// w ww .j a v a 2 s .com public void onClick(View v) { showInputPasswordDialog(LaowuActivity.class); //startActivity(new Intent(MainActivity.this,LaowuActivity.class)); } }); fabWeigui = (FloatingActionButton) findViewById(R.id.fab3); fabWeigui.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showInputPasswordDialog(WeiguiActivity.class); } }); fabQianzheng = (FloatingActionButton) findViewById(R.id.fab1); fabQianzheng.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(MainActivity.this, QianzhengActivity.class)); } }); fabDt = (Button) findViewById(R.id.fabDT); fabDt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (isShow) { hideDT(); fabDt.setText(getString(R.string.show_time)); isShow = false; } else { showDT(); isShow = true; fabDt.setText(getString(R.string.hide_time)); } } }); }
From source file:com.cachirulop.moneybox.fragment.MoneyboxFragment.java
/** * Create dynamically an android animation for a coin or a bill droping into * the moneybox./* w w w . j a v a 2 s . com*/ * * @param img * ImageView to receive the animation * @param layout * Layout that paint the image * @param curr * Currency value of the image * @return Set of animations to apply to the image */ private AnimationSet createDropAnimation(ImageView img, View layout, CurrencyValueDef curr) { AnimationSet result; result = new AnimationSet(false); result.setFillAfter(true); // Fade in AlphaAnimation fadeIn; fadeIn = new AlphaAnimation(0.0f, 1.0f); fadeIn.setDuration(300); result.addAnimation(fadeIn); // drop TranslateAnimation drop; int bottom; bottom = Math.abs(layout.getHeight() - img.getLayoutParams().height); drop = new TranslateAnimation(1.0f, 1.0f, 1.0f, bottom); drop.setStartOffset(300); drop.setDuration(1500); if (curr.getType() == CurrencyValueDef.MoneyType.COIN) { drop.setInterpolator(new BounceInterpolator()); } else { // drop.setInterpolator(new DecelerateInterpolator(0.7f)); drop.setInterpolator(new AnticipateOvershootInterpolator()); } result.addAnimation(drop); return result; }
From source file:is.hello.go99.example.AmplitudesFragment.java
private void hideInitialCallToAction() { animatorFor(generateData, getAnimatorContext()).withInterpolator(new AnticipateOvershootInterpolator()) .alpha(0f).scale(0f).addOnAnimationCompleted(new OnAnimationCompleted() { @Override/* ww w . j ava 2 s . c o m*/ public void onAnimationCompleted(boolean finished) { if (finished) { generateData.setVisibility(View.INVISIBLE); generateData.setScaleX(1f); generateData.setScaleY(1f); generateData.setAlpha(1f); } } }).start(); }
From source file:is.hello.go99.example.AmplitudesFragment.java
private void showGenerateData() { animatorFor(generateData, getAnimatorContext()).withInterpolator(new AnticipateOvershootInterpolator()) .addOnAnimationWillStart(new MultiAnimator.WillRunListener() { @Override/*from w w w. ja v a 2 s .com*/ public void onMultiAnimatorWillRun(@NonNull MultiAnimator animator) { generateData.setAlpha(0f); generateData.setScaleX(0f); generateData.setScaleY(0f); generateData.setVisibility(View.VISIBLE); } }).alpha(1f).scale(1f).start(); }
From source file:com.smp.musicspeed.MainActivity.java
private void animateLinkOn() { TranslateAnimation anim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f);/* w ww.jav a2 s . c o m*/ anim.setDuration(TRANS_ANIMATION_TIME); anim.setInterpolator(new AnticipateOvershootInterpolator()); anim.setAnimationListener(new AnimationListenerAdaptor() { @Override public void onAnimationEnd(Animation animation) { rateText.setAlpha(0f); linkOn(); rateText.animate().alpha(1f).setDuration(TRANS_ANIMATION_TIME) .setListener(new AnimatorListenerAdapter() { }); } }); tempoCard.startAnimation(anim); tempoText.animate().alpha(0f).setDuration(TEXT_ANIMATION_TIME).setListener(new AnimatorListenerAdapter() { }); }
From source file:com.smp.musicspeed.MainActivity.java
private void animateLinkOff() { linkOff();/*from ww w . j a v a 2 s . c om*/ tempoCard.setVisibility(View.INVISIBLE); TranslateAnimation anim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f); anim.setDuration(TRANS_ANIMATION_TIME); anim.setInterpolator(new AnticipateOvershootInterpolator()); anim.setAnimationListener(new AnimationListenerAdaptor() { @Override public void onAnimationEnd(Animation animation) { tempoText.setAlpha(0f); linkOff(); tempoText.animate().alpha(1f).setDuration(TEXT_ANIMATION_TIME) .setListener(new AnimatorListenerAdapter() { }); } }); rateCard.startAnimation(anim); rateText.animate().alpha(0f).setDuration(TRANS_ANIMATION_TIME).setListener(new AnimatorListenerAdapter() { }); }