Open dimsuz opened 4 years ago
Sorry about the "delay". You're right. I will look into it soon. There might be some historic reasons for which the API is not symmetric but it doesn't need to be that way.
Addressed in #36 . I still have to publish a new version including that part.
When I started experimenting with this library I initially went with
Recycler.create()
which also created a layout manager for me. Then I decided that I don't want to manually call.addView()
to put RV into my parent layout, so I placed RV in xml and called.adopt(findViewById())
. Suddenly it crashed, because.adopt()
doesn't create a layout manager, and RV throws an exception.This feels a bit asymmetric and not intuitive. Would it be possible to add a
layoutProvider
argument to.adopt
? I guess it could default to RV existinglayoutManager
...My point is that it shouldn't matter if I created RV programmatically or inflated it from xml it should behave the same. Most other View work this way, e.g. FrameLayout doesn't apply some additional styling or whatever based on if I'm inflating or creating it from code.