mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
@@ -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) {
|
||||
|
||||
@@ -102,7 +102,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(
|
||||
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.46f)
|
||||
mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.66f)
|
||||
}
|
||||
|
||||
private fun getPositionX(positionX: Float): Float {
|
||||
@@ -306,7 +306,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
if (disableMangaScaling) {
|
||||
return false
|
||||
return super.onTouchEvent(ev)
|
||||
}
|
||||
if (isDoubleTapping && isQuickScaling) {
|
||||
return true
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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="跳转确认"
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user