pull/1754/head^2
kunfei 3 years ago
parent d31f311c39
commit d79e3d09b5
  1. 2
      app/src/main/AndroidManifest.xml
  2. 4
      app/src/main/java/io/legado/app/ui/book/management/BookAdapter.kt
  3. 11
      app/src/main/java/io/legado/app/ui/book/management/BookshelfManageActivity.kt
  4. 4
      app/src/main/java/io/legado/app/ui/book/management/BookshelfManageViewModel.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/management/ComposeView.kt
  6. 2
      app/src/main/java/io/legado/app/ui/book/management/SourcePickerDialog.kt
  7. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt
  8. 2
      app/src/main/res/layout/activity_arrange_book.xml
  9. 12
      app/src/main/res/menu/main_bookshelf.xml
  10. 2
      app/src/main/res/values-es-rES/strings.xml
  11. 2
      app/src/main/res/values-ja-rJP/strings.xml
  12. 2
      app/src/main/res/values-pt-rBR/strings.xml
  13. 2
      app/src/main/res/values-zh-rHK/strings.xml
  14. 2
      app/src/main/res/values-zh-rTW/strings.xml
  15. 2
      app/src/main/res/values-zh/strings.xml
  16. 2
      app/src/main/res/values/strings.xml

@ -249,7 +249,7 @@
android:screenOrientation="behind" /> android:screenOrientation="behind" />
<!-- 书籍管理 --> <!-- 书籍管理 -->
<activity <activity
android:name=".ui.book.arrange.ArrangeBookActivity" android:name=".ui.book.management.BookshelfManageActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="behind" /> android:screenOrientation="behind" />
<!-- 书源调试 --> <!-- 书源调试 -->

@ -1,4 +1,4 @@
package io.legado.app.ui.book.arrange package io.legado.app.ui.book.management
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
@ -15,7 +15,7 @@ import io.legado.app.lib.theme.backgroundColor
import io.legado.app.ui.widget.recycler.DragSelectTouchHelper import io.legado.app.ui.widget.recycler.DragSelectTouchHelper
import io.legado.app.ui.widget.recycler.ItemTouchCallback import io.legado.app.ui.widget.recycler.ItemTouchCallback
class ArrangeBookAdapter(context: Context, val callBack: CallBack) : class BookAdapter(context: Context, val callBack: CallBack) :
RecyclerAdapter<Book, ItemArrangeBookBinding>(context), RecyclerAdapter<Book, ItemArrangeBookBinding>(context),
ItemTouchCallback.Callback { ItemTouchCallback.Callback {

@ -1,4 +1,4 @@
package io.legado.app.ui.book.arrange package io.legado.app.ui.book.management
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
@ -39,19 +39,20 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
class ArrangeBookActivity : VMBaseActivity<ActivityArrangeBookBinding, ArrangeBookViewModel>(), class BookshelfManageActivity :
VMBaseActivity<ActivityArrangeBookBinding, BookshelfManageViewModel>(),
PopupMenu.OnMenuItemClickListener, PopupMenu.OnMenuItemClickListener,
SelectActionBar.CallBack, SelectActionBar.CallBack,
ArrangeBookAdapter.CallBack, BookAdapter.CallBack,
SourcePickerDialog.Callback, SourcePickerDialog.Callback,
GroupSelectDialog.CallBack { GroupSelectDialog.CallBack {
override val binding by viewBinding(ActivityArrangeBookBinding::inflate) override val binding by viewBinding(ActivityArrangeBookBinding::inflate)
override val viewModel by viewModels<ArrangeBookViewModel>() override val viewModel by viewModels<BookshelfManageViewModel>()
override val groupList: ArrayList<BookGroup> = arrayListOf() override val groupList: ArrayList<BookGroup> = arrayListOf()
private val groupRequestCode = 22 private val groupRequestCode = 22
private val addToGroupRequestCode = 34 private val addToGroupRequestCode = 34
private val adapter by lazy { ArrangeBookAdapter(this, this) } private val adapter by lazy { BookAdapter(this, this) }
private var booksFlowJob: Job? = null private var booksFlowJob: Job? = null
private var menu: Menu? = null private var menu: Menu? = null
private var groupId: Long = -1 private var groupId: Long = -1

@ -1,4 +1,4 @@
package io.legado.app.ui.book.arrange package io.legado.app.ui.book.management
import android.app.Application import android.app.Application
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
@ -10,7 +10,7 @@ import io.legado.app.help.coroutine.Coroutine
import io.legado.app.model.webBook.WebBook import io.legado.app.model.webBook.WebBook
class ArrangeBookViewModel(application: Application) : BaseViewModel(application) { class BookshelfManageViewModel(application: Application) : BaseViewModel(application) {
val batchChangeSourceState = mutableStateOf(false) val batchChangeSourceState = mutableStateOf(false)
val batchChangeSourceSize = mutableStateOf(0) val batchChangeSourceSize = mutableStateOf(0)

@ -1,4 +1,4 @@
package io.legado.app.ui.book.arrange package io.legado.app.ui.book.management
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.material.AlertDialog import androidx.compose.material.AlertDialog

@ -1,4 +1,4 @@
package io.legado.app.ui.book.arrange package io.legado.app.ui.book.management
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle

@ -19,10 +19,10 @@ import io.legado.app.help.DirectLinkUpload
import io.legado.app.help.config.AppConfig import io.legado.app.help.config.AppConfig
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.ui.about.AppLogDialog import io.legado.app.ui.about.AppLogDialog
import io.legado.app.ui.book.arrange.ArrangeBookActivity
import io.legado.app.ui.book.cache.CacheActivity import io.legado.app.ui.book.cache.CacheActivity
import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.group.GroupManageDialog
import io.legado.app.ui.book.local.ImportBookActivity import io.legado.app.ui.book.local.ImportBookActivity
import io.legado.app.ui.book.management.BookshelfManageActivity
import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.search.SearchActivity
import io.legado.app.ui.document.HandleFileContract import io.legado.app.ui.document.HandleFileContract
import io.legado.app.ui.main.MainViewModel import io.legado.app.ui.main.MainViewModel
@ -80,7 +80,7 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>() R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>()
R.id.menu_add_local -> startActivity<ImportBookActivity>() R.id.menu_add_local -> startActivity<ImportBookActivity>()
R.id.menu_add_url -> addBookByUrl() R.id.menu_add_url -> addBookByUrl()
R.id.menu_arrange_bookshelf -> startActivity<ArrangeBookActivity> { R.id.menu_bookshelf_manage -> startActivity<BookshelfManageActivity> {
putExtra("groupId", groupId) putExtra("groupId", groupId)
} }
R.id.menu_download -> startActivity<CacheActivity> { R.id.menu_download -> startActivity<CacheActivity> {

@ -9,7 +9,7 @@
android:id="@+id/title_bar" android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:title="@string/arrange_bookshelf" app:title="@string/bookshelf_management"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView

@ -28,6 +28,12 @@
android:title="@string/add_url" android:title="@string/add_url"
app:showAsAction="never" /> app:showAsAction="never" />
<item
android:id="@+id/menu_bookshelf_manage"
android:icon="@drawable/ic_arrange"
android:title="@string/bookshelf_management"
app:showAsAction="never" />
<item <item
android:id="@+id/menu_download" android:id="@+id/menu_download"
android:icon="@drawable/ic_download_line" android:icon="@drawable/ic_download_line"
@ -46,12 +52,6 @@
android:title="@string/bookshelf_layout" android:title="@string/bookshelf_layout"
app:showAsAction="never" /> app:showAsAction="never" />
<item
android:id="@+id/menu_arrange_bookshelf"
android:icon="@drawable/ic_arrange"
android:title="@string/arrange_bookshelf"
app:showAsAction="never" />
<item <item
android:id="@+id/menu_export_bookshelf" android:id="@+id/menu_export_bookshelf"
android:icon="@drawable/ic_export" android:icon="@drawable/ic_export"

@ -267,7 +267,7 @@
<string name="load_over_time">Tiempo límite de carga</string> <string name="load_over_time">Tiempo límite de carga</string>
<string name="join_group">Siga:%s</string> <string name="join_group">Siga:%s</string>
<string name="copy_complete">Copiado con éxito</string> <string name="copy_complete">Copiado con éxito</string>
<string name="arrange_bookshelf">Organización de estantería</string> <string name="bookshelf_management">Organización de estantería</string>
<string name="clear_bookshelf_s">Esto borrará a todos los libros. Por favor, tenga cuidado.</string> <string name="clear_bookshelf_s">Esto borrará a todos los libros. Por favor, tenga cuidado.</string>
<string name="search_book_source">Buscar fuentes de libros</string> <string name="search_book_source">Buscar fuentes de libros</string>
<string name="search_rss_source">Buscar fuentes de suscripción</string> <string name="search_rss_source">Buscar fuentes de suscripción</string>

@ -271,7 +271,7 @@
<string name="load_over_time">Loading timeout</string> <string name="load_over_time">Loading timeout</string>
<string name="join_group">Follow:%s</string> <string name="join_group">Follow:%s</string>
<string name="copy_complete">Copied successfully</string> <string name="copy_complete">Copied successfully</string>
<string name="arrange_bookshelf">Bookshelf arrangement</string> <string name="bookshelf_management">Bookshelf management</string>
<string name="clear_bookshelf_s">It will delete all books. Be careful,please.</string> <string name="clear_bookshelf_s">It will delete all books. Be careful,please.</string>
<string name="search_book_source">Search book sources</string> <string name="search_book_source">Search book sources</string>
<string name="search_rss_source">Search subscription sources</string> <string name="search_rss_source">Search subscription sources</string>

@ -271,7 +271,7 @@
<string name="load_over_time">Tempo limite de carregamento</string> <string name="load_over_time">Tempo limite de carregamento</string>
<string name="join_group">Siga:%s</string> <string name="join_group">Siga:%s</string>
<string name="copy_complete">Copiado com sucesso</string> <string name="copy_complete">Copiado com sucesso</string>
<string name="arrange_bookshelf">A organização da estante</string> <string name="bookshelf_management">A organização da estante</string>
<string name="clear_bookshelf_s">Isto excluirá todos os livros. Por favor, tenha cuidado.</string> <string name="clear_bookshelf_s">Isto excluirá todos os livros. Por favor, tenha cuidado.</string>
<string name="search_book_source">Pesquisar fontes de livros</string> <string name="search_book_source">Pesquisar fontes de livros</string>
<string name="search_rss_source">Buscar fontes de assinatura</string> <string name="search_rss_source">Buscar fontes de assinatura</string>

@ -268,7 +268,7 @@
<string name="load_over_time">加載超時</string> <string name="load_over_time">加載超時</string>
<string name="join_group">關注: %s</string> <string name="join_group">關注: %s</string>
<string name="copy_complete">拷貝咗</string> <string name="copy_complete">拷貝咗</string>
<string name="arrange_bookshelf">整理書架</string> <string name="bookshelf_management">書架管理</string>
<string name="clear_bookshelf_s">這將會刪除所有書籍,請謹慎操作。</string> <string name="clear_bookshelf_s">這將會刪除所有書籍,請謹慎操作。</string>
<string name="search_book_source">搜索書源</string> <string name="search_book_source">搜索書源</string>
<string name="search_rss_source">搜索訂閲源</string> <string name="search_rss_source">搜索訂閲源</string>

@ -270,7 +270,7 @@
<string name="load_over_time">載入超時</string> <string name="load_over_time">載入超時</string>
<string name="join_group">關注:%s</string> <string name="join_group">關注:%s</string>
<string name="copy_complete">已複製</string> <string name="copy_complete">已複製</string>
<string name="arrange_bookshelf">整理書架</string> <string name="bookshelf_management">書架管理</string>
<string name="clear_bookshelf_s">這將會刪除所有書籍,請謹慎操作。</string> <string name="clear_bookshelf_s">這將會刪除所有書籍,請謹慎操作。</string>
<string name="search_book_source">搜尋書源</string> <string name="search_book_source">搜尋書源</string>
<string name="search_rss_source">搜尋訂閱源</string> <string name="search_rss_source">搜尋訂閱源</string>

@ -270,7 +270,7 @@
<string name="load_over_time">加载超时</string> <string name="load_over_time">加载超时</string>
<string name="join_group">关注:%s</string> <string name="join_group">关注:%s</string>
<string name="copy_complete">已拷贝</string> <string name="copy_complete">已拷贝</string>
<string name="arrange_bookshelf">整理书架</string> <string name="bookshelf_management">书架管理</string>
<string name="clear_bookshelf_s">这将会删除所有书籍,请谨慎操作。</string> <string name="clear_bookshelf_s">这将会删除所有书籍,请谨慎操作。</string>
<string name="search_book_source">搜索书源</string> <string name="search_book_source">搜索书源</string>
<string name="search_rss_source">搜索订阅源</string> <string name="search_rss_source">搜索订阅源</string>

@ -271,7 +271,7 @@
<string name="load_over_time">Loading timeout</string> <string name="load_over_time">Loading timeout</string>
<string name="join_group">Follow:%s</string> <string name="join_group">Follow:%s</string>
<string name="copy_complete">Copied successfully</string> <string name="copy_complete">Copied successfully</string>
<string name="arrange_bookshelf">Bookshelf arrangement</string> <string name="bookshelf_management">Bookshelf management</string>
<string name="clear_bookshelf_s">It will delete all books. Be careful,please.</string> <string name="clear_bookshelf_s">It will delete all books. Be careful,please.</string>
<string name="search_book_source">Search book sources</string> <string name="search_book_source">Search book sources</string>
<string name="search_rss_source">Search subscription sources</string> <string name="search_rss_source">Search subscription sources</string>

Loading…
Cancel
Save