Skip to content

Commit

Permalink
feat: Add travis config and fix README errors
Browse files Browse the repository at this point in the history
  • Loading branch information
haroldadmin committed Jun 4, 2019
1 parent d6cf6f2 commit 6c39f73
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand All @@ -57,9 +59,16 @@ class MyFragment: VectorFragment() {
```

> VectorViewModel
```kotlin
class MyViewModel<MyState>(initState: MyState): VectorViewModel(initState) {

init {
viewModelScope.launch {
getMessage()
}
}

suspend fun getMessage() {
val newMessage = MessageProvider.getMessage()
setState { copy(message = newMessage) }
Expand Down Expand Up @@ -95,4 +104,4 @@ dependencies {
}
```

Constributions from the community are very welcome.
Contributions from the community are very welcome.

0 comments on commit 6c39f73

Please sign in to comment.