|
|
|
@ -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() |
|
|
|
|
} |
|
|
|
|