Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Add custom system-wide text selection toolbar buttons for SelectableRegion #141103

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Jan 8, 2024

Description

This PR adds custom system-wide text selection toolbar buttons on Android for SelectableRegion and SelectionArea.

#139738 adds those buttons for EditableText (which is used by TextField and SelectableText but not by SelectionArea).

Related Issue

Step 5 for #139361

Tests

Adds 2 tests.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jan 8, 2024
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 , thanks for adding this for non-editable text too.

And by the way, I was out on leave for most of the time that you were working on this, but thanks so much for tackling this overall project. It's such a huge improvement for Flutter on Android.

Edit: I think the test failures may be a flake and you need to merge in master?

},
));
}
return buttonItems;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to point out that a lot of the code changes in this file are duplicating code that's now in EditableText, too, though I think that's inevitable for now. Hopefully we'll be able to deduplicate this as part of the larger project to unify the text selection code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully we'll be able to deduplicate this as part of the larger project to unify the text selection code.

Very interesting, is there an issue to track this project?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bleroux bleroux force-pushed the add_text_processing_actions_to_selectable_region_context_menu branch from 00b6fe8 to ddce76c Compare January 8, 2024 19:09
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2024
@auto-submit auto-submit bot merged commit 5f17bad into flutter:master Jan 9, 2024
67 checks passed
@bleroux bleroux deleted the add_text_processing_actions_to_selectable_region_context_menu branch January 9, 2024 09:49
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 9, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 9, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 9, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 9, 2024
Roll Flutter from c6ddb73f971e to 126302dfb44c (32 revisions)

flutter/flutter@c6ddb73...126302d

2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 820645dbcc69 to b3c8597df0e2 (5 revisions) (flutter/flutter#141175)
2024-01-09 engine-flutter-autoroll@skia.org Roll Packages from 5aef49b to 09205ca (2 revisions) (flutter/flutter#141173)
2024-01-09 leroux_bruno@yahoo.fr [Android] Add custom system-wide text selection toolbar buttons for SelectableRegion (flutter/flutter#141103)
2024-01-09 tessertaha@gmail.com Update  Chips and `ChipTheme` tests and  for Material 3 (flutter/flutter#141022)
2024-01-09 tessertaha@gmail.com Update `chip_test.dart` tests for Material 3 (flutter/flutter#140964)
2024-01-09 leroux_bruno@yahoo.fr Fix spell check throws when text contains regex reserved characters (flutter/flutter#140384)
2024-01-09 dacoharkes@google.com Native assets support for Android Add2app (flutter/flutter#140802)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from d13479968b8f to 820645dbcc69 (3 revisions) (flutter/flutter#141152)
2024-01-09 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.22.11 to 3.23.0 (flutter/flutter#141132)
2024-01-09 zanderso@users.noreply.github.com Shift mac Pixel 7 Pro tests to prod (flutter/flutter#141142)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3f0f8913169e to d13479968b8f (2 revisions) (flutter/flutter#141147)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 09a74a08c819 to 3f0f8913169e (2 revisions) (flutter/flutter#141146)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from ee1ded6d1c44 to 09a74a08c819 (3 revisions) (flutter/flutter#141144)
2024-01-08 coffee5084@gmail.com [docs] Add document content related to chip shape (flutter/flutter#140015)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 00ff33274fc0 to ee1ded6d1c44 (2 revisions) (flutter/flutter#141133)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 70c45157c60a to 00ff33274fc0 (2 revisions) (flutter/flutter#141128)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from b57c899aefd7 to 70c45157c60a (1 revision) (flutter/flutter#141125)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from db564ffb3549 to b57c899aefd7 (1 revision) (flutter/flutter#141114)
2024-01-08 engine-flutter-autoroll@skia.org Roll Packages from b9b6d38 to 5aef49b (2 revisions) (flutter/flutter#141117)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from bbebee146508 to db564ffb3549 (5 revisions) (flutter/flutter#141112)
2024-01-08 zanderso@users.noreply.github.com Disable test shuffling in widget_tester_leaks_test.dart (flutter/flutter#141110)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 702ae19c0026 to bbebee146508 (1 revision) (flutter/flutter#141088)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5e1d18bb51d1 to 702ae19c0026 (1 revision) (flutter/flutter#141084)
2024-01-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 845ffd16d228 to 5e1d18bb51d1 (1 revision) (flutter/flutter#141076)
2024-01-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from ffc84af47827 to 845ffd16d228 (1 revision) (flutter/flutter#141075)
2024-01-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from cc9362752996 to ffc84af47827 (2 revisions) (flutter/flutter#141074)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from a5173fe3a912 to cc9362752996 (1 revision) (flutter/flutter#141066)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1dfcb6967dd1 to a5173fe3a912 (1 revision) (flutter/flutter#141063)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2fd75c06e0bd to 1dfcb6967dd1 (1 revision) (flutter/flutter#141062)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7f872b265733 to 2fd75c06e0bd (1 revision) (flutter/flutter#141059)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8d1789a43319 to 7f872b265733 (1 revision) (flutter/flutter#141056)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from fcb40168f159 to 8d1789a43319 (1 revision) (flutter/flutter#141053)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
...
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…r#5852)

Roll Flutter from c6ddb73f971e to 126302dfb44c (32 revisions)

flutter/flutter@c6ddb73...126302d

2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 820645dbcc69 to b3c8597df0e2 (5 revisions) (flutter/flutter#141175)
2024-01-09 engine-flutter-autoroll@skia.org Roll Packages from 5aef49b to 09205ca (2 revisions) (flutter/flutter#141173)
2024-01-09 leroux_bruno@yahoo.fr [Android] Add custom system-wide text selection toolbar buttons for SelectableRegion (flutter/flutter#141103)
2024-01-09 tessertaha@gmail.com Update  Chips and `ChipTheme` tests and  for Material 3 (flutter/flutter#141022)
2024-01-09 tessertaha@gmail.com Update `chip_test.dart` tests for Material 3 (flutter/flutter#140964)
2024-01-09 leroux_bruno@yahoo.fr Fix spell check throws when text contains regex reserved characters (flutter/flutter#140384)
2024-01-09 dacoharkes@google.com Native assets support for Android Add2app (flutter/flutter#140802)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from d13479968b8f to 820645dbcc69 (3 revisions) (flutter/flutter#141152)
2024-01-09 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.22.11 to 3.23.0 (flutter/flutter#141132)
2024-01-09 zanderso@users.noreply.github.com Shift mac Pixel 7 Pro tests to prod (flutter/flutter#141142)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3f0f8913169e to d13479968b8f (2 revisions) (flutter/flutter#141147)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from 09a74a08c819 to 3f0f8913169e (2 revisions) (flutter/flutter#141146)
2024-01-09 engine-flutter-autoroll@skia.org Roll Flutter Engine from ee1ded6d1c44 to 09a74a08c819 (3 revisions) (flutter/flutter#141144)
2024-01-08 coffee5084@gmail.com [docs] Add document content related to chip shape (flutter/flutter#140015)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 00ff33274fc0 to ee1ded6d1c44 (2 revisions) (flutter/flutter#141133)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 70c45157c60a to 00ff33274fc0 (2 revisions) (flutter/flutter#141128)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from b57c899aefd7 to 70c45157c60a (1 revision) (flutter/flutter#141125)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from db564ffb3549 to b57c899aefd7 (1 revision) (flutter/flutter#141114)
2024-01-08 engine-flutter-autoroll@skia.org Roll Packages from b9b6d38 to 5aef49b (2 revisions) (flutter/flutter#141117)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from bbebee146508 to db564ffb3549 (5 revisions) (flutter/flutter#141112)
2024-01-08 zanderso@users.noreply.github.com Disable test shuffling in widget_tester_leaks_test.dart (flutter/flutter#141110)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 702ae19c0026 to bbebee146508 (1 revision) (flutter/flutter#141088)
2024-01-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5e1d18bb51d1 to 702ae19c0026 (1 revision) (flutter/flutter#141084)
2024-01-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 845ffd16d228 to 5e1d18bb51d1 (1 revision) (flutter/flutter#141076)
2024-01-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from ffc84af47827 to 845ffd16d228 (1 revision) (flutter/flutter#141075)
2024-01-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from cc9362752996 to ffc84af47827 (2 revisions) (flutter/flutter#141074)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from a5173fe3a912 to cc9362752996 (1 revision) (flutter/flutter#141066)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1dfcb6967dd1 to a5173fe3a912 (1 revision) (flutter/flutter#141063)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2fd75c06e0bd to 1dfcb6967dd1 (1 revision) (flutter/flutter#141062)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7f872b265733 to 2fd75c06e0bd (1 revision) (flutter/flutter#141059)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8d1789a43319 to 7f872b265733 (1 revision) (flutter/flutter#141056)
2024-01-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from fcb40168f159 to 8d1789a43319 (1 revision) (flutter/flutter#141053)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants