Open pkleczko opened 6 years ago
Hi @pkleczko. Try changing the last parameter of your inflate
call to true
, so it looks like this:
ViewPatientHealthItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, true);
That way your list item layout will be directly added as a subview of the SwipeItem
that handles the swipe to dismiss feature. Otherwise it's not attached and it will fail to find the corresponding SwipeItem
. See here for more details.
Hi @TR4Android,
I've tried this but still have the same error. I cleaned and rebuilt app and crash is exactly the same.
ViewPatientHealthItemBinding binding = ViewPatientHealthItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, true);
Don't uderstand why, but without data binding it works. Maybe there is sth with root view.
Then it's probably an issue with the data binding library. Unfortunately I don't currently have the time to commit to fixing this issue, so any investigation on this would be greatly appreciated. Thanks for reporting this @pkleczko.
Hi,
In SwipeAdapter there is a cast from holder view to SwipeItem. However, in your example there is no SwipeItem layout as a root of item view. Also wrapping my item layout into SwipeItem doesn't help. Is there sth I forget to add?