From f9233ffb736bb6c44c66b4a5e6e796fda5b3b2df Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 15 Jun 2023 22:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/data/dao/BookSourceDao.kt | 13 +- .../book/source/manage/BookSourceActivity.kt | 36 +++--- app/src/main/res/menu/book_source.xml | 111 ++++++++++-------- app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-ja-rJP/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 10 files changed, 92 insertions(+), 75 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt b/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt index 1e4188492..bb88566c7 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt @@ -96,14 +96,16 @@ interface BookSourceDao { @Query( """select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore, trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl - from book_sources where loginUrl is not null and loginUrl != ''""" + from book_sources where loginUrl is not null and loginUrl != '' + order by customOrder asc""" ) fun flowLogin(): Flow> @Query( """select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore, trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl - from book_sources where bookSourceGroup is null or bookSourceGroup = '' or bookSourceGroup like '%未分组%'""" + from book_sources where bookSourceGroup is null or bookSourceGroup = '' or bookSourceGroup like '%未分组%' + order by customOrder asc""" ) fun flowNoGroup(): Flow> @@ -144,7 +146,7 @@ interface BookSourceDao { ) fun flowExploreGroupsUnProcessed(): Flow> - @Query("select * from book_sources where bookSourceGroup like '%' || :group || '%'") + @Query("select * from book_sources where bookSourceGroup like '%' || :group || '%' order by customOrder asc") fun getByGroup(group: String): List @Query( @@ -153,11 +155,12 @@ interface BookSourceDao { and (bookSourceGroup = :group or bookSourceGroup like :group || ',%' or bookSourceGroup like '%,' || :group - or bookSourceGroup like '%,' || :group || ',%')""" + or bookSourceGroup like '%,' || :group || ',%') + order by customOrder asc""" ) fun getEnabledByGroup(group: String): List - @Query("select * from book_sources where bookUrlPattern != 'NONE' and bookSourceType = :type") + @Query("select * from book_sources where bookUrlPattern != 'NONE' and bookSourceType = :type order by customOrder asc") fun getEnabledByType(type: Int): List @Query("select * from book_sources where enabled = 1 and bookSourceUrl = :baseUrl") diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 7dd8414e4..29e9fa3dd 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -128,9 +128,9 @@ class BookSourceActivity : VMBaseActivity showImportDialog() + + R.id.menu_sort_desc -> { + sortAscending = !sortAscending + item.isChecked = !sortAscending + upBookSource(searchView.query?.toString()) + } + R.id.menu_sort_manual -> { item.isChecked = true - sortCheck(Sort.Default) + sort = Sort.Default upBookSource(searchView.query?.toString()) } R.id.menu_sort_auto -> { item.isChecked = true - sortCheck(Sort.Weight) + sort = Sort.Weight upBookSource(searchView.query?.toString()) } R.id.menu_sort_name -> { item.isChecked = true - sortCheck(Sort.Name) + sort = Sort.Name upBookSource(searchView.query?.toString()) } R.id.menu_sort_url -> { item.isChecked = true - sortCheck(Sort.Url) + sort = Sort.Url upBookSource(searchView.query?.toString()) } R.id.menu_sort_time -> { item.isChecked = true - sortCheck(Sort.Update) + sort = Sort.Update upBookSource(searchView.query?.toString()) } R.id.menu_sort_respondTime -> { item.isChecked = true - sortCheck(Sort.Respond) + sort = Sort.Respond upBookSource(searchView.query?.toString()) } R.id.menu_sort_enable -> { item.isChecked = true - sortCheck(Sort.Enable) + sort = Sort.Enable upBookSource(searchView.query?.toString()) } @@ -321,15 +328,6 @@ class BookSourceActivity : VMBaseActivity - - - - - - - - - - - - - - - - - - - - - - - - - @@ -91,6 +40,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 压缩数据库 减小数据库文件的大小 是否压缩 + 反序 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index e2731e105..5d47afb79 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -1116,4 +1116,5 @@ 压缩数据库 减小数据库文件的大小 是否压缩 + 反序 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 560dea21a..670fe4b3d 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1116,4 +1116,5 @@ 压缩数据库 减小数据库文件的大小 是否压缩 + 反序 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 25d9dbdb3..31f918106 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1113,4 +1113,5 @@ 压缩数据库 减小数据库文件的大小 是否压缩 + 反序 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 5d3a7929b..343e27c14 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1115,4 +1115,5 @@ 压缩数据库 减小数据库文件的大小 是否压缩 + 反序 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index a57ada17c..117dd31dc 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1115,4 +1115,5 @@ 压缩数据库 减小数据库文件的大小 是否压缩 + 反序 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32e163236..d33591618 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1116,4 +1116,5 @@ 压缩数据库 减小数据库文件的大小 是否压缩 + 反序