How to set RecyclerView layoutManager from XML?
And I came here looking for androidx version though it was pretty easy to figure out, here it is
LinearLayoutManager:
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
Example:
GridLayoutManager:
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
Example:
As you can see in examples above you can control the orientation from within xml using
android:orientation="vertical"
and
android:orientation="horizontal"
And to set the number of columns for GridLayoutManager using
app:spanCount="2"