I'm developing an attendance manager app. To take attendance , I've to create layout like this
I want to make it programatically. In the below layout I've used to add FAB using xml.
You can use a RecyclerView with a GridLayoutManager to achieve that programatically, here some example:
http://abhiandroid.com/materialdesign/recyclerview
https://inducesmile.com/android/android-gridlayoutmanager-with-recyclerview-in-material-design/
Hope this helps.