Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an alternative for using com.nineoldandroids library

I want to replace the dependency of com.nineoldandroids library from my project and replace it with an android native library.

I am trying to make a project based on this http://www.tutecentral.com/android-swipe-listview/ . However, I don't need to have support for android versions less than v11. Therefore there is no need to use this library. But I cannot find what to use in its place, while not making changes to the code itself.

The project import the classes

import com.nineoldandroids.animation.Animator;
import com.nineoldandroids.animation.AnimatorListenerAdapter;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.ViewHelper;
import static com.nineoldandroids.view.ViewHelper.setAlpha;
import static com.nineoldandroids.view.ViewHelper.setTranslationX;
import static com.nineoldandroids.view.ViewPropertyAnimator.animate;

Thank you.

like image 682
Roola Avatar asked Apr 06 '16 10:04

Roola


1 Answers

I had the same issue, wanted to get rid of nineoldandroids library.

As per @Selvin comment this is what you need to do:

1.) Remove all Imports
2.) Animation and ValueAnimator are available as part of the android.animation package
3.) ViewHelper doesn't really do anything that is not already available as part of each view's method.

For example:

ViewHelper.setScaleX -> view.setScaleX
ViewHelper.setY -> view.setY
ViewHelper.setAlpha -> view.setAlpha

Hope it helps.

like image 153
Lancelot Avatar answered Sep 30 '22 21:09

Lancelot