pull/90/head^2
kunfei 5 years ago
parent e35bafb0f7
commit 541c2cecf5
  1. 10
      app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt
  2. 7
      app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt
  3. 1
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  4. 1
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt

@ -1,4 +1,4 @@
package io.legado.app.ui.main.bookshelf
package io.legado.app.ui.book.group
import android.annotation.SuppressLint
import android.content.Context
@ -25,6 +25,7 @@ import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.customView
import io.legado.app.lib.dialogs.noButton
import io.legado.app.lib.dialogs.yesButton
import io.legado.app.ui.main.bookshelf.BookshelfViewModel
import io.legado.app.utils.applyTint
import io.legado.app.utils.getViewModel
import io.legado.app.utils.requestInputMethod
@ -77,7 +78,12 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
recycler_view.adapter = adapter
App.db.bookGroupDao().liveDataAll().observe(viewLifecycleOwner, Observer {
val diffResult =
DiffUtil.calculateDiff(GroupDiffCallBack(adapter.getItems(), it))
DiffUtil.calculateDiff(
GroupDiffCallBack(
adapter.getItems(),
it
)
)
adapter.setItems(it, false)
diffResult.dispatchUpdatesTo(adapter)
})

@ -1,4 +1,4 @@
package io.legado.app.ui.book.info
package io.legado.app.ui.book.group
import android.annotation.SuppressLint
import android.content.Context
@ -44,7 +44,10 @@ class GroupSelectDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
fun show(manager: FragmentManager) {
val fragment = GroupSelectDialog()
fragment.show(manager, tag)
fragment.show(
manager,
tag
)
}
}

@ -21,6 +21,7 @@ import io.legado.app.help.BlurTransformation
import io.legado.app.help.ImageLoader
import io.legado.app.help.IntentDataHelp
import io.legado.app.ui.audio.AudioPlayActivity
import io.legado.app.ui.book.group.GroupSelectDialog
import io.legado.app.ui.book.info.edit.BookInfoEditActivity
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.book.source.edit.BookSourceEditActivity

@ -22,6 +22,7 @@ import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.lib.theme.view.ATEAutoCompleteTextView
import io.legado.app.ui.book.arrange.ArrangeBookActivity
import io.legado.app.ui.book.group.GroupManageDialog
import io.legado.app.ui.book.search.SearchActivity
import io.legado.app.ui.download.DownloadActivity
import io.legado.app.ui.importbook.ImportBookActivity

Loading…
Cancel
Save