Skip to content

Commit

Permalink
[chore]更新依赖库
Browse files Browse the repository at this point in the history
  • Loading branch information
RyensX committed Jul 28, 2024
1 parent b1f40a9 commit 948bc20
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/su/mediabox/net/DnsServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object DnsServer {
override fun equals(other: Any?): Boolean {
return when (other) {
null -> false
other === this -> true
(other === this) -> true
is String -> other == dnsServer
is Dns -> other.dnsServer == this.dnsServer && other.dnsName == this.dnsName
else -> false
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/su/mediabox/util/CoroutineUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ private class ViewCoroutineInterceptor(
private class ViewStateListener(private val view: View, private val job: Job) :
View.OnAttachStateChangeListener, CompletionHandler {

override fun onViewAttachedToWindow(v: View?) {}
override fun onViewAttachedToWindow(v: View) {}

//在Recyclerview上使用LinearLayoutManager可能并不会调用,取决于mRecycleChildrenOnDetach,因此必须手动调用setRecycleChildrenOnDetach(true)
override fun onViewDetachedFromWindow(v: View?) {
override fun onViewDetachedFromWindow(v: View) {
logD("View协程", "分离视图->取消")
view.removeOnAttachStateChangeListener(this)
job.cancel()
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/su/mediabox/util/coil/CoilUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ object CoilUtil {
logE("loadImage", "图片来源有误!")
return@runCatching
}
logD("加载图片","url=$urlOrBase64")
val time = System.currentTimeMillis()
when {
urlOrBase64.startsWith("data:image") -> {
Expand Down Expand Up @@ -90,10 +91,10 @@ object CoilUtil {
?.let {
addHeader("Referer", it)
}
addHeader("Host", URL(urlOrBase64).host)
addHeader("Accept", "*/*")
addHeader("Accept-Encoding", "gzip, deflate")
addHeader("Connection", "keep-alive")
// addHeader("Host", URL(urlOrBase64).host)
// addHeader("Accept", "*/*")
// addHeader("Accept-Encoding", "gzip, deflate")
// addHeader("Connection", "keep-alive")
addHeader("User-Agent", Constant.Request.getRandomUserAgent())
listener { _, _ ->
logD("图片加载完毕", "time=$time url=$urlOrBase64", false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class GettingWebView @JvmOverloads constructor(
}
mWebSettings.javaScriptCanOpenWindowsAutomatically = true
mWebSettings.loadsImagesAutomatically = false
mWebSettings.setAppCacheEnabled(true)
mWebSettings.setAppCachePath(context.cacheDir.absolutePath)
mWebSettings.databaseEnabled = true
mWebSettings.setGeolocationDatabasePath(context.getDir("database", 0).path)
mWebSettings.setGeolocationEnabled(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class MediaClassifyActivity : BasePluginActivity() {
mBinding.mediaClassifyFabProgress.invisible()
"加载分类错误:${it.throwable?.message}".showToast()
}
else -> {}
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/su/mediabox/view/component/PointView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class PointView(context: Context, attributeSet: AttributeSet) : View(context, at
}
get() = paint.color

override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
val radius = pointSize / 2
canvas?.drawCircle(width / 2F, height / 2F, radius, paint)
canvas.drawCircle(width / 2F, height / 2F, radius, paint)
}

override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Intent
import android.graphics.Color
import android.graphics.Typeface
import android.net.Uri
import android.util.Log
import android.view.Gravity
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
Expand All @@ -23,6 +24,8 @@ import com.su.mediabox.util.ResourceUtil.getString

class PluginInstallerViewModel : ViewModel() {

private val tag = "PluginInstaller"

private val _pluginInstallState =
MutableLiveData<PluginInstallState>(PluginInstallState.LOADING)
val pluginInstallState = _pluginInstallState.toLiveData()
Expand Down Expand Up @@ -63,6 +66,9 @@ class PluginInstallerViewModel : ViewModel() {
)
}
}
else -> {
logE(tag, "install error: $data")
}
}
}
}
Expand Down Expand Up @@ -230,6 +236,9 @@ class PluginInstallerViewModel : ViewModel() {
is PluginInstallState.PREVIEW -> {
PluginManager.downloadPlugin(data.pluginInfo)
}
else -> {
logE(tag, "downloadPlugin: $data")
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
ext {
secret = "${rootDir}/secret.gradle"
andresguard = "${rootDir}/andresguard.gradle"
kotlinVersion = '1.6.21'
kotlinVersion = '1.8.0'
}
repositories {
google()
Expand Down
17 changes: 9 additions & 8 deletions version.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ ext.version_code = 62
ext.version_name = "2.62"

def build_versions = [:]
build_versions.compile_sdk = 31
build_versions.build_tools = "31.0.0"
build_versions.compile_sdk = 34
build_versions.build_tools = "34.0.0"
build_versions.min_sdk = 21
build_versions.target_sdk = 31
ext.build_versions = build_versions

def deps = [:]

def kotlin = [:]
kotlin.kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:1.6.10"
kotlin.core_ktx = "androidx.core:core-ktx:1.6.0"
kotlin.kotlin_stdlib = "org.jetbrains.kotlin:kotlin-stdlib:1.8.0"
kotlin.core_ktx = "androidx.core:core-ktx:1.8.0"
deps.kotlin = kotlin

def settings = [:]
Expand Down Expand Up @@ -60,9 +60,10 @@ okhttp3.okhttp_dnsoverhttps = "com.squareup.okhttp3:okhttp-dnsoverhttps:4.9.0"
deps.okhttp3 = okhttp3

def room = [:]
room.room_runtime = "androidx.room:room-runtime:2.4.2"
room.room_ktx = "androidx.room:room-ktx:2.4.2"
room.room_compiler = "androidx.room:room-compiler:2.4.2"
def room_version = "2.5.1"
room.room_runtime = "androidx.room:room-runtime:$room_version"
room.room_ktx = "androidx.room:room-ktx:$room_version"
room.room_compiler = "androidx.room:room-compiler:$room_version"
deps.room = room

def jsoup = [:]
Expand Down Expand Up @@ -103,7 +104,7 @@ nanohttpd.nanohttpd = "org.nanohttpd:nanohttpd:2.3.1"
deps.nanohttpd = nanohttpd

def coil_kt = [:]
coil_kt.coil = "io.coil-kt:coil:2.0.0"
coil_kt.coil = "io.coil-kt:coil:2.5.0"
deps.coil_kt = coil_kt

def smart = [:]
Expand Down

0 comments on commit 948bc20

Please sign in to comment.