- Banners screen: Lets you load image urls. Height of the container is adjusted as per the image height. Width matches device screen width.
- Dashboard screen: Lets you add multiple sections to your dashboard ex. Banner, List, Grid. UI items placed as per the sequence of your data items. Span count can be assigned to grid item.
- The app lets you add sections of different item types to your view on the fly.
- cd ~/ProjectLocation/WeatherApp
- git clone [email protected]:santimendon/dynamic-dashboard.git
- Build and run the app
- Open BannersFragment.kt
- Change url ex. val url = "https://picsum.photos/2000/1000"
- You can refer Lorem Picsum for static images
- In the above static url, first parameter is the width and the second is the height ex. w-2000, h-1000
- Images for certain values might not be available in lorem picsum. Feel free to use your own url
- Build and run the app
- Open file app/src/main/assets/remotedata.json
- Add/modify the objects of type banner/list/grid (Observe json)
- Note: Ensure to assign a unique id to every item. Ex. List (1,2,3) Grid (4,5,6,7), Banner (8,9)
- UI will be populated as per the sequence of item types
- To set span count to your grid, set the value against key 'span'.
- Build and run the app
Known issue: In case of grid items, span of the last grid object gets assigned to the previous grid items in the recycler view.