What is an alternative for using com.nineoldandroids library
Asked Answered
S

1

6

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.

Spite answered 6/4, 2016 at 10:1 Comment(3)
obviously the classes (first 3) and methods (make own helper or "translate" it like: ViewHelper.setAlpha(view, alpha) => view.setAlpha(alpha)) from android frameworkProtract
Thank you @Protract this solved the ViewHelper issue as for the animation I replaced com.nineoldandroids.animation with android.animation and it worked.Spite
@Protract please make it an answer so I can accept it.Spite
M
11

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.

Mooch answered 10/2, 2017 at 13:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.