mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
update fork / build (push) Has been cancelled
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
update fork / build (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package io.legado.app.help.glide
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.GlideBuilder
|
||||
import com.bumptech.glide.Registry
|
||||
@@ -9,6 +10,8 @@ import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory
|
||||
import com.bumptech.glide.load.engine.cache.MemorySizeCalculator
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.module.AppGlideModule
|
||||
import io.legado.app.BuildConfig
|
||||
import io.legado.app.help.config.AppConfig
|
||||
import java.io.InputStream
|
||||
|
||||
|
||||
@@ -36,5 +39,8 @@ class LegadoGlideModule : AppGlideModule() {
|
||||
builder.setMemorySizeCalculator(calculator)
|
||||
builder.setBitmapPool(bitmapPool)
|
||||
builder.setDiskCache(InternalCacheDiskCacheFactory(context, 1024 * 1024 * 1000))
|
||||
if (!BuildConfig.DEBUG && !AppConfig.recordLog) {
|
||||
builder.setLogLevel(Log.ERROR)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,12 @@ import io.legado.app.ui.book.manga.ReadMangaActivity
|
||||
import io.legado.app.ui.book.read.ReadBookActivity
|
||||
import io.legado.app.ui.book.search.SearchActivity
|
||||
import io.legado.app.ui.main.bookshelf.BaseBookshelfFragment
|
||||
import io.legado.app.utils.*
|
||||
import io.legado.app.utils.cnCompare
|
||||
import io.legado.app.utils.observeEvent
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.startActivity
|
||||
import io.legado.app.utils.startReadOrMangaActivity
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@@ -134,7 +139,7 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
||||
}
|
||||
}
|
||||
booksFlowJob?.cancel()
|
||||
booksFlowJob = lifecycleScope.launch {
|
||||
booksFlowJob = viewLifecycleOwner.lifecycleScope.launch {
|
||||
appDb.bookDao.flowByGroup(groupId).map { list ->
|
||||
//排序
|
||||
when (AppConfig.getBookSortByGroupId(groupId)) {
|
||||
@@ -161,12 +166,10 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
||||
}.flowOn(Dispatchers.Default).catch {
|
||||
AppLog.put("书架更新出错", it)
|
||||
}.conflate().collect { list ->
|
||||
if (isAdded) {
|
||||
books = list
|
||||
booksAdapter.notifyDataSetChanged()
|
||||
binding.tvEmptyMsg.isGone = getItemCount() > 0
|
||||
delay(100)
|
||||
}
|
||||
books = list
|
||||
booksAdapter.notifyDataSetChanged()
|
||||
binding.tvEmptyMsg.isGone = getItemCount() > 0
|
||||
delay(100)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,10 +207,12 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
||||
startActivity<AudioPlayActivity> {
|
||||
putExtra("bookUrl", item.bookUrl)
|
||||
}
|
||||
else -> startReadOrMangaActivity<ReadBookActivity,ReadMangaActivity>(item) {
|
||||
|
||||
else -> startReadOrMangaActivity<ReadBookActivity, ReadMangaActivity>(item) {
|
||||
putExtra("bookUrl", item.bookUrl)
|
||||
}
|
||||
}
|
||||
|
||||
is BookGroup -> {
|
||||
groupId = item.groupId
|
||||
initBooksData()
|
||||
@@ -221,6 +226,7 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
||||
putExtra("name", item.name)
|
||||
putExtra("author", item.author)
|
||||
}
|
||||
|
||||
is BookGroup -> showDialogFragment(GroupEditDialog(item))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
android:id="@+id/cv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_item_focused_on_tv"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@drawable/bg_item_focused_on_tv"
|
||||
android:scrollbars="none"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
|
||||
@@ -15,14 +16,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none">
|
||||
|
||||
<io.legado.app.ui.widget.image.CoverImageView
|
||||
android:id="@+id/iv_cover"
|
||||
@@ -30,6 +33,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:scrollbars="none"
|
||||
android:src="@drawable/image_cover_default"
|
||||
android:transitionName="img_cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -42,6 +46,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:includeFontPadding="false"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
@@ -51,6 +56,7 @@
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="right"
|
||||
android:scrollbars="none"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -68,6 +74,7 @@
|
||||
android:gravity="top|center_horizontal"
|
||||
android:includeFontPadding="false"
|
||||
android:lines="2"
|
||||
android:scrollbars="none"
|
||||
android:text="@string/book_name"
|
||||
android:textColor="@color/primaryText"
|
||||
android:textSize="12sp"
|
||||
@@ -80,6 +87,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
|
||||
Reference in New Issue
Block a user