From cbfd218c7e1201f4f117f7703075f0568a28ad30 Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Sun, 23 Feb 2025 17:11:28 +0100 Subject: [PATCH] added context menu support --- app/android/app/src/main/AndroidManifest.xml | 6 + app/lib/core/routing/routes.browser.dart | 18 + app/lib/core/routing/routes.dart | 2 + app/lib/core/routing/routes.g.dart | 23 + .../browser/presentation/screens/browser.dart | 14 + .../converters/hit_result_converter.dart | 45 ++ .../contextmenu/extensions/hit_result.dart | 90 +++ .../presentation/candidates/copy_email.dart | 31 + .../presentation/candidates/copy_image.dart | 37 + .../candidates/copy_image_location.dart | 30 + .../presentation/candidates/copy_link.dart | 30 + .../candidates/launch_external.dart | 31 + .../candidates/open_image_new_tab.dart | 31 + .../presentation/candidates/open_new_tab.dart | 29 + .../presentation/candidates/save_file.dart | 38 ++ .../presentation/candidates/save_image.dart | 38 ++ .../presentation/candidates/share_email.dart | 31 + .../presentation/candidates/share_image.dart | 37 + .../presentation/candidates/share_link.dart | 27 + .../presentation/context_menu_dialog.dart | 73 ++ app/pubspec.yaml | 1 + .../FlutterMozillaComponentsPlugin.kt | 3 + .../api/GeckoDownloadsApiImpl.kt | 91 +++ .../middleware/FlutterEventMiddleware.kt | 27 + .../pigeons/Gecko.g.kt | 623 +++++++++++++++-- .../lib/flutter_mozilla_components.dart | 10 + .../src/domain/services/gecko_downloads.dart | 69 ++ .../lib/src/domain/services/gecko_event.dart | 12 + .../lib/src/pigeons/gecko.g.dart | 643 ++++++++++++++++-- .../pigeons/gecko.dart | 178 +++-- 30 files changed, 2159 insertions(+), 159 deletions(-) create mode 100644 app/lib/features/geckoview/features/contextmenu/domain/converters/hit_result_converter.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/extensions/hit_result.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/copy_email.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/copy_image.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/copy_image_location.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/copy_link.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/launch_external.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/open_image_new_tab.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/open_new_tab.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/save_file.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/save_image.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/share_email.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/share_image.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/candidates/share_link.dart create mode 100644 app/lib/features/geckoview/features/contextmenu/presentation/context_menu_dialog.dart create mode 100644 packages/flutter_mozilla_components/android/src/main/kotlin/eu/lensai/flutter_mozilla_components/api/GeckoDownloadsApiImpl.kt create mode 100644 packages/flutter_mozilla_components/lib/src/domain/services/gecko_downloads.dart diff --git a/app/android/app/src/main/AndroidManifest.xml b/app/android/app/src/main/AndroidManifest.xml index 8b6515ef..6adba6c3 100644 --- a/app/android/app/src/main/AndroidManifest.xml +++ b/app/android/app/src/main/AndroidManifest.xml @@ -198,6 +198,12 @@ android:name="flutterEmbedding" android:value="2" /> + + + + + +