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
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 existing layoutManager...
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: