Commits demonstrating best practices for android development, written in Kotlin
- Kotlin
- Coroutines - perform background operations
- Jetpack
- Navigation - in-app navigation
- LiveData - notify views about database change
- Lifecycle - perform an action when lifecycle state changes
- ViewModel - store and manage UI-related data in a lifecycle conscious way
- Retrofit - networking
- Dagger 2 for Android
- Custom view - creating custom bar graph, plotting commits count for each month
RepoListFragment - Renders list of repositories. DetailsFragment - Render list of commits and a custom bar graph view representing number of commits made in each respective months.
Modularized code providing benefits of better separation of concerns. Demonstrating recommended app architecture with structuring into separate modules, that can be grouped as activity/fragment
, view models
, repositories
, data source
, and dependecies
.
AppComponent
- application level dependencies component.
AppModule
- application level provider factory for Retrofit client
, ApiServices
, and View provider factory
.
ActivityBuilderModule
and FragmentBuilderModule
- subcomponent injector for activity and fragments.
ViewModelKey
- annotation type helping in multibinding for view provider factory.
View (Activity / Fragment) - render data to the screen and passing user interaction data and having one-way interaction with view models.
View models - dispatching state changes via LiveData
and handling user interactions.
Data binding - bind UI component in XML to data source, reducing boiler plate.
Navigation - handling navigation.
Repository - independent of other layer handling data operations. Model - defining core structure of the data used within the application.
ApiService - retrofit
defines API endpoints interacting with the external repositories