Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -11,7 +11,7 @@ jobs:
|
|||||||
if: ${{ github.event.repository.owner.id == github.event.sender.id && github.actor != 'gedoor' }}
|
if: ${{ github.event.repository.owner.id == github.event.sender.id && github.actor != 'gedoor' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Set env
|
- name: Set env
|
||||||
run: |
|
run: |
|
||||||
git config --global user.email "github-actions@github.com"
|
git config --global user.email "github-actions@github.com"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.repository == 'gedoor/legado' }}
|
if: ${{ github.repository == 'gedoor/legado' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check Cronet Updates
|
- name: Check Cronet Updates
|
||||||
run: source .github/scripts/cronet.sh
|
run: source .github/scripts/cronet.sh
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
play: ${{ needs.prepare.outputs.play }}
|
play: ${{ needs.prepare.outputs.play }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
VERSIONL: ${{ needs.prepare.outputs.versionL }}
|
VERSIONL: ${{ needs.prepare.outputs.versionL }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
# 蓝奏云里的文件夹ID(阅读3测试版:2670621)
|
# 蓝奏云里的文件夹ID(阅读3测试版:2670621)
|
||||||
LANZOU_FOLDER_ID: '2670621'
|
LANZOU_FOLDER_ID: '2670621'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: apk/
|
path: apk/
|
||||||
@@ -131,7 +131,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' && github.actor == 'gedoor' }}
|
if: ${{ github.event_name != 'pull_request' && github.actor == 'gedoor' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: apk/
|
path: apk/
|
||||||
@@ -157,7 +157,7 @@ jobs:
|
|||||||
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
|
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: apk/
|
path: apk/
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
|||||||
+1
-1
@@ -184,7 +184,7 @@ dependencies {
|
|||||||
implementation('com.google.code.gson:gson:2.10.1')
|
implementation('com.google.code.gson:gson:2.10.1')
|
||||||
|
|
||||||
//lifecycle
|
//lifecycle
|
||||||
def lifecycle_version = '2.6.1'
|
def lifecycle_version = '2.6.2'
|
||||||
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycle_version")
|
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycle_version")
|
||||||
implementation("androidx.lifecycle:lifecycle-service:$lifecycle_version")
|
implementation("androidx.lifecycle:lifecycle-service:$lifecycle_version")
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
{"arm64-v8a":"d1d80901d4237fa0af5abc83ac6a7419","armeabi-v7a":"21923acaea2ec3fa03943b2466ab6f4e","x86":"0f90e0244c417bd86d11d0eefdb39773","x86_64":"3cb944b2bf0a1abab4e2bd2f3c6e05d0","version":"115.0.5790.138"}
|
{"armeabi-v7a":"af4e0909b1c9b4c1b22037ca6ca1d6ec","arm64-v8a":"7b57dc697f55653f3f7de33338dc9dcf","x86_64":"a91196950841eb45b8dda49da256b188","x86":"a639c96f5c352bab109e1ba48fec57bc","version":"117.0.5938.60"}
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
* 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源!
|
* 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源!
|
||||||
|
|
||||||
**2023/08/02**
|
**2023/08/02**
|
||||||
|
* 更新cronet: 117.0.5938.60
|
||||||
|
|
||||||
* 书签导出md格式
|
* 书签导出md格式
|
||||||
* 优化进度同步,减少webDav下载次数
|
* 优化进度同步,减少webDav下载次数
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ object PreferKey {
|
|||||||
const val batchChangeSourceDelay = "batchChangeSourceDelay"
|
const val batchChangeSourceDelay = "batchChangeSourceDelay"
|
||||||
const val openBookInfoByClickTitle = "openBookInfoByClickTitle"
|
const val openBookInfoByClickTitle = "openBookInfoByClickTitle"
|
||||||
const val defaultHomePage = "defaultHomePage"
|
const val defaultHomePage = "defaultHomePage"
|
||||||
|
const val showBookshelfFastScroller = "showBookshelfFastScroller"
|
||||||
|
|
||||||
const val cPrimary = "colorPrimary"
|
const val cPrimary = "colorPrimary"
|
||||||
const val cAccent = "colorAccent"
|
const val cAccent = "colorAccent"
|
||||||
|
|||||||
@@ -403,6 +403,12 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
appCtx.putPrefBoolean(PreferKey.openBookInfoByClickTitle, value)
|
appCtx.putPrefBoolean(PreferKey.openBookInfoByClickTitle, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var showBookshelfFastScroller: Boolean
|
||||||
|
get() = appCtx.getPrefBoolean(PreferKey.showBookshelfFastScroller, false)
|
||||||
|
set(value) {
|
||||||
|
appCtx.putPrefBoolean(PreferKey.showBookshelfFastScroller, value)
|
||||||
|
}
|
||||||
|
|
||||||
var contentSelectSpeakMod: Int
|
var contentSelectSpeakMod: Int
|
||||||
get() = appCtx.getPrefInt(PreferKey.contentSelectSpeakMod)
|
get() = appCtx.getPrefInt(PreferKey.contentSelectSpeakMod)
|
||||||
set(value) {
|
set(value) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class Coroutine<T>(
|
|||||||
job.cancel(cause)
|
job.cancel(cause)
|
||||||
}
|
}
|
||||||
cancel?.let {
|
cancel?.let {
|
||||||
MainScope().launch {
|
MainScope().launch(executeContext) {
|
||||||
if (null == it.context) {
|
if (null == it.context) {
|
||||||
it.block.invoke(scope)
|
it.block.invoke(scope)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package io.legado.app.help.http
|
package io.legado.app.help.http
|
||||||
|
|
||||||
import io.legado.app.utils.asIOException
|
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import io.legado.app.utils.toastOnUi
|
|||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers.IO
|
import kotlinx.coroutines.Dispatchers.IO
|
||||||
import kotlinx.coroutines.MainScope
|
import kotlinx.coroutines.MainScope
|
||||||
|
import kotlinx.coroutines.SupervisorJob
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import splitties.init.appCtx
|
import splitties.init.appCtx
|
||||||
@@ -55,6 +56,7 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
var preDownloadTask: Coroutine<*>? = null
|
var preDownloadTask: Coroutine<*>? = null
|
||||||
val downloadedChapters = hashSetOf<Int>()
|
val downloadedChapters = hashSetOf<Int>()
|
||||||
var contentProcessor: ContentProcessor? = null
|
var contentProcessor: ContentProcessor? = null
|
||||||
|
val downloadScope = CoroutineScope(SupervisorJob() + IO)
|
||||||
|
|
||||||
//暂时保存跳转前进度
|
//暂时保存跳转前进度
|
||||||
fun saveCurrentBookProcess() {
|
fun saveCurrentBookProcess() {
|
||||||
@@ -355,7 +357,7 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
success?.invoke()
|
success?.invoke()
|
||||||
}
|
}
|
||||||
} ?: download(
|
} ?: download(
|
||||||
this,
|
downloadScope,
|
||||||
chapter,
|
chapter,
|
||||||
resetPageOffset = resetPageOffset,
|
resetPageOffset = resetPageOffset,
|
||||||
pageChanged = pageChanged
|
pageChanged = pageChanged
|
||||||
@@ -386,7 +388,12 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
downloadedChapters.add(chapter.index)
|
downloadedChapters.add(chapter.index)
|
||||||
} else {
|
} else {
|
||||||
delay(1000)
|
delay(1000)
|
||||||
download(this, chapter, resetPageOffset = false, pageChanged = false)
|
download(
|
||||||
|
downloadScope,
|
||||||
|
chapter,
|
||||||
|
resetPageOffset = false,
|
||||||
|
pageChanged = false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} ?: removeLoading(index)
|
} ?: removeLoading(index)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -503,7 +510,7 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
) {
|
) {
|
||||||
appDb.bookChapterDao.insert(*cList.toTypedArray())
|
appDb.bookChapterDao.insert(*cList.toTypedArray())
|
||||||
chapterSize = cList.size
|
chapterSize = cList.size
|
||||||
nextTextChapter ?: loadContent(1)
|
nextTextChapter ?: loadContent(durChapterIndex + 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -521,16 +528,19 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun saveRead() {
|
fun saveRead() {
|
||||||
Coroutine.async {
|
Coroutine.async(executeContext = IO) {
|
||||||
val book = book ?: return@async
|
val book = book ?: return@async
|
||||||
book.lastCheckCount = 0
|
book.lastCheckCount = 0
|
||||||
book.durChapterTime = System.currentTimeMillis()
|
book.durChapterTime = System.currentTimeMillis()
|
||||||
|
val chapterChanged = book.durChapterIndex != durChapterIndex
|
||||||
book.durChapterIndex = durChapterIndex
|
book.durChapterIndex = durChapterIndex
|
||||||
book.durChapterPos = durChapterPos
|
book.durChapterPos = durChapterPos
|
||||||
appDb.bookChapterDao.getChapter(book.bookUrl, durChapterIndex)?.let {
|
if (chapterChanged) {
|
||||||
book.durChapterTitle = it.getDisplayTitle(
|
appDb.bookChapterDao.getChapter(book.bookUrl, durChapterIndex)?.let {
|
||||||
ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
|
book.durChapterTitle = it.getDisplayTitle(
|
||||||
)
|
ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
appDb.bookDao.update(book)
|
appDb.bookDao.update(book)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,12 +215,16 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
|
|
||||||
override fun onPostCreate(savedInstanceState: Bundle?) {
|
override fun onPostCreate(savedInstanceState: Bundle?) {
|
||||||
super.onPostCreate(savedInstanceState)
|
super.onPostCreate(savedInstanceState)
|
||||||
viewModel.initData(intent)
|
viewModel.initData(intent) {
|
||||||
|
upMenu()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNewIntent(intent: Intent?) {
|
override fun onNewIntent(intent: Intent?) {
|
||||||
super.onNewIntent(intent)
|
super.onNewIntent(intent)
|
||||||
viewModel.initData(intent ?: return)
|
viewModel.initData(intent ?: return) {
|
||||||
|
upMenu()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||||
@@ -244,7 +248,9 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
if (bookChanged) {
|
if (bookChanged) {
|
||||||
bookChanged = false
|
bookChanged = false
|
||||||
ReadBook.callBack = this
|
ReadBook.callBack = this
|
||||||
viewModel.initData(intent)
|
viewModel.initData(intent) {
|
||||||
|
upMenu()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//web端阅读时,app处于阅读界面,本地记录会覆盖web保存的进度,在此处恢复
|
//web端阅读时,app处于阅读界面,本地记录会覆盖web保存的进度,在此处恢复
|
||||||
ReadBook.webBookProgress?.let {
|
ReadBook.webBookProgress?.let {
|
||||||
@@ -1368,6 +1374,8 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
ReadBook.callBack = null
|
ReadBook.callBack = null
|
||||||
}
|
}
|
||||||
ReadBook.preDownloadTask?.cancel()
|
ReadBook.preDownloadTask?.cancel()
|
||||||
|
ReadBook.downloadScope.coroutineContext.cancelChildren()
|
||||||
|
ReadBook.coroutineContext.cancelChildren()
|
||||||
ReadBook.downloadedChapters.clear()
|
ReadBook.downloadedChapters.clear()
|
||||||
if (!BuildConfig.DEBUG) {
|
if (!BuildConfig.DEBUG) {
|
||||||
Backup.autoBack(this)
|
Backup.autoBack(this)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
/**
|
/**
|
||||||
* 初始化
|
* 初始化
|
||||||
*/
|
*/
|
||||||
fun initData(intent: Intent) {
|
fun initData(intent: Intent, success: (() -> Unit)? = null) {
|
||||||
execute {
|
execute {
|
||||||
ReadBook.inBookshelf = intent.getBooleanExtra("inBookshelf", true)
|
ReadBook.inBookshelf = intent.getBooleanExtra("inBookshelf", true)
|
||||||
ReadBook.tocChanged = intent.getBooleanExtra("tocChanged", false)
|
ReadBook.tocChanged = intent.getBooleanExtra("tocChanged", false)
|
||||||
@@ -70,6 +70,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
book != null -> initBook(book)
|
book != null -> initBook(book)
|
||||||
else -> ReadBook.upMsg(context.getString(R.string.no_book))
|
else -> ReadBook.upMsg(context.getString(R.string.no_book))
|
||||||
}
|
}
|
||||||
|
}.onSuccess {
|
||||||
|
success?.invoke()
|
||||||
}.onError {
|
}.onError {
|
||||||
val msg = "初始化数据失败\n${it.localizedMessage}"
|
val msg = "初始化数据失败\n${it.localizedMessage}"
|
||||||
ReadBook.upMsg(msg)
|
ReadBook.upMsg(msg)
|
||||||
|
|||||||
@@ -285,14 +285,14 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
|
|||||||
val offset = (ChapterProvider.visibleHeight - textPage.height).toInt()
|
val offset = (ChapterProvider.visibleHeight - textPage.height).toInt()
|
||||||
pageOffset = min(0, offset)
|
pageOffset = min(0, offset)
|
||||||
} else if (pageOffset > 0) {
|
} else if (pageOffset > 0) {
|
||||||
pageFactory.moveToPrev(false)
|
pageFactory.moveToPrev(true)
|
||||||
textPage = pageFactory.curPage
|
textPage = pageFactory.curPage
|
||||||
pageOffset -= textPage.height.toInt()
|
pageOffset -= textPage.height.toInt()
|
||||||
upView?.invoke(textPage)
|
upView?.invoke(textPage)
|
||||||
contentDescription = textPage.text
|
contentDescription = textPage.text
|
||||||
} else if (pageOffset < -textPage.height) {
|
} else if (pageOffset < -textPage.height) {
|
||||||
pageOffset += textPage.height.toInt()
|
pageOffset += textPage.height.toInt()
|
||||||
pageFactory.moveToNext(false)
|
pageFactory.moveToNext(true)
|
||||||
textPage = pageFactory.curPage
|
textPage = pageFactory.curPage
|
||||||
upView?.invoke(textPage)
|
upView?.invoke(textPage)
|
||||||
contentDescription = textPage.text
|
contentDescription = textPage.text
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource
|
|||||||
ReadBook.moveToNextChapter(upContent)
|
ReadBook.moveToNextChapter(upContent)
|
||||||
} else {
|
} else {
|
||||||
ReadBook.setPageIndex(pageIndex.plus(1))
|
ReadBook.setPageIndex(pageIndex.plus(1))
|
||||||
|
if (upContent) upContent(resetPageOffset = false)
|
||||||
}
|
}
|
||||||
if (upContent) upContent(resetPageOffset = false)
|
|
||||||
true
|
true
|
||||||
} else
|
} else
|
||||||
false
|
false
|
||||||
@@ -52,8 +52,8 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource
|
|||||||
ReadBook.moveToPrevChapter(upContent)
|
ReadBook.moveToPrevChapter(upContent)
|
||||||
} else {
|
} else {
|
||||||
ReadBook.setPageIndex(pageIndex.minus(1))
|
ReadBook.setPageIndex(pageIndex.minus(1))
|
||||||
|
if (upContent) upContent(resetPageOffset = false)
|
||||||
}
|
}
|
||||||
if (upContent) upContent(resetPageOffset = false)
|
|
||||||
true
|
true
|
||||||
} else
|
} else
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
}
|
}
|
||||||
waitUpTocBooks.remove(bookUrl)
|
waitUpTocBooks.remove(bookUrl)
|
||||||
upTocAdd(bookUrl)
|
upTocAdd(bookUrl)
|
||||||
execute(context = upTocPool, executeContext = IO) {
|
execute(context = upTocPool, executeContext = upTocPool) {
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
val oldBook = book.copy()
|
val oldBook = book.copy()
|
||||||
WebBook.runPreUpdateJs(source, book)
|
WebBook.runPreUpdateJs(source, book)
|
||||||
@@ -170,10 +170,10 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
appDb.bookDao.update(book)
|
appDb.bookDao.update(book)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.onCancel(upTocPool) {
|
}.onCancel {
|
||||||
upTocCancel(bookUrl)
|
upTocCancel(bookUrl)
|
||||||
upTocCancel(book.bookUrl)
|
upTocCancel(book.bookUrl)
|
||||||
}.onFinally(upTocPool) {
|
}.onFinally {
|
||||||
upTocFinally(bookUrl)
|
upTocFinally(bookUrl)
|
||||||
upTocFinally(book.bookUrl)
|
upTocFinally(book.bookUrl)
|
||||||
postUpBooksLiveData()
|
postUpBooksLiveData()
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
|||||||
swShowUnread.isChecked = AppConfig.showUnread
|
swShowUnread.isChecked = AppConfig.showUnread
|
||||||
swShowLastUpdateTime.isChecked = AppConfig.showLastUpdateTime
|
swShowLastUpdateTime.isChecked = AppConfig.showLastUpdateTime
|
||||||
swShowWaitUpBooks.isChecked = AppConfig.showWaitUpCount
|
swShowWaitUpBooks.isChecked = AppConfig.showWaitUpCount
|
||||||
|
swShowBookshelfFastScroller.isChecked = AppConfig.showBookshelfFastScroller
|
||||||
rgLayout.checkByIndex(bookshelfLayout)
|
rgLayout.checkByIndex(bookshelfLayout)
|
||||||
rgSort.checkByIndex(bookshelfSort)
|
rgSort.checkByIndex(bookshelfSort)
|
||||||
}
|
}
|
||||||
@@ -168,6 +169,10 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
|||||||
AppConfig.showWaitUpCount = swShowWaitUpBooks.isChecked
|
AppConfig.showWaitUpCount = swShowWaitUpBooks.isChecked
|
||||||
activityViewModel.postUpBooksLiveData(true)
|
activityViewModel.postUpBooksLiveData(true)
|
||||||
}
|
}
|
||||||
|
if (AppConfig.showBookshelfFastScroller != swShowBookshelfFastScroller.isChecked) {
|
||||||
|
AppConfig.showBookshelfFastScroller = swShowBookshelfFastScroller.isChecked
|
||||||
|
postEvent(EventBus.BOOKSHELF_REFRESH, "")
|
||||||
|
}
|
||||||
if (bookshelfSort != rgSort.getCheckedIndex()) {
|
if (bookshelfSort != rgSort.getCheckedIndex()) {
|
||||||
AppConfig.bookshelfSort = rgSort.getCheckedIndex()
|
AppConfig.bookshelfSort = rgSort.getCheckedIndex()
|
||||||
upSort()
|
upSort()
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
var bookSort = 0
|
var bookSort = 0
|
||||||
private set
|
private set
|
||||||
private var upLastUpdateTimeJob: Job? = null
|
private var upLastUpdateTimeJob: Job? = null
|
||||||
|
private var defaultScrollBarSize = 0
|
||||||
|
|
||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
this.savedInstanceState = savedInstanceState
|
this.savedInstanceState = savedInstanceState
|
||||||
@@ -86,6 +87,8 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
|
|
||||||
private fun initRecyclerView() {
|
private fun initRecyclerView() {
|
||||||
binding.rvBookshelf.setEdgeEffectColor(primaryColor)
|
binding.rvBookshelf.setEdgeEffectColor(primaryColor)
|
||||||
|
defaultScrollBarSize = binding.rvBookshelf.scrollBarSize
|
||||||
|
upFastScrollerBar()
|
||||||
binding.refreshLayout.setColorSchemeColors(accentColor)
|
binding.refreshLayout.setColorSchemeColors(accentColor)
|
||||||
binding.refreshLayout.setOnRefreshListener {
|
binding.refreshLayout.setOnRefreshListener {
|
||||||
binding.refreshLayout.isRefreshing = false
|
binding.refreshLayout.isRefreshing = false
|
||||||
@@ -117,6 +120,16 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
startLastUpdateTimeJob()
|
startLastUpdateTimeJob()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun upFastScrollerBar() {
|
||||||
|
val showBookshelfFastScroller = AppConfig.showBookshelfFastScroller
|
||||||
|
binding.rvBookshelf.setFastScrollEnabled(showBookshelfFastScroller)
|
||||||
|
if (showBookshelfFastScroller) {
|
||||||
|
binding.rvBookshelf.scrollBarSize = 0
|
||||||
|
} else {
|
||||||
|
binding.rvBookshelf.scrollBarSize = defaultScrollBarSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun upBookSort(sort: Int) {
|
fun upBookSort(sort: Int) {
|
||||||
binding.root.post {
|
binding.root.post {
|
||||||
arguments?.putInt("bookSort", sort)
|
arguments?.putInt("bookSort", sort)
|
||||||
@@ -275,6 +288,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
|
|||||||
observeEvent<String>(EventBus.BOOKSHELF_REFRESH) {
|
observeEvent<String>(EventBus.BOOKSHELF_REFRESH) {
|
||||||
booksAdapter.notifyDataSetChanged()
|
booksAdapter.notifyDataSetChanged()
|
||||||
startLastUpdateTimeJob()
|
startLastUpdateTimeJob()
|
||||||
|
upFastScrollerBar()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,13 +58,22 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@+id/sw_show_last_update_time"
|
app:layout_constraintTop_toBottomOf="@+id/sw_show_last_update_time"
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
|
<io.legado.app.lib.theme.view.ThemeSwitch
|
||||||
|
android:id="@+id/sw_show_bookshelf_fast_scroller"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:text="@string/show_bookshelf_fast_scroller"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/sw_show_wait_up_books"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_layout"
|
android:id="@+id/ll_layout"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintRight_toLeftOf="@+id/ll_sort"
|
app:layout_constraintRight_toLeftOf="@+id/ll_sort"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sw_show_wait_up_books"
|
app:layout_constraintTop_toBottomOf="@+id/sw_show_bookshelf_fast_scroller"
|
||||||
app:layout_constraintLeft_toLeftOf="parent">
|
app:layout_constraintLeft_toLeftOf="parent">
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentTextView
|
<io.legado.app.ui.widget.text.AccentTextView
|
||||||
@@ -119,7 +128,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintLeft_toRightOf="@+id/ll_layout"
|
app:layout_constraintLeft_toRightOf="@+id/ll_layout"
|
||||||
app:layout_constraintTop_toBottomOf="@id/sw_show_wait_up_books"
|
app:layout_constraintTop_toBottomOf="@id/sw_show_bookshelf_fast_scroller"
|
||||||
app:layout_constraintRight_toRightOf="parent">
|
app:layout_constraintRight_toRightOf="parent">
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentTextView
|
<io.legado.app.ui.widget.text.AccentTextView
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
android:id="@+id/rv_bookshelf"
|
android:id="@+id/rv_bookshelf"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scrollbars="none"
|
|
||||||
tools:listitem="@layout/item_bookshelf_list" />
|
tools:listitem="@layout/item_bookshelf_list" />
|
||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|||||||
@@ -1131,4 +1131,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="use_lib_archive">Use LibArchive</string>
|
<string name="use_lib_archive">Use LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1134,4 +1134,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="use_lib_archive">Use LibArchive</string>
|
<string name="use_lib_archive">Use LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1134,4 +1134,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="use_lib_archive">Use LibArchive</string>
|
<string name="use_lib_archive">Use LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1129,4 +1129,5 @@ Còn </string>
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="use_lib_archive">Use LibArchive</string>
|
<string name="use_lib_archive">Use LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1130,4 +1130,5 @@
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="use_lib_archive">使用LibArchive</string>
|
<string name="use_lib_archive">使用LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">使用libarchive解壓檔案,支持解壓RAR5。</string>
|
<string name="pref_use_lib_archive_summary">使用libarchive解壓檔案,支持解壓RAR5。</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1132,4 +1132,5 @@
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="use_lib_archive">使用LibArchive</string>
|
<string name="use_lib_archive">使用LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">使用libarchive解壓檔案,支持解壓RAR5。</string>
|
<string name="pref_use_lib_archive_summary">使用libarchive解壓檔案,支持解壓RAR5。</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1132,4 +1132,5 @@
|
|||||||
<string name="export_wait">等待导出</string>
|
<string name="export_wait">等待导出</string>
|
||||||
<string name="use_lib_archive">使用LibArchive</string>
|
<string name="use_lib_archive">使用LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">使用libarchive解压文件,支持解压RAR5。</string>
|
<string name="pref_use_lib_archive_summary">使用libarchive解压文件,支持解压RAR5。</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1134,4 +1134,5 @@
|
|||||||
<string name="default_home_page">默认主页</string>
|
<string name="default_home_page">默认主页</string>
|
||||||
<string name="use_lib_archive">Use LibArchive</string>
|
<string name="use_lib_archive">Use LibArchive</string>
|
||||||
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
<string name="pref_use_lib_archive_summary">Using libarchive to extract files, it supports extracting RAR5.</string>
|
||||||
|
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ plugins {
|
|||||||
id 'com.android.library' version "$agp_version" apply false
|
id 'com.android.library' version "$agp_version" apply false
|
||||||
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
|
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
|
||||||
id 'com.google.devtools.ksp' version "$kotlin_version-$ksp_version" apply false
|
id 'com.google.devtools.ksp' version "$kotlin_version-$ksp_version" apply false
|
||||||
id "de.undercouch.download" version "5.4.0" apply false
|
id "de.undercouch.download" version "5.5.0" apply false
|
||||||
id "com.google.gms.google-services" version "4.3.15" apply false
|
id "com.google.gms.google-services" version "4.3.15" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -42,7 +42,7 @@ android.defaults.buildfeatures.shaders=false
|
|||||||
# and none from the library's dependencies, thereby reducing the size of the R class for that library.
|
# and none from the library's dependencies, thereby reducing the size of the R class for that library.
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
# https://chromiumdash.appspot.com/releases?platform=Android
|
# https://chromiumdash.appspot.com/releases?platform=Android
|
||||||
CronetVersion=115.0.5790.138
|
CronetVersion=117.0.5938.60
|
||||||
CronetMainVersion=115.0.0.0
|
CronetMainVersion=117.0.0.0
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
android.nonFinalResIds=true
|
android.nonFinalResIds=true
|
||||||
Reference in New Issue
Block a user