/ArtViewApp

Basic android example where you can find how to display list of items in a GridLayout

Primary LanguageKotlin

Art View App

Kotlin Android Gradle

Art View app made in Kotlin. This app is a basic android example where you can find how to display list of items in a GridLayout. In this case the app will display a list of art prints from Hardvard Art Museum.

Requirements

  • Android API 24 - 31
  • Gradle 7.2
  • Kotlin 1.6.10

Characteristics

  • MVVM
  • Clean Architecture
  • Dagger Hilt
  • LiveData
  • Coroutines
  • Retrofit

Functionalities

  • Display list of art prints in a grid layout. When scrolling down, new art prints will appear.
    • There is a maximum of 100 items displayed in the grid layout. Which means you can only scroll and get new art prints until you reach the maximum of 100 items => This, of course, can be modified. This setup was for testing purposes only.
    • Art prints displayed come from hardvard art museum's API. In this case request GET /objects is used to get detailed information on the items.
https://api.harvardartmuseums.org/object?classification=Prints&size=20&hasimage=1
  • Click on an art print and be able to see it more in detail.
    • The detail view is a WebView that shows the URL of the art print, which contains all its details. Example url:
https://www.harvardartmuseums.org/collections/object/4952

Notes

To be able to get new art prints when scrolling down, an OnScrollListener is included in the recyclerView. When recyclerView is detected to have reached the bottom, a new GET request is made.

There is a better way to handle this, using Paging library. If you want to check how to implement it, check this repository: Paging3Example

Demo

ArtViewAppDemo.mp4