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() {
synchronized(this) {
bookGroups.remove(AppConst.bookGroupAll)
bookGroups.remove(AppConst.bookGroupLocal)
bookGroups.remove(AppConst.bookGroupAudio)
if (getPrefBoolean("bookGroupAudio", true)) {
bookGroups.add(1, AppConst.bookGroupAudio)
if (AppConfig.bookGroupAudioShow) {
bookGroups.add(0, AppConst.bookGroupAudio)
}
if (getPrefBoolean("bookGroupLocal", true)) {
bookGroups.add(1, AppConst.bookGroupLocal)
if (AppConfig.bookGroupLocalShow) {
bookGroups.add(0, AppConst.bookGroupLocal)
}
if (AppConfig.bookGroupAllShow) {
bookGroups.add(0, AppConst.bookGroupAll)
}
bookshelfAdapter.notifyDataSetChanged()
}

Loading…
Cancel
Save