|
|
@ -93,6 +93,7 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b |
|
|
|
bookGroupLiveData = App.db.bookGroupDao().liveDataAll() |
|
|
|
bookGroupLiveData = App.db.bookGroupDao().liveDataAll() |
|
|
|
bookGroupLiveData?.observe(viewLifecycleOwner, Observer { |
|
|
|
bookGroupLiveData?.observe(viewLifecycleOwner, Observer { |
|
|
|
synchronized(this) { |
|
|
|
synchronized(this) { |
|
|
|
|
|
|
|
tab_layout.removeOnTabSelectedListener(this) |
|
|
|
bookGroups.clear() |
|
|
|
bookGroups.clear() |
|
|
|
bookGroups.add(AppConst.bookGroupAll) |
|
|
|
bookGroups.add(AppConst.bookGroupAll) |
|
|
|
if (AppConst.bookGroupLocalShow) { |
|
|
|
if (AppConst.bookGroupLocalShow) { |
|
|
@ -104,7 +105,6 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b |
|
|
|
bookGroups.addAll(it) |
|
|
|
bookGroups.addAll(it) |
|
|
|
view_pager_bookshelf.adapter?.notifyDataSetChanged() |
|
|
|
view_pager_bookshelf.adapter?.notifyDataSetChanged() |
|
|
|
tab_layout.getTabAt(getPrefInt(PreferKey.saveTabPosition, 0))?.select() |
|
|
|
tab_layout.getTabAt(getPrefInt(PreferKey.saveTabPosition, 0))?.select() |
|
|
|
tab_layout.removeOnTabSelectedListener(this) |
|
|
|
|
|
|
|
tab_layout.addOnTabSelectedListener(this) |
|
|
|
tab_layout.addOnTabSelectedListener(this) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|