feat: 优化代码

pull/141/head
kunfei 5 years ago
parent 34289d75d2
commit 269ca4fe09
  1. 12
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt

@ -137,13 +137,17 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b
override fun upGroup() { override fun upGroup() {
synchronized(this) { synchronized(this) {
bookGroups.remove(AppConst.bookGroupAll)
bookGroups.remove(AppConst.bookGroupLocal) bookGroups.remove(AppConst.bookGroupLocal)
bookGroups.remove(AppConst.bookGroupAudio) bookGroups.remove(AppConst.bookGroupAudio)
if (getPrefBoolean("bookGroupAudio", true)) { if (AppConfig.bookGroupAudioShow) {
bookGroups.add(1, AppConst.bookGroupAudio) bookGroups.add(0, AppConst.bookGroupAudio)
}
if (AppConfig.bookGroupLocalShow) {
bookGroups.add(0, AppConst.bookGroupLocal)
} }
if (getPrefBoolean("bookGroupLocal", true)) { if (AppConfig.bookGroupAllShow) {
bookGroups.add(1, AppConst.bookGroupLocal) bookGroups.add(0, AppConst.bookGroupAll)
} }
bookshelfAdapter.notifyDataSetChanged() bookshelfAdapter.notifyDataSetChanged()
} }

Loading…
Cancel
Save