List of usage examples for android.support.v4.view.animation FastOutLinearInInterpolator FastOutLinearInInterpolator
public FastOutLinearInInterpolator()
From source file:io.github.prefanatic.cleantap.util.AnimUtils.java
public static void hideChildren(ViewGroup group) { FastOutLinearInInterpolator interpolator = new FastOutLinearInInterpolator(); for (int i = 0; i < group.getChildCount(); i++) { View view = group.getChildAt(i); view.animate().alpha(0f).translationY(view.getHeight() / 3).setStartDelay(0L).setDuration(100L) .setInterpolator(interpolator).start(); }//from w ww. j av a 2 s . c o m }
From source file:com.bachhuberdesign.deckbuildergwent.util.AnimUtils.java
@NonNull public static Interpolator getFastOutLinearInInterpolator() { if (fastOutLinearIn == null) { fastOutLinearIn = new FastOutLinearInInterpolator(); }/* w w w . j a v a 2 s . c o m*/ return fastOutLinearIn; }
From source file:io.github.prefanatic.cleantap.util.AnimUtils.java
public static void showChildren(ViewGroup group) { FastOutLinearInInterpolator interpolator = new FastOutLinearInInterpolator(); for (int i = 0; i < group.getChildCount(); i++) { View view = group.getChildAt(i); view.setTranslationY(view.getHeight() / 3); view.setAlpha(0f);/*from w ww. j a v a2s .c o m*/ view.animate().alpha(1f).translationY(0f).setStartDelay(0L).setDuration(150L) //.setInterpolator(interpolator) .start(); } }
From source file:android.support.graphics.drawable.AnimationUtilsCompat.java
/** * Loads an {@link Interpolator} object from a resource * * @param context Application context used to access resources * @param id The resource id of the animation to load * @return The animation object reference by the specified id *//*from ww w . ja v a 2 s. c om*/ public static Interpolator loadInterpolator(Context context, int id) throws NotFoundException { // From API 21, we added path Interpolator . if (Build.VERSION.SDK_INT >= 21) { return AnimationUtils.loadInterpolator(context, id); } XmlResourceParser parser = null; try { // Special treatment for the interpolator introduced at API 21. if (id == AndroidResources.FAST_OUT_LINEAR_IN) { return new FastOutLinearInInterpolator(); } else if (id == AndroidResources.FAST_OUT_SLOW_IN) { return new FastOutSlowInInterpolator(); } else if (id == AndroidResources.LINEAR_OUT_SLOW_IN) { return new LinearOutSlowInInterpolator(); } parser = context.getResources().getAnimation(id); return createInterpolatorFromXml(context, context.getResources(), context.getTheme(), parser); } catch (XmlPullParserException ex) { NotFoundException rnf = new NotFoundException( "Can't load animation resource ID #0x" + Integer.toHexString(id)); rnf.initCause(ex); throw rnf; } catch (IOException ex) { NotFoundException rnf = new NotFoundException( "Can't load animation resource ID #0x" + Integer.toHexString(id)); rnf.initCause(ex); throw rnf; } finally { if (parser != null) parser.close(); } }
From source file:com.bobomee.android.navigator.expandable.Utils.java
/** * Creates interpolator./*from w ww . j a v a2s . c om*/ * @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.yoloo.android.util.AnimUtils.java
public static Interpolator getFastOutLinearInInterpolator() { if (fastOutLinearIn == null) { fastOutLinearIn = new FastOutLinearInInterpolator(); }//from ww w.j a va2 s.c om return fastOutLinearIn; }
From source file:com.devbrackets.android.exomedia.ui.animation.TopViewHideShowAnimation.java
public TopViewHideShowAnimation(View view, boolean toVisible, long duration) { super(false); this.toVisible = toVisible; this.animationView = view; //Creates the Alpha animation for the transition float startAlpha = toVisible ? 0 : 1; float endAlpha = toVisible ? 1 : 0; AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha); alphaAnimation.setDuration(duration); //Creates the Translate animation for the transition int startY = toVisible ? -view.getHeight() : 0; int endY = toVisible ? 0 : -view.getHeight(); TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, startY, endY); translateAnimation//from w w w.jav a 2 s. c o m .setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator()); translateAnimation.setDuration(duration); //Adds the animations to the set addAnimation(alphaAnimation); addAnimation(translateAnimation); setAnimationListener(new Listener()); }
From source file:com.devbrackets.android.exomedia.ui.animation.BottomViewHideShowAnimation.java
public BottomViewHideShowAnimation(View view, boolean toVisible, long duration) { super(false); this.toVisible = toVisible; this.animationView = view; //Creates the Alpha animation for the transition float startAlpha = toVisible ? 0 : 1; float endAlpha = toVisible ? 1 : 0; AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha); alphaAnimation.setDuration(duration); //Creates the Translate animation for the transition int startY = toVisible ? getHideShowDelta(view) : 0; int endY = toVisible ? 0 : getHideShowDelta(view); TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, startY, endY); translateAnimation//from w w w . j a va2 s . c o m .setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator()); translateAnimation.setDuration(duration); //Adds the animations to the set addAnimation(alphaAnimation); addAnimation(translateAnimation); setAnimationListener(new Listener()); }
From source file:org.ayo.robot.anim.transitioneverywhere.ScaleSample.java
@Nullable @Override/*from w ww . j a va 2 s .com*/ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_scale, container, false); final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container); final TextView text1 = (TextView) transitionsContainer.findViewById(R.id.text1); transitionsContainer.findViewById(R.id.button1).setOnClickListener(new VisibleToggleClickListener() { @Override protected void changeVisibility(boolean visible) { TransitionManager.beginDelayedTransition(transitionsContainer, new Scale()); text1.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } }); final TextView text2 = (TextView) transitionsContainer.findViewById(R.id.text2); transitionsContainer.findViewById(R.id.button2).setOnClickListener(new VisibleToggleClickListener() { @Override protected void changeVisibility(boolean visible) { TransitionSet set = new TransitionSet().addTransition(new Scale(0.7f)).addTransition(new Fade()) .setInterpolator( visible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator()); TransitionManager.beginDelayedTransition(transitionsContainer, set); text2.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } }); return view; }
From source file:com.erevacation.challenge.rxjavaanimator.ViewAnimatorCreator.java
private static ViewPropertyAnimator animateScaleDown(View view, int duration, int delay, TimeInterpolator interpolator) { view.setScaleX(1);// w w w .j a va2 s .com view.setScaleY(1); ViewPropertyAnimator propertyAnimator = view.animate().scaleX(0).scaleY(0).setStartDelay(delay) .setDuration(duration); if (interpolator != null) { propertyAnimator.setInterpolator(interpolator); } else { propertyAnimator.setInterpolator(new FastOutLinearInInterpolator()); } return propertyAnimator; }