Cleanup
This commit is contained in:
parent
c9062cc089
commit
a6d4644713
@ -469,7 +469,6 @@ class LibraryUpdateService(
|
|||||||
}
|
}
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
|
|
||||||
return runAsObservable({
|
return runAsObservable({
|
||||||
// SY -->
|
// SY -->
|
||||||
if (source is MergedSource) {
|
if (source is MergedSource) {
|
||||||
|
@ -90,7 +90,7 @@ internal class ExtensionGithubApi {
|
|||||||
val lang = element.jsonObject["lang"]!!.jsonPrimitive.content
|
val lang = element.jsonObject["lang"]!!.jsonPrimitive.content
|
||||||
val nsfw = element.jsonObject["nsfw"]!!.jsonPrimitive.int == 1
|
val nsfw = element.jsonObject["nsfw"]!!.jsonPrimitive.int == 1
|
||||||
// SY -->
|
// SY -->
|
||||||
val icon = "${repoUrl}/icon/${apkName.replace(".apk", ".png")}"
|
val icon = "$repoUrl/icon/${apkName.replace(".apk", ".png")}"
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
Extension.Available(name, pkgName, versionName, versionCode, lang, nsfw, apkName, icon /* SY --> */, repoUrl /* SY <-- */)
|
Extension.Available(name, pkgName, versionName, versionCode, lang, nsfw, apkName, icon /* SY --> */, repoUrl /* SY <-- */)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package exh.ui.base
|
package exh.ui.base
|
||||||
|
|
||||||
import androidx.annotation.CallSuper
|
import androidx.annotation.CallSuper
|
||||||
import kotlinx.coroutines.CoroutineDispatcher
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@ -20,9 +19,7 @@ import kotlin.coroutines.EmptyCoroutineContext
|
|||||||
@Suppress("DEPRECATION", "unused")
|
@Suppress("DEPRECATION", "unused")
|
||||||
open class CoroutinePresenter<V>(
|
open class CoroutinePresenter<V>(
|
||||||
scope: CoroutineScope = CoroutineScope(Job() + Dispatchers.Main)
|
scope: CoroutineScope = CoroutineScope(Job() + Dispatchers.Main)
|
||||||
) : Presenter<V>(),
|
) : Presenter<V>(), CoroutineScope by scope {
|
||||||
CoroutineScope by scope
|
|
||||||
{
|
|
||||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||||
@Deprecated("Use launchInView, Flow.inView, Flow.mapView")
|
@Deprecated("Use launchInView, Flow.inView, Flow.mapView")
|
||||||
override fun getView(): V? {
|
override fun getView(): V? {
|
||||||
@ -47,10 +44,10 @@ open class CoroutinePresenter<V>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Flow<*>.launchUnderContext(context: CoroutineContext = EmptyCoroutineContext) =
|
fun Flow<*>.launchUnderContext(context: CoroutineContext = EmptyCoroutineContext) =
|
||||||
launch(this + context) { this@launchInHere.collect() }
|
launch(context) { this@launchUnderContext.collect() }
|
||||||
|
|
||||||
fun Flow<*>.launch() = launchIn(this)
|
fun Flow<*>.launch() = launchIn(this@CoroutinePresenter)
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
override fun destroy() {
|
override fun destroy() {
|
||||||
|
@ -15,7 +15,6 @@ import exh.ui.base.CoroutinePresenter
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.launchIn
|
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.plus
|
import kotlinx.coroutines.plus
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user