The purpose of this application is to show the top 100 ranked albums in US according to RSS Feed Generator
App will show a two column grid with the top 100 ranked albums in the US. Each item will contain album's and artist's name. If they are tapped, a new Detail screen will appear showing previous information along with genre, release date, copyright and an "Open iTunes" button. This button will open device's browse and navigate iTunes web page.
- When opening the app, it will retrieve album list internally saved.
- If there are no albums saved, they will be fetched performaning a network call.
- If there are albums, they will be shown and then, will be updated via network connection.
- If app has no elements to show (internal DB is empty and network call failed), a network error connection screen will be shown.
- Besides that, if saved elements are shown and network connection failed, a
Toastmessage will be shown to the user. - When selecting an element of the grid, a new screen will be opened and more information will be displayed.
- On this Detail Screen, there's an "Open iTunes" button, which will redirect to browser and navigate to that album's iTunes web page.
Project is organized taking care of Clean Architecture organization through Presentation, Domain and Data layers:
- Presentation: This layer will respect MVI pattern, where each screen has an
Intentand aState. In Home screen,StateFlowwas implemented with the purpose that screen reacts when data inside ViewModel changes. The only purpose ofSharedFlowis to show theToasterror message. Shimmer effect was implemented using an external library (Shimmer for Jetpack Compose & Compose Multiplatform) - Domain: The only purpose of this layer is to map network and DB models to
AlbumandGenreones, thus, they are consumed by the screen. - Data: This layer is divided in
LocalandRemote. InsideRemoteDataSource, app will use aRetrofitinstance to fetch album list. On the other hand, after retrieving that list, insideLocalDataSource, aRealmDB is implemented and will save internally every album that theRemoteDataSourcehas fetched. Theidthat was obtained through the API is the one that will be used as a primary key. If the element, already exists, it will be replaced.
As a general consideration, Hilt was implemented as a dependency injection to facilitate the features implementation.
