pull/1434/head
gedoor 3 years ago
parent cd79e497da
commit 207bb56f56
  1. 2
      app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt
  2. 16
      app/src/main/res/menu/txt_toc_rule_item.xml

@ -78,7 +78,7 @@ class TxtTocRuleAdapter(context: Context, private val callBack: CallBack) :
private fun showMenu(view: View, position: Int) { private fun showMenu(view: View, position: Int) {
val source = getItem(position) ?: return val source = getItem(position) ?: return
val popupMenu = PopupMenu(context, view) val popupMenu = PopupMenu(context, view)
popupMenu.inflate(R.menu.rss_source_item) popupMenu.inflate(R.menu.txt_toc_rule_item)
popupMenu.setOnMenuItemClickListener { menuItem -> popupMenu.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) { when (menuItem.itemId) {
R.id.menu_top -> callBack.toTop(source) R.id.menu_top -> callBack.toTop(source)

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_top"
android:title="@string/to_top" />
<item
android:id="@+id/menu_bottom"
android:title="@string/to_bottom" />
<item
android:id="@+id/menu_del"
android:title="@string/delete" />
</menu>
Loading…
Cancel
Save