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

doJazzinessImpl NPE #37

Open
sbaar opened this issue Apr 1, 2015 · 4 comments
Open

doJazzinessImpl NPE #37

sbaar opened this issue Apr 1, 2015 · 4 comments

Comments

@sbaar
Copy link

sbaar commented Apr 1, 2015

On 1.21 using recycler view
at com.twotoasters.jazzylistview.JazzyHelper.doJazzinessImpl(JazzyHelper.java:197)
at com.twotoasters.jazzylistview.JazzyHelper.doJazziness(JazzyHelper.java:189)
at com.twotoasters.jazzylistview.JazzyHelper.onScrolled(JazzyHelper.java:115)
at com.twotoasters.jazzylistview.recyclerview.JazzyRecyclerViewScrollListener.onScrolled(JazzyRecyclerViewScrollListener.java:24)
at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:2872)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

particularly
private void doJazzinessImpl(View item, int position, int scrollDirection) {
ViewPropertyAnimator animator = item.animate().setDuration(600L).setInterpolator(new AccelerateDecelerateInterpolator());
scrollDirection = scrollDirection > 0?1:-1;
this.mTransitionEffect.initView(item, position, scrollDirection);
this.mTransitionEffect.setupAnimation(item, position, scrollDirection, animator);
animator.start();
}

item is null. This happens pretty rarely. Basically what happens is I'm selecting a list of users on the left side of a sliding pane layout and clearing then adding to then notifyingdataSetChanged on a jazzylistview on the right side of the sliding pane layout. It may have something to do with there being two different view types in my listview, but I'm not sure. It seems like sometimes in onScrolled

        for(i = 0; firstVisibleItem + i < this.mFirstVisibleItem; ++i) {
            View indexBeforeLast = viewGroup.getChildAt(i);
            this.doJazziness(indexBeforeLast, firstVisibleItem + i, -1);
        }

indexBeforeLast is returning null.

Unless there is something wrong with the arithmetic to iterate through visible views my instinct is just to abort in doJazzinessImpl if item is null

@sbaar
Copy link
Author

sbaar commented Apr 2, 2015

I haven't been able to make a project specifically for this bug but after forking and putting in an npe catch with logging, it seems to iterate over position 3-9 when there are only 3 items currently. It seems to happen a lot more frequently when switching between lists with 1 view type to a list with 2 view types.

@j3susalonso
Copy link

Im getting exactly the same exception. Any news on this yet?

@sbaar
Copy link
Author

sbaar commented Jul 15, 2015

Nope. Just had to copy the project and put in a try catch
On Jul 15, 2015 10:09 AM, "Jesus Alonso Garcia" notifications@github.com
wrote:

Im getting exactly the same exception. Any news on this yet?


Reply to this email directly or view it on GitHub
#37 (comment)
.

@j3susalonso
Copy link

Ok thx! I'll do that then.

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