mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
cd79e497da
commit
207bb56f56
@ -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)
|
||||||
|
16
app/src/main/res/menu/txt_toc_rule_item.xml
Normal file
16
app/src/main/res/menu/txt_toc_rule_item.xml
Normal file
@ -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…
Reference in New Issue
Block a user