diff --git a/app/build.gradle b/app/build.gradle
index c2875906b1..07840f3eb3 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -35,7 +35,7 @@ android {
defaultConfig {
applicationId "eu.kanade.tachiyomi"
- minSdkVersion 16
+ minSdkVersion 21
targetSdkVersion 29
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 41
@@ -228,7 +228,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- final coroutines_version = '0.22.2'
+ final coroutines_version = '1.3.2'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index ec34fc628b..eb1ceea261 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -9,6 +9,7 @@
+
diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
index 0ca5449361..f49585bc2e 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
@@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList
import eu.kanade.tachiyomi.util.*
-import kotlinx.coroutines.experimental.async
+import kotlinx.coroutines.async
import okhttp3.Response
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt
index a625c06e74..8dfcb27a40 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt
@@ -13,7 +13,7 @@ import eu.kanade.tachiyomi.extension.util.ExtensionInstaller
import eu.kanade.tachiyomi.extension.util.ExtensionLoader
import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.util.launchNow
-import kotlinx.coroutines.experimental.async
+import kotlinx.coroutines.async
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt
index 5067aa9362..d94768dd43 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt
@@ -7,7 +7,7 @@ import android.content.IntentFilter
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.LoadResult
import eu.kanade.tachiyomi.util.launchNow
-import kotlinx.coroutines.experimental.async
+import kotlinx.coroutines.async
/**
* Broadcast receiver that listens for the system's packages installed, updated or removed, and only
@@ -91,7 +91,11 @@ internal class ExtensionInstallReceiver(private val listener: Listener) :
private suspend fun getExtensionFromIntent(context: Context, intent: Intent?): LoadResult {
val pkgName = getPackageNameFromIntent(intent) ?:
return LoadResult.Error("Package name not found")
- return async { ExtensionLoader.loadExtensionFromPkgName(context, pkgName) }.await()
+ /*var result:LoadResult = LoadResult.Error("")
+ launchNow {
+ result = async { ExtensionLoader.loadExtensionFromPkgName(context, pkgName) }.await()
+ }*/
+ return ExtensionLoader.loadExtensionFromPkgName(context, pkgName)
}
/**
diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt
index 450eae3127..c4018f0461 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt
@@ -13,8 +13,8 @@ import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.util.Hash
-import kotlinx.coroutines.experimental.async
-import kotlinx.coroutines.experimental.runBlocking
+import kotlinx.coroutines.async
+import kotlinx.coroutines.runBlocking
import timber.log.Timber
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt
index d0c457f3ec..eabd4e926a 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt
@@ -23,6 +23,7 @@ import eu.kanade.tachiyomi.source.online.LoginSource
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.ui.setting.preferenceCategory
import eu.kanade.tachiyomi.util.LocaleHelper
+import eu.kanade.tachiyomi.util.RecyclerWindowInsetsListener
import eu.kanade.tachiyomi.widget.preference.LoginPreference
import eu.kanade.tachiyomi.widget.preference.SourceLoginDialog
import kotlinx.android.synthetic.main.extension_detail_controller.*
@@ -90,6 +91,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
extension_prefs_recycler.layoutManager = LinearLayoutManager(context)
extension_prefs_recycler.adapter = PreferenceGroupAdapter(screen)
extension_prefs_recycler.addItemDecoration(DividerItemDecoration(context, VERTICAL))
+ extension_prefs_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
if (screen.preferenceCount == 0) {
extension_prefs_empty_view.show(R.drawable.ic_no_settings,
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt
index 5e25252334..395e0f1f73 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt
@@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ReaderPage
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig
import eu.kanade.tachiyomi.util.ImageUtil
import eu.kanade.tachiyomi.util.plusAssign
-import kotlinx.coroutines.experimental.async
+import kotlinx.coroutines.async
import rx.Completable
import rx.Observable
import rx.schedulers.Schedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
index 1191453a76..374db26bac 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
@@ -35,7 +35,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressBar
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig.ZoomType
import eu.kanade.tachiyomi.util.*
import eu.kanade.tachiyomi.widget.ViewPagerAdapter
-import kotlinx.coroutines.experimental.async
+import kotlinx.coroutines.async
import rx.Observable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
@@ -258,8 +258,10 @@ class PagerPageHolder(
bytesStream.close()
launchUI {
- val image = async { BitmapFactory.decodeByteArray(bytesArray, 0, bytesArray.size) }
- imageView.background = ImageUtil.autoSetBackground(image.await())
+ val image = async { BitmapFactory.decodeByteArray(bytesArray, 0,
+ bytesArray.size) }
+ imageView.background = ImageUtil.autoSetBackground(image
+ .await())
page.bg = imageView.background
}
}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt
index a5313ac1f7..013f6e3033 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt
@@ -1,13 +1,16 @@
package eu.kanade.tachiyomi.util
-import kotlinx.coroutines.experimental.CoroutineScope
-import kotlinx.coroutines.experimental.CoroutineStart
-import kotlinx.coroutines.experimental.Job
-import kotlinx.coroutines.experimental.android.UI
-import kotlinx.coroutines.experimental.launch
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.CoroutineStart
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import kotlin.coroutines.EmptyCoroutineContext
fun launchUI(block: suspend CoroutineScope.() -> Unit): Job =
- launch(UI, CoroutineStart.DEFAULT, null, block)
+ GlobalScope.launch(Dispatchers.Main,CoroutineStart.DEFAULT,block)
+// .DEFAULT, null, block)
fun launchNow(block: suspend CoroutineScope.() -> Unit): Job =
- launch(UI, CoroutineStart.UNDISPATCHED, null, block)
+ GlobalScope.launch(Dispatchers.Main,CoroutineStart.UNDISPATCHED,block)
diff --git a/app/src/main/res/layout/extension_detail_controller.xml b/app/src/main/res/layout/extension_detail_controller.xml
index a22c526969..a060f4cd07 100644
--- a/app/src/main/res/layout/extension_detail_controller.xml
+++ b/app/src/main/res/layout/extension_detail_controller.xml
@@ -78,6 +78,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
+ android:clipToPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"