diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3661eaf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,39 @@ +dist: trusty +language: android + +jdk: + - openjdk8 + +android: + components: + - tools + - platform-tools + - build-tools-28.0.3 + - android-28 + - android-21 + - extra-google-google_play_services + - extra-google-m2repository + - extra-android-m2repository + - sys-img-armeabi-v7a-android-21 + +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ + +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + - $HOME/.android/build-cache + +before_script: + - "echo $JAVA_OPTS" + - "export JAVA_OPTS=-Xmx1536m" + - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a -c 100M + - emulator -avd test -no-audio -no-window & + - android-wait-for-emulator + - adb shell input keyevent 82 & + +script: + - android list target + - ./gradlew connectedAndroidTest --parallel diff --git a/README.md b/README.md index da96481..a76c610 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,13 @@ Vector provides an abstract `VectorFragment` class extending from AndroidX's Fra Here's a contrived example to show how an app written in Vector looks like. > VectorState + ```kotlin data class MyState(val message: String): VectorState ``` > VectorFragment + ```kotlin class MyFragment: VectorFragment() { @@ -57,9 +59,16 @@ class MyFragment: VectorFragment() { ``` > VectorViewModel + ```kotlin class MyViewModel(initState: MyState): VectorViewModel(initState) { + init { + viewModelScope.launch { + getMessage() + } + } + suspend fun getMessage() { val newMessage = MessageProvider.getMessage() setState { copy(message = newMessage) } @@ -95,4 +104,4 @@ dependencies { } ``` -Constributions from the community are very welcome. \ No newline at end of file +Contributions from the community are very welcome. \ No newline at end of file