Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/io/legado/app/help/glide/LegadoGlideModule.kt
#	app/src/main/java/io/legado/app/ui/book/manga/ReadMangaActivity.kt
  • Loading branch information
lhjgege committed Feb 18, 2025
2 parents ace6a90 + 2f6b77d commit ff2e1ab
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ dependencies {
implementation platform(libs.firebase.bom)
implementation libs.firebase.analytics
implementation libs.firebase.perf
implementation libs.zoom.imageview

implementation libs.glide.recyclerview

//LeakCanary, 内存泄露检测
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<application
android:name=".App"
android:allowBackup="true"
android:largeHeap="true"
android:icon="@mipmap/ic_launcher"
android:label="${app_name}"
android:networkSecurityConfig="@xml/network_security_config"
Expand Down
13 changes: 1 addition & 12 deletions app/src/main/java/io/legado/app/help/glide/LegadoGlideModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.Registry
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool
import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory
import com.bumptech.glide.load.engine.cache.LruResourceCache
import com.bumptech.glide.load.model.GlideUrl
import com.bumptech.glide.module.AppGlideModule
import com.bumptech.glide.request.RequestOptions
import java.io.InputStream


Expand All @@ -29,13 +25,6 @@ class LegadoGlideModule : AppGlideModule() {

override fun applyOptions(context: Context, builder: GlideBuilder) {
super.applyOptions(context, builder)
builder.setMemoryCache(LruResourceCache(1024 * 1024 * 500))
.setBitmapPool(LruBitmapPool(1024 * 1024 * 200))
.setDiskCache(
InternalCacheDiskCacheFactory(
context,
1024 * 1024 * 1000
)
)
builder.setDiskCache(InternalCacheDiskCacheFactory(context, 1024 * 1024 * 1000))
}
}
6 changes: 3 additions & 3 deletions app/src/main/java/io/legado/app/model/recyclerView/MangaVH.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.widget.Button
import android.widget.FrameLayout
import android.widget.ProgressBar
import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.view.updateLayoutParams
Expand All @@ -19,7 +20,6 @@ import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.github.panpf.zoomimage.GlideZoomImageView
import io.legado.app.R
import io.legado.app.help.glide.progress.OnProgressListener
import io.legado.app.help.glide.progress.ProgressManager
Expand All @@ -32,14 +32,14 @@ open class MangaVH<VB : ViewBinding>(val binding: VB, private val context: Conte
RecyclerView.ViewHolder(binding.root) {

protected lateinit var mLoading: ProgressBar
protected lateinit var mImage: GlideZoomImageView
protected lateinit var mImage: AppCompatImageView
protected lateinit var mProgress: TextView
protected lateinit var mFlProgress: FrameLayout
protected var mRetry: Button? = null

fun initComponent(
loading: ProgressBar,
image: GlideZoomImageView,
image: AppCompatImageView,
progress: TextView,
button: Button? = null,
flProgress: FrameLayout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
import io.legado.app.utils.visible


class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>(),
ReadManga.Callback, ChangeBookSourceDialog.CallBack, MangaMenu.CallBack {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.viewbinding.ViewBinding
import com.bumptech.glide.Glide
import com.bumptech.glide.ListPreloader.PreloadModelProvider
import com.bumptech.glide.RequestBuilder
import com.github.panpf.zoomimage.zoom.GestureType
import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.RecyclerAdapter.Companion.TYPE_FOOTER_VIEW
Expand Down Expand Up @@ -89,10 +88,6 @@ class MangaAdapter(private val context: Context) :
binding.retry,
binding.flProgress
)
binding.image.zoomable.disabledGestureTypesState.value =
GestureType.DOUBLE_TAP_SCALE or GestureType.ONE_FINGER_SCALE or
GestureType.TWO_FINGER_SCALE or GestureType.KEYBOARD_DRAG or
GestureType.ONE_FINGER_DRAG or GestureType.KEYBOARD_SCALE or GestureType.MOUSE_WHEEL_SCALE
binding.retry.setOnClickListener {
val item = mDiffer.currentList[layoutPosition]
if (item is MangeContent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(

MotionEvent.ACTION_MOVE -> {
if (disableMangaScaling) {
return false
return super.onTouchEvent(ev)
}
if (isDoubleTapping && isQuickScaling) {
return true
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/book_comic_rv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
android:background="@color/book_ant_10"
android:contentDescription="@null">

<com.github.panpf.zoomimage.GlideZoomImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
app:contentScale="fillWidth" />
android:scaleType="fitCenter" />

<FrameLayout
android:id="@+id/fl_progress"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/dialog_open_url_confirm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="5dp"
android:theme="?attr/actionBarStyle"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:title="跳转确认"
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ mozilla-rhino = { module = "org.mozilla:rhino", version.ref = "rhino" }

renderscript-intrinsics-replacement-toolkit = { module = "com.github.android:renderscript-intrinsics-replacement-toolkit", version = "b6363490c3" }
zxing-lite = { module = "com.github.jenly1314:zxing-lite", version.ref = "zxingLite" }
zoom-imageview="io.github.panpf.zoomimage:zoomimage-view-glide:1.1.1"

[bundles]
coroutines = ["kotlinx-coroutines-core", "kotlinx-coroutines-android"]
Expand Down

0 comments on commit ff2e1ab

Please sign in to comment.