new search action and sorting of actions

This commit is contained in:
Fabian Freund
2025-05-03 23:44:15 +02:00
parent 10b2e46984
commit f18b31042c
3 changed files with 29 additions and 14 deletions
@@ -109,7 +109,13 @@ class GeckoBrowserApiImpl : GeckoBrowserApi {
private fun setupGeckoEngine() {
val selectionActionEvents = GeckoSelectionActionEvents(_flutterPluginBinding.binaryMessenger)
val selectionActionDelegate = DefaultSelectionActionDelegate(selectionActionEvents)
val selectionActionDelegate = DefaultSelectionActionDelegate(selectionActionEvents) { actions ->
val processTextAction = "android.intent.action.PROCESS_TEXT"
val withoutProcessText = actions.filter { it != processTextAction }.toTypedArray()
val processTextActions = actions.filter { it == processTextAction }.toTypedArray()
withoutProcessText + processTextActions
}
val readerViewController =
ReaderViewController(_flutterPluginBinding.binaryMessenger)
@@ -33,6 +33,15 @@ class EmailAction extends BaseSelectionAction {
);
}
class DefaultSearchAction extends BaseSelectionAction {
DefaultSearchAction(PerformAction action)
: super(
id: 'CUSTOM_CONTEXT_MENU_SEARCH_DEFAULT',
title: 'Web Search',
performAction: action,
);
}
class SearchAction extends BaseSelectionAction {
SearchAction(PerformAction action)
: super(