Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On rotate device. #9

Open
ikermart opened this issue Jan 6, 2017 · 1 comment
Open

On rotate device. #9

ikermart opened this issue Jan 6, 2017 · 1 comment

Comments

@ikermart
Copy link

ikermart commented Jan 6, 2017

First of all thank you for your good work on this library.
When I add animation, to a content of views like this:
In onCreateView() of my Fragment, using ButterKnife.bind(this, view);

itisfListLayout.setInAnimator(new PropertyIn(View.TRANSLATION_Y, itisfRootLayout.getHeight(), 0).setDuration(500));
 itisfListLayout.setOutAnimator(new PropertyOut(View.TRANSLATION_Y, 0, -itisfRootLayout.getHeight()).setDuration(500));
 itisfListLayout.setLocationType(CannyViewAnimator.IN_ALWAYS_TOP);
 itisfListLayout.setAnimateType(CannyViewAnimator.TOGETHER);
 itisfListLayout.setDisplayedChildIndex(itisfListLayout.getDisplayedChildIndex() + 1);

The animation works well, but when I rotate de device NullPointerException error appears:
Caused by: java.lang.NullPointerException
at com.livetyping.library.CannyViewAnimator.changeVisibility(CannyViewAnimator.java:114)
at com.livetyping.library.ViewAnimator.setDisplayedChildIndex(ViewAnimator.java:37)
at com.livetyping.library.ViewAnimator.onRestoreInstanceState(ViewAnimator.java:170)
at android.view.View.dispatchRestoreInstanceState(View.java:12284)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2620)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)
at android.view.View.restoreHierarchyState(View.java:12262)

Any idea how is this happening?
Thank you.

@princeparadoxes
Copy link
Collaborator

Hi. Thanks for you issue. Please try to use 0.9-beta version:
http://search.maven.org/#artifactdetails%7Ccom.livetyping%7Ccannyviewanimator%7C0.9-beta%7Caar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants