some guides say recyclerview. some say gridview. some say recyclerview with grid adapter...
i have no idea what these methods have in differences as i'm still new to android development. i've tried them all but somehow always ended up messing things up. can someone explain a simple way please? (very preferably in kotlin) i know how to make an item but mostly struggle with the adapter (specially considering most guides for it are written in java and i can barely even read Kotlin). i've been trying to do it for a week so i would be really grateful.
You will want to use a regular
RecyclerViewand anyRecyclerView.Adapterwill work. The key is theLayoutManageryou give to theRecyclerView. If you give it aGridLayoutManagerit will ask how many items per row, its actually fairly simple.Here is a modified excerpt from the article below.
Here is a pretty in-depth article showing you how to do it. The article also has a simple implementation of an
Adapteras-well. https://abhiandroid.com/materialdesign/recyclerview-gridview.htmlA fair warning though the article uses some outdated libraries you should be using
androidxfor nearly everything. Luckily the implementation is not different.