|
|
|
@ -12,6 +12,7 @@ import com.google.android.material.tabs.TabLayout |
|
|
|
|
import io.legado.app.App |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.VMBaseFragment |
|
|
|
|
import io.legado.app.constant.AppConst |
|
|
|
|
import io.legado.app.constant.EventBus |
|
|
|
|
import io.legado.app.constant.PreferKey |
|
|
|
|
import io.legado.app.data.entities.BookGroup |
|
|
|
@ -123,11 +124,15 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b |
|
|
|
|
|
|
|
|
|
@Synchronized |
|
|
|
|
private fun upGroup(data: List<BookGroup>) { |
|
|
|
|
if (data.isEmpty()) { |
|
|
|
|
App.db.bookGroupDao().enableGroup(AppConst.bookGroupAllId) |
|
|
|
|
} else { |
|
|
|
|
bookGroups.clear() |
|
|
|
|
bookGroups.addAll(data) |
|
|
|
|
adapter.notifyDataSetChanged() |
|
|
|
|
selectLastTab() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Synchronized |
|
|
|
|
private fun selectLastTab() { |
|
|
|
|