You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with LayoutHandlerAdapter. I want to use it in my project, when LastAdapter with Layout is loader I've got KotlinNullPointerException. Here is my code: LastAdapter(viewModel.conversation, BR.item).layout { item, _ -> when(item) { is ContactItem -> { if (item.isCustomer) { R.layout.item_client } else { R.layout.item_service } } else -> R.layout.item_service } }.into(claimContactRv)
When I use normal LastAdapter (without LayoutHandling) everything works well.
I also run example project and get the same error. I paste it below.
kotlin.KotlinNullPointerException at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:109) at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:27) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6508) at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:125) at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:27) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1558) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3436) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3988) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1197) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1769) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1197) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:443) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606)
The text was updated successfully, but these errors were encountered:
There is a problem with LayoutHandlerAdapter. I want to use it in my project, when LastAdapter with Layout is loader I've got KotlinNullPointerException. Here is my code:
LastAdapter(viewModel.conversation, BR.item).layout { item, _ -> when(item) { is ContactItem -> { if (item.isCustomer) { R.layout.item_client } else { R.layout.item_service } } else -> R.layout.item_service } }.into(claimContactRv)
When I use normal LastAdapter (without LayoutHandling) everything works well.
I also run example project and get the same error. I paste it below.
kotlin.KotlinNullPointerException at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:109) at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:27) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6508) at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:125) at com.github.nitrico.lastadapter.LastAdapter.onBindViewHolder(LastAdapter.kt:27) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1558) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3436) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3988) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1197) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1769) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1197) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:443) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606)
The text was updated successfully, but these errors were encountered: