android - Using AnimationFactory.Java outToLeftAnimation -
i using method creator of animationfactory.java. can not figure out how implement 2 of these methods.
i slide out 1 fragment , slide in one.
here method trying use:
* slide animations hide view sliding left. * * @param duration animation duration in milliseconds * @param interpolator interpolator use (pass {@code null} use {@link accelerateinterpolator} interpolator) * @return slide transition animation */ public static animation outtoleftanimation(long duration, interpolator interpolator) { animation outtoleft = new translateanimation( animation.relative_to_parent, 0.0f, animation.relative_to_parent, -1.0f, animation.relative_to_parent, 0.0f, animation.relative_to_parent, 0.0f ); outtoleft.setduration(duration); outtoleft.setinterpolator(interpolator==null?new accelerateinterpolator():interpolator); return outtoleft; } * slide animations enter view right. * * @param duration animation duration in milliseconds * @param interpolator interpolator use (pass {@code null} use {@link accelerateinterpolator} interpolator) * @return slide transition animation */ public static animation infromrightanimation(long duration, interpolator interpolator) { animation infromright = new translateanimation( animation.relative_to_parent, +1.0f, animation.relative_to_parent, 0.0f, animation.relative_to_parent, 0.0f, animation.relative_to_parent, 0.0f ); infromright.setduration(duration); infromright.setinterpolator(interpolator==null?new accelerateinterpolator():interpolator); return infromright; }
anyone know how use these methods?
thanks.
Comments
Post a Comment