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:
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 code
- Avoid Magic Strings*
- Centralized dependencies*
- Better dependency management (have an issue with library versions - WIP)
*Both could be done in Groove too, but in kotlin is easier with auto-complete and look better.
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