This is Canato personal project for portfolio.
If you want to check the project where I mentoring other developer you can see Purity Test - WIP
Here you can find a compilation of some best practices of Android Development across my work experience with big projects.
The project is modularised per feature and use the MVP pattern. You can find more in the talk that I give about it:
Obs: the video and article are now outdated, since we put all modules inside app
module and remove the split data_source
module, since is not need
The long goal is to use Kotlin as MultiPlatform as extract the Business Logic into submodule that can be used from Android, iOS or even Web.
The CI is simple and effective.
- Run on Github Actions.
- KtLint, Tests and Assemble
- Can be checked on
.github/workflows/main-workflow.yml
The App consist in a single activity under the home_list
domain.
We use the Jetpack Navigation Component using the navigation tool to flow between the fragments.
By now we do not use <include-dynamic>
for navigation with feature modules because it does not support deep links, so instead we add implement the module in the gradle.kts
Use the material motion to make nice animations between fragments. Since we are using one single activity with Jetpack Navigation, this animation need a little of work on it, so it can be use from any other place
Usage of View Binding in the place of Kotlin Synthetics to:
- Expose nullability in compilation time
- Better code performance
- Don't expose layout id not need
- Type guaranteed
Decide to use Gradle Kotlin DSL Primer because of:
More Kotlin friendly codeAvoid Magic Strings*Centralized dependencies*Better dependency management
*Both could be done in Groove too, but in kotlin is easier with auto-complete and look better.
The library was giving more headache everytime Android Studio, Gradle or another stuff (like compose) come So, even that gradle.kts is nice, don't look full ready, will keep and eye on it
Convenient task for gradle project that run ktlint checks or do code auto format.
Used to ensure code style, the CI has a ./gradlew ktlintCheck
command and break if the code is not on the right format
Git hooks automatically run scripts when actions occurs on a git repository.
You can find the project hooks under Showcase/hooks/
To use project hooks and not git hooks on the project please run git config core.hooksPath hooks
on your project folder
- pre-push: Run ktlintFormat command, if fails does not allow to push. If success commit if need and push.
Usage of google Including Open Source Notices