pull/433/head
gedoor 4 years ago
parent d554ca1b89
commit 273402df5d
  1. 20
      app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt
  3. 16
      app/src/main/res/menu/arrange_book.xml

@ -133,26 +133,6 @@ class ArrangeBookActivity : VMBaseActivity<ArrangeBookViewModel>(R.layout.activi
when (item.itemId) { when (item.itemId) {
R.id.menu_group_manage -> GroupManageDialog() R.id.menu_group_manage -> GroupManageDialog()
.show(supportFragmentManager, "groupManage") .show(supportFragmentManager, "groupManage")
R.id.menu_no_group -> {
title_bar.subtitle = getString(R.string.no_group)
groupId = AppConst.bookGroupNoneId
initBookData()
}
R.id.menu_all -> {
title_bar.subtitle = item.title
groupId = AppConst.bookGroupAllId
initBookData()
}
R.id.menu_local -> {
title_bar.subtitle = item.title
groupId = AppConst.bookGroupLocalId
initBookData()
}
R.id.menu_audio -> {
title_bar.subtitle = item.title
groupId = AppConst.bookGroupAudioId
initBookData()
}
else -> if (item.groupId == R.id.menu_group) { else -> if (item.groupId == R.id.menu_group) {
title_bar.subtitle = item.title title_bar.subtitle = item.title
groupId = App.db.bookGroupDao().getByName(item.title.toString())?.groupId ?: 0 groupId = App.db.bookGroupDao().getByName(item.title.toString())?.groupId ?: 0

@ -112,7 +112,7 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) :
private fun getGroupList(groupId: Long): List<String> { private fun getGroupList(groupId: Long): List<String> {
val groupNames = arrayListOf<String>() val groupNames = arrayListOf<String>()
callBack.groupList.forEach { callBack.groupList.forEach {
if (it.groupId and groupId > 0) { if (it.groupId > 0 && it.groupId and groupId > 0) {
groupNames.add(it.groupName) groupNames.add(it.groupName)
} }
} }

@ -14,22 +14,6 @@
android:id="@+id/menu_group_manage" android:id="@+id/menu_group_manage"
android:title="@string/group_manage" /> android:title="@string/group_manage" />
<item
android:id="@+id/menu_no_group"
android:title="@string/no_group" />
<item
android:id="@+id/menu_all"
android:title="@string/all" />
<item
android:id="@+id/menu_local"
android:title="@string/local" />
<item
android:id="@+id/menu_audio"
android:title="@string/audio" />
</menu> </menu>
</item> </item>

Loading…
Cancel
Save