Skip to content

Commit f096a9f

Browse files
committed
Update README.md
1 parent 8615b58 commit f096a9f

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

README.md

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,49 +18,31 @@ APP_PACKAGE_NAME
1818
The template project imports the [Meepo](https://github.com/nekocode/Meepo) library to create activity & broadcast routers. And use kotlin language sugars to make their usages simpler. For example:
1919

2020
```kotlin
21-
// Goto a new activity
22-
activityRouter().gotoXxxActivity(this)
21+
// Navigate to a new activity
22+
activityRouter.gotoXxxActivity(this)
2323

24-
// Broadcast a action
25-
broadcastRouter().tellSomeSth(this)
24+
// Broadcast something
25+
broadcastRouter.tellSomeSth(this)
2626

27-
// Receiver a broadcast
27+
// Register broadcast receiver
2828
registerLocalReceiver({ _, intent ->
2929
val action = (intent ?: return@registerLocalReceiver).action
3030
?: return@registerLocalReceiver
3131
when (action) {
32-
"ACTION_XXX" -> {
32+
BroadcastRouter.Action1 -> {
3333
// Do sth
3434
}
3535
}
36-
}, "ACTION_XXX", "ACTION_XXX2")
36+
}, BroadcastRouter.Action1, BroadcastRouter.Action2)
3737
```
3838

3939
Sending a network request in this project is also simple:
4040

4141
```kotlin
42-
gankIoService().picApi.getMeiziPics(1, 0)
42+
gankIoService.picApi.getMeiziPics(1, 0)
4343
// ...
4444
```
4545

46-
And the network operations are separated into a submodule. Some tests are created for them:
47-
48-
```kotlin
49-
class GankIoServiceTest {
50-
private val gankIoService = GankIoService(OkHttpClient(), Gson())
51-
52-
@Test
53-
fun getMeiziPics() {
54-
gankIoService.picApi.getMeiziPics(10, 0)
55-
.test()
56-
.assertNoErrors()
57-
.assertValue { response ->
58-
!response.error && response.results.size == 10
59-
}
60-
}
61-
}
62-
```
63-
6446
In addition, it creates some extention methods for [AutoDispose](https://github.com/uber/AutoDispose) so that you can automatically dispose your rx stream more conveniently:
6547

6648
```kotlin

0 commit comments

Comments
 (0)