Search code examples
androidandroid-linearlayoutfloating-action-button

How to add floating action button one by one in Linearlayout


I'm developing an attendance manager app. To take attendance , I've to create layout like this

enter image description here

I want to make it programatically. In the below layout I've used to add FAB using xml.


Solution

  • 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.