Playground / demo app for using Kotlinova architecture. It is simple app that loads data from https://dummyjson.com. Features include:
- 100% Compose (single activity)
- Deep links to every screen
- Configuration change and process deaths handling
- Dark mode support
- Material You support
- Improved support for large screens (two-pane layout for user and post list)
- Offline support (data is saved to database and can be browsed offline)
- Pagination
- List of all reusable Compose components in-app (via Showkase)
- Unit tests for UI and all logic code
- Integration tests that test the whole app, optimized with R8
- Easy to use screenshot tests
- Macrobenchmark
See also other branches:
empty_kotlinova_project
= Empty template project with most of the kotlinova architecture set up
- Install Git LFS
- Checkout the repo
- Run
git lfs fetch
in the repo
Process for updating all library versions::
- Update Gradle version
- Find latest version and the checksum for -all version from https://gradle.org/release-checksums/ (We use SHA to secure against wrapper attack, see https://blog.gradle.org/wrapper-attack-report)
- Run
./gradlew wrapper --gradle-version VERSION --gradle-distribution-sha256-sum SHA
, where you substituteVERSION
andSHA
with the info found in the previous step.
- Open
libs.toml
file and check if any versions marked with@pin
have been unblocked and can now be updated - Run
./gradlew versionCatalogUpdate
. - Sync the project, build the app and run all tests to make sure everything still works.
- Run
detektDebug
gradle task to find any new deprecated code - For any new deprecated code found by the search:
- If the fix is trivial, fix it immediately as part of the update commit
- Otherwise, make a tech debt ticket and add a @Suppress with the ticket number (and/or discuss with the team how to address it)
To easily add new modules, first enable project templates (you only need to do this once). Open Android Studio's Settings, go to "File and Code Templates" and set Scheme to "Project".
Then, to create a new module:
- Right click on the root in the project window, select New and then the project type you want
- Add module to
settings.gradle.kts
- Add module to app's
build.gradle.kts
asimplementation(projects.newModule)
) - Remove leading space from all generated
.gitignore
files (workaround for the https://youtrack.jetbrains.com/issue/IJPL-2568)
Every feature should contain following modules:
feature-name
data
- data module with all non-UI logic (such as repositories). No otherdata
orui
module should depend on this (except for tests).api
- interfaces and data models exposed to other modules. This module should generally contain no logic to speed up builds.ui
- Module containing feature's ui (Screens / Fragments / ViewModels). No otherdata
orui
module should depend on this (except for tests).test
(optional) - Module containing test helpers for faking stuff exposed in theapi
module
./gradlew :app:connectedAndroidTest -PtestAppWithProguard
To create screenshot tests for your compose screen:
- Make preview functions public
- Add
showkase
plugin to the module of the screen you want to test - Add
@ShowkaseComposable(group = "Test")
annotation to the preview of the screen you want to test - run
recordPaparazziDebug
gradle task to record golden screenshot (double check that only previews for your screen were generated)