LinX64 / AppsFact

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  • 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 Fragments with a single Activity. It uses one base Fragment to avoid the repetition onCreateView() and onViewCreated() methods for Fragments, 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.

About

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


Languages

Language:Kotlin 100.0%