diff --git a/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt b/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt index 407e3a40f..5562a7671 100644 --- a/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt +++ b/app/src/main/java/io/legado/app/help/glide/ImageLoader.kt @@ -29,7 +29,7 @@ object ImageLoader { val byteArray = Base64.decode(dataUriBase64, Base64.DEFAULT) Glide.with(context).load(byteArray) }.getOrDefault( - Glide.with(context).load(path) + GlideApp.with(context).load(path) ) path.isAbsUrl() -> { val url = kotlin.runCatching { diff --git a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt index b32ea7bf1..3ab04d1e8 100644 --- a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt @@ -13,6 +13,7 @@ import android.content.res.ColorStateList import android.content.res.Configuration import android.graphics.Bitmap import android.graphics.drawable.Drawable +import android.net.ConnectivityManager import android.net.Uri import android.os.BatteryManager import android.os.Build @@ -29,7 +30,7 @@ import io.legado.app.R import io.legado.app.constant.AppConst import io.legado.app.help.IntentHelp import splitties.systemservices.clipboardManager - +import splitties.systemservices.connectivityManager import java.io.File import java.io.FileOutputStream @@ -326,6 +327,12 @@ fun Context.openFileUri(uri: Uri, type: String? = null) { } } +val Context.isWifiConnect: Boolean + get() { + val info = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI) + return info?.isConnected == true + } + val Context.isPad: Boolean get() { return resources.configuration.screenLayout and Configuration.SCREENLAYOUT_SIZE_MASK >= Configuration.SCREENLAYOUT_SIZE_LARGE