pull/32/head
kunfei 5 years ago
parent 6843f39ccf
commit fd09c699eb
  1. 32
      app/src/main/java/io/legado/app/ui/widget/page/ContentSelectActionCallback.kt
  2. 1
      app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt
  3. 9
      app/src/main/res/menu/content_select_action.xml

@ -0,0 +1,32 @@
package io.legado.app.ui.widget.page
import android.view.ActionMode
import android.view.Menu
import android.view.MenuItem
import io.legado.app.R
object ContentSelectActionCallback : ActionMode.Callback {
override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?): Boolean {
when (item?.itemId) {
R.id.menu_replace -> {
}
}
return false
}
override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean {
mode?.menuInflater?.inflate(R.menu.content_select_action, menu)
return true
}
override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?): Boolean {
return false
}
override fun onDestroyActionMode(mode: ActionMode?) {
}
}

@ -42,6 +42,7 @@ class ContentView : FrameLayout {
inflate(context, R.layout.view_book_page, this)
upStyle()
upTime()
content_text_view.customSelectionActionModeCallback = ContentSelectActionCallback
}
fun upStyle() {

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_replace"
android:title="@string/replace"
app:showAsAction="always" />
</menu>
Loading…
Cancel
Save