The gradle plugin used in this project required Java 11
for it to be compiled. If you currently don't have Java 11
installed on your machine
(assuming you're using a linux distro) you can:
sudo apt-get update
sudo apt-get install openjdk-11-jdk
Additionally, make sure you have the latest android gradle plugin installed.
If you are running this app on an emulator, make sure you use the emulator
that is api 26
and up, as this is the minimum required sdk version.
Otherwise, if you're running this on a physical device, then the version
of your OS should at least be 8.0
known as Oreo
To launch this project, clone/download this repository to your machine and open it from Android Studio
.
When gradle
finishes indexing, SHIFT + F10
to launch it.
Add Button - click to create a new employee (ADD operation)
Delete Button - click to delete an employee (REMOVE operation)
Give Raise Button - click to give an employee a raise (UPDATE operation)
GET operation is implemented implicitly and used for displaying all employees on the screen
Project is made from standalone android modules, as shown below:
.
-> app
-> buildSrc
-> domain
-> features
-> base
-> roster
where:
app
module contains thelaunch options
component as well assplash
activitybuildSrc
module contains the project and build configuration logic.domain
module contains the database with its DAOs and business logicfeatures
subdirectory contains all the standalone feature modules. Currently it containsbase
which contains all base android components for feature development, as well asroster
which is the feature visible on the screen after app launch
This project leverages two linting tools:
In favor of convenience, ./linters/
directory contains a stylecheck.sh
script, which run both
ktlint
and detekt
and fails early if any issues arise, otherwise completes successfully. To run it, open the
terminal in ./linters/
directory and run:
chmod +x stylecheck.sh
./stylecheck.sh
Project is built with clean architecture in mind, using mvi pattern (great link, another great link) as the underlying design pattern: The chart below represents the architecture in more detail:
*keep in mind that this project does not contain an Api Client which does appear on the diagram below
The data flow from database access until ui rendering is done via below model conversion:
Employee > EmployeeModel > EmployeeData > ViewState
- Room for local storage
- Navigation component for feature navigation
- ReactiveX for obvious reasons
- Junit5 for testing
- Mockk for mocking
- Koin for dependency injection
- MotionLayout for fluid layout animations