-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make parameter payloads @Nullable in onBindViewHolder method in AdapterDelegate and AbsListItemAdapterDelegate classes. #30
Comments
Actually there is a little bit strange code in
here payloads have |
Thanks for reporting! However, I'm not sure where the real issue comes from. This libary internally always uses a empty list and not null. So I assume that RecyclerView itself is passing
I'm not sure whether or not this is a bug in RecyclerView library or a documentation issue or a DiffUtils issue. I have added a check that ensure that always an empty list instead of null will be passed to the I have published a SNAPSHOT containing this fix. Please verify that the latest snapshot |
Thanks! seems to work now |
I just have released in 3.0.1 containing this fix. |
there is a method
protected abstract void onBindViewHolder(@NonNull T items, int position, @NonNull RecyclerView.ViewHolder holder, @NonNull List<Object> payloads);
inAdapterDelegate
class. But the actual value ofpayloads
parameter isnull
quite often, here is an example callstack f(I'm usingAbsListItemAdapterDelegate
here):the problem is very severe with Kotlin: when I override this method I have to use non-null syntax for payloads:
override fun onBindViewHolder(item: T, viewHolder: RecyclerView.ViewHolder, payloads: MutableList<Any>)
so I getjava.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter payloads
at runtimeCurrently I have to use a pretty ugly workaround but it's very frustrating
The text was updated successfully, but these errors were encountered: