From bd7b136e8ed5c2f09b3dcc090d5be21a71e4aab9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 24 Jan 2020 16:14:25 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 86a209bad..5b946d74d 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -93,6 +93,7 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b bookGroupLiveData = App.db.bookGroupDao().liveDataAll() bookGroupLiveData?.observe(viewLifecycleOwner, Observer { synchronized(this) { + tab_layout.removeOnTabSelectedListener(this) bookGroups.clear() bookGroups.add(AppConst.bookGroupAll) if (AppConst.bookGroupLocalShow) { @@ -104,7 +105,6 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b bookGroups.addAll(it) view_pager_bookshelf.adapter?.notifyDataSetChanged() tab_layout.getTabAt(getPrefInt(PreferKey.saveTabPosition, 0))?.select() - tab_layout.removeOnTabSelectedListener(this) tab_layout.addOnTabSelectedListener(this) } })