This is a template codebase in both Kotlin Traditional View implementation and Compose (WIP)
Initial structure is made up of nested navigation graphs, 3 initial bottom navigation bar tabs, a basic initial Dependency Injection structure via Hilt and further examples of the Jetpack libraries that are included.
Home tab includes a Data-bound Recyclerview (RecyclerView
) of SpaceX launches using the SpaceX API v5.
extra
folder includes all utilities and extensions, as well as convenience classes and bindings / binding adapters.- The UI layer
HomeViewModel
andHomeFragment
make use of, and observeStateFlow
andLiveData
for management of the UI states and adapter management.- Data-bound list: Implementation favors data-bound RecyclerView which is built with data bindings (and Advanced Data Binding concept
BR.item
) that are setup by the layout (see below attachment) andHomeViewModel
, marked by config comment.stocks
LiveData contains the item list, which can also be a sealed type that enables expanding with different types of UI containers within layout provider ofViewModel
for different item types. The actual bindings' implementations all reside underextra/recyclerview
- DiffUtil is also utilized under the listview, which by default enables item change animations, crossfade and even item swap animations.
Build system uses Gradle and build scripts are written in Gradle Kotlin DSL
For building or installing, use the gradlew build
and gradlew install
after importing and synchronizing the project.
Right click the test (unit test) folder under xxx
to run all the unit tests inside TestHilt
.
or
use command ./gradlew testDebugUnitTest --tests "net.sdfgsdfg.domain.TestHilt"
- AppCompat - Degrade gracefully on older versions of Android.
- Android KTX - Write more concise, idiomatic Kotlin code.
- Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
- Data Binding - Declaratively bind observable data to UI elements.
- Lifecycles - Create a UI that automatically responds to lifecycle events.
- LiveData - Build data objects that notify views when the underlying database changes.
- Navigation - Handle everything needed for in-app navigation.
- ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
- UI - Details on why and how to use UI Components in your apps - together or separate
- Fragment - A basic unit of composable UI.
- Hilt: for dependency injection
- Kotlin Coroutines for managing background threads with simplified code and reducing needs for callbacks
- Moshi for parsing the data layer POJOs
Kaan Osmanagaoglu