• Stars
    star
    267
  • Rank 153,621 (Top 4 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kotlin demo project that uses some Android Architecture Components (ViewModel and LiveData) with Dagger 2 and Coroutines

Android Architecture Components Demo

This is a Kotlin project that uses some Android Architecture Components (ViewModel and LiveData) with Dagger 2 and RxJava.

This project is a fork of official GithubBrowserSample, I converted it to kotlin and modified some architectural aspects to test ViewModel and LiveData features.

Main concepts

  • each ViewModel manages an immutable ViewState (implemented using a Kotlin data object)
  • a post will be available soon to explain the details of how the ViewModels and the UseCases manage the ViewStates
  • multi module project, thanks to Dagger Android the ui is splitted in multiple modules
  • Fragment args are managed using a companion object base class
  • JVM tests are written using Mockito and AssertK
  • Espresso tests are written using DaggerMock and Mockito
  • ViewModels are instantiated using a custom factory defined in Dagger application scope and replaced with a stub in Espresso tests
  • asynchronous tasks are managed using Coroutines (the rxjava branch contains the same example with RxJava singles instead of coroutines)

More Repositories

1

DaggerMock

A JUnit rule to easily override Dagger 2 objects
Java
1,160
star
2

mv2m

Android MVVM lightweight library based on Android Data Binding
Java
182
star
3

CleanWeather

Demo project for SOLID principles in practice: the Clean Architecture
Kotlin
68
star
4

Inversion

Retrieve easily all the implementations of an interface
Kotlin
47
star
5

TestableAndroidApps

TestableAndroidApps
Java
46
star
6

LifeCycleBinder

Move your Android code to testable Java classes
Java
45
star
7

TestingRxJavaUsingMockito

Demo project for the post Testing asynchronous RxJava code using Mockito
Java
45
star
8

RxJavaVsCoroutines

Kotlin
25
star
9

ViewStateStore

Kotlin
22
star
10

CoroutinesDemo

Demo project for the blog post Async code using Kotlin Coroutines
Kotlin
21
star
11

TestingDaggerRxJava

Demo project for Testing Android apps based on Dagger and RxJava
Kotlin
19
star
12

DataBindingInAction

Demo project for Android Data Binding in Action using MVVM pattern
Java
16
star
13

TestableAndroidAppsDroidCon15

Droidcon Italy 2015 example
Java
16
star
14

ComposeStatesDemo

Demo project for https://proandroiddev.com/viewmodels-using-compose-mutablestateflows-or-mutablestates-64d34ba548c5
Kotlin
14
star
15

IntroToRetrofitRxJava

Introduction to Retrofit and RxJava
Java
13
star
16

KotlinCodelab

Codelab to convert a Java Android app to Kotlin
Java
10
star
17

DaggerToManualInjection

7
star
18

TwoWayDataBinding

Java
7
star
19

DaggerDependencies

Demo project to show how to manage dependencies using Dagger
Kotlin
6
star
20

AndroidWearCodeLab

Java
3
star
21

vagrant

Automated development environment creation on Xubuntu 14.04 with Vagrant
Ruby
3
star
22

ComposeDemo

Kotlin
2
star
23

IntroToRetrofit2RxJava2

Introduction to Retrofit 2 and RxJava 2
2
star
24

ialfvg

Java
1
star
25

whymca2011

Demo talk whymca 2011
Java
1
star