feat: 优化代码

pull/115/head
kunfei 5 years ago
parent 08df196ef3
commit 59b2e46fbb
  1. 7
      app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt

@ -77,7 +77,12 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac
private fun onMenuItemSelected(item: MenuItemImpl) {
when (item.itemId) {
R.id.menu_copy -> context.sendToClip(callBack.selectedText)
else -> item.intent.let {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
it.putExtra(Intent.EXTRA_PROCESS_TEXT, callBack.selectedText)
context.startActivity(it)
}
}
}
callBack.onMenuActionFinally()
}

Loading…
Cancel
Save