Skip to content

Commit

Permalink
Support kotlin 1.3 coroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
limuyang committed Nov 8, 2018
1 parent 4f935ef commit a36295b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.71'
ext.kotlin_version = '1.3.0'
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion photolibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies {

implementation 'com.github.mmin18:realtimeblurview:1.1.2'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'org.jetbrains.anko:anko-coroutines:0.10.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import android.support.v7.widget.RecyclerView
import android.util.TypedValue
import android.view.View
import kotlinx.android.synthetic.main.l_activity_photo_picker.*
import kotlinx.coroutines.experimental.android.UI
import kotlinx.coroutines.experimental.async
import org.jetbrains.anko.coroutines.experimental.bg
import kotlinx.coroutines.*
import top.limuyang2.photolibrary.R
import top.limuyang2.photolibrary.adapter.LPPGridDivider
import top.limuyang2.photolibrary.adapter.PhotoPickerRecyclerAdapter
Expand Down Expand Up @@ -311,12 +309,11 @@ class LPhotoPickerActivity : LBaseActivity() {
}

override fun initData() {
async(UI) {
bg {
GlobalScope.launch(Dispatchers.Main) {
async(Dispatchers.IO) {
val list = findPhoto(this@LPhotoPickerActivity, showTypeArray)
this@LPhotoPickerActivity.photoModelList.addAll(list)
}.await()

reloadPhotos(0)
}
}
Expand Down

0 comments on commit a36295b

Please sign in to comment.