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