-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade: bump into kotlin 1.3.0 and coroutines 1.0.0.
1. Fixed the coroutines new API and android coroutines.
- Loading branch information
Showing
9 changed files
with
44 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ proj_name=kotlinknifer | |
proj_libname=KotlinKnifer | ||
proj_group=com.devrapid.jieyi | ||
proj_artifactid=kotlinknifer | ||
proj_version=2.0.5 | ||
proj_version=2.1.0 | ||
proj_description=For developing an Android conveniently and rapidly. | ||
proj_websiteurl=https://github.com/pokk/KotlinKnifer | ||
proj_issuetrackerurl=https://github.com/pokk/KotlinKnifer/issues | ||
|
@@ -39,4 +39,4 @@ [email protected] | |
proj_kotlin_name=kotlinshaver | ||
proj_kotlin_libname=KotlinShaver | ||
proj_kotlin_artifactid=kotlinshaver | ||
proj_kotlin_version=1.0.5 | ||
proj_kotlin_version=1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 13 additions & 8 deletions
21
kotlinknifer/src/main/java/com/devrapid/kotlinknifer/Coroutine.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
@file:Suppress("NOTHING_TO_INLINE") | ||
|
||
package com.devrapid.kotlinknifer | ||
|
||
import kotlinx.coroutines.experimental.CoroutineScope | ||
import kotlinx.coroutines.experimental.android.UI | ||
import kotlinx.coroutines.experimental.launch | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers.Default | ||
import kotlinx.coroutines.Dispatchers.IO | ||
import kotlinx.coroutines.Dispatchers.Main | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
|
||
inline fun ui(noinline block: suspend CoroutineScope.() -> Unit) = GlobalScope.launch(Main, block = block) | ||
|
||
inline fun bkg(noinline block: suspend CoroutineScope.() -> Unit) = GlobalScope.launch(Default, block = block) | ||
|
||
/** | ||
* @author Jieyi Wu | ||
* @since 2018/04/04 | ||
*/ | ||
fun ui(block: suspend CoroutineScope.() -> Unit) = launch(UI, block = block) | ||
inline fun io(noinline block: suspend CoroutineScope.() -> Unit) = GlobalScope.launch(IO, block = block) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters