An open API service indexing awesome lists of open source software.

https://github.com/linx64/appsfact

An example of Music management app with Clean Architecture, Using Single Activity, Stateflow, Flow, Sealed interface & Sealed Class, BaseFragment, BaseListAdapter, and MVVM.
https://github.com/linx64/appsfact

android baseviewmodel clean-architecture coroutines-android inline-function kotlin-android mvvm room-persistence-library sealed-class sealed-interface stateflow

Last synced: 3 months ago
JSON representation

An example of Music management app with Clean Architecture, Using Single Activity, Stateflow, Flow, Sealed interface & Sealed Class, BaseFragment, BaseListAdapter, and MVVM.

Awesome Lists containing this project

README

        

# AppsFact - Music management

### Tech stacks

- Kotlin
- MVVM
- Clean Architecture
- Use-cases
- Hilt (Dependency Injection)
- Room (Persistence library)
- Retrofit
- Navigation
- Automated tests (Espresso)
- Unit Tests (Junit4)

### Layers (Clean Architecture)

This project uses Clean Architecture with three different layers as recommended
by [Google](https://developer.android.com/topic/architecture?gclid=Cj0KCQjwnP-ZBhDiARIsAH3FSRcqhwDHkL89guXx0hxFBQPoMx0rabJWKBWiMJi-Fc9hJf5i4vwx6JwaAi_iEALw_wcB&gclsrc=aw.ds#recommended-app-arch):

- Data (data layer: exposing application data)
- Domain (containing use-cases and business logic)
- UI (displaying data to user)

### Solution

The project consists of 4 different `Fragment`s with a single `Activity`. It uses one
base `Fragment` to avoid the repetition `onCreateView()` and `onViewCreated()` methods for `Fragment`s, as well as a `BaseAdapter` for Adapters.

1. The mainScreen (`Fragment`) - loads saved albums from Database.
2. AlbumInfo `Fragment` which accepts `id`, `albumName` and `artistName` as arguments and then makes
the call to the server to get the specific album detail.
3. Search Artist - where it searches for artists based on a name.
4. Top albums - when user clicks on an album, the apps navigates to top albums to show the top
albums of that specific artist.

**Navigation:**



**Screens and UI:**




### Unit Tests

Unit tests are written for the `Repository`. For the `Repository` tests they are written
using `Mock` and `JUnit4`.

### Instrumentation Tests

Instrumentation tests are written for the `Activity` and `Fragment`. For the `Fragment` tests they
are written using `Espresso` and `JUnit4`.

### TODO

- Add more tests for the `ViewModel` and `Repository`.
- Add/Improve Unit tests.
- Handle errors within the albums.