From 3bc17b308c0e84a510f18d4a25467624927dbf58 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Sat, 28 Jul 2018 22:13:18 -0700 Subject: [PATCH 1/3] add all remaining movement granularities --- lib/ui/semantics.dart | 96 +++++++++++++++++++ .../io/flutter/view/AccessibilityBridge.java | 87 ++++++++++++++++- 2 files changed, 181 insertions(+), 2 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 7e58c93d717cf..33d0daaf8ba9f 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -28,6 +28,14 @@ class SemanticsAction { static const int _kDidLoseAccessibilityFocusIndex = 1 << 16; static const int _kCustomAction = 1 << 17; static const int _kDismissIndex = 1 << 18; + static const int _kMoveCursorForwardByWordIndex = 1 << 19; + static const int _kMoveCursorBackwardByWordIndex = 1 << 20; + static const int _kMoveCursorForwardByLineIndex = 1 << 21; + static const int _kMoveCursorBackwardByLineIndex = 1 << 22; + static const int _kMoveCursorForwardByParagraphIndex = 1 << 23; + static const int _kMoveCursorBackwardByParagraphIndex = 1 << 24; + static const int _kMoveCursorForwardByPageIndex = 1 << 25; + static const int _kMoveCursorBackwardByPageIndex = 1 << 26; /// The numerical value for this action. /// @@ -163,6 +171,70 @@ class SemanticsAction { /// (with VoiceOver) users can perform a standard gesture to dismiss it. static const SemanticsAction dismiss = const SemanticsAction._(_kDismissIndex); + /// Move the cursor forward by one word. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorForwardByWord = const SemanticsAction._(_kMoveCursorForwardByWordIndex); + + /// Move the cursor backward by one word. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorBackwardByWord = const SemanticsAction._(_kMoveCursorBackwardByWordIndex); + + /// Move the cursor forward by one line. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorForwardByLine = const SemanticsAction._(_kMoveCursorForwardByLineIndex); + + /// Move the cursor backward by one line. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorBackwardByLine = const SemanticsAction._(_kMoveCursorBackwardByLineIndex); + + /// Move the cursor foward by one paragraph. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorForwardByParagraph = const SemanticsAction._(_kMoveCursorForwardByParagraphIndex); + + /// Move the cursor backward by one paragraph. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorBackwardByParagraph = const SemanticsAction._(_kMoveCursorBackwardByParagraphIndex); + + /// Move the cursor forward by one page. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorForwardByPage = const SemanticsAction._(_kMoveCursorForwardByPageIndex); + + /// Move the cursor backward by one page. + /// + /// This is for example used by the cursor control in text fields. + /// + /// The action includes a boolean argument, which indicates whether the cursor + /// movement should extend (or start) a selection. + static const SemanticsAction moveCursorBackwardByPage = const SemanticsAction._(_kMoveCursorBackwardByPageIndex); + /// The possible semantics actions. /// /// The map's key is the [index] of the action and the value is the action @@ -187,6 +259,14 @@ class SemanticsAction { _kDidLoseAccessibilityFocusIndex: didLoseAccessibilityFocus, _kCustomAction: customAction, _kDismissIndex: dismiss, + _kMoveCursorForwardByWordIndex: moveCursorForwardByWord, + _kMoveCursorBackwardByWordIndex: moveCursorBackwardByWord, + _kMoveCursorForwardByLineIndex: moveCursorForwardByLine, + _kMoveCursorBackwardByLineIndex: moveCursorBackwardByLine, + _kMoveCursorForwardByParagraphIndex: moveCursorForwardByParagraph, + _kMoveCursorBackwardByParagraphIndex: moveCursorBackwardByParagraph, + _kMoveCursorForwardByPageIndex: moveCursorForwardByPage, + _kMoveCursorBackwardByPageIndex: moveCursorBackwardByPage, }; @override @@ -230,6 +310,22 @@ class SemanticsAction { return 'SemanticsAction.customAction'; case _kDismissIndex: return 'SemanticsAction.dismiss'; + case _kMoveCursorForwardByWordIndex: + return 'SemanticsAction.moveCursorForwardByWord'; + case _kMoveCursorBackwardByWordIndex: + return 'SemanticsAction.moveCursorBackwardByWord'; + case _kMoveCursorForwardByLineIndex: + return 'SemanticsAction.moveCursorForwardByLine'; + case _kMoveCursorBackwardByLineIndex: + return 'SemanticsAction.moveCursorBackwardByLine'; + case _kMoveCursorForwardByParagraphIndex: + return 'SemanticsAction.moveCursorForwardByParagraph'; + case _kMoveCursorBackwardByParagraphIndex: + return 'SemanticsAction.moveCursorBackwardByParagraph'; + case _kMoveCursorForwardByPageIndex: + return 'SemanticsAction.moveCursorForwardByPage'; + case _kMoveCursorBackwardByPageIndex: + return 'SemanticsAction.moveCursorBackwardByPage'; } return null; } diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 01302abbd1c4b..6949fe477a779 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -63,7 +63,15 @@ enum Action { DID_GAIN_ACCESSIBILITY_FOCUS(1 << 15), DID_LOSE_ACCESSIBILITY_FOCUS(1 << 16), CUSTOM_ACTION(1 << 17), - DISMISS(1 << 18); + DISMISS(1 << 18), + MOVE_CURSOR_FORWARD_BY_WORD(1 << 19), + MOVE_CURSOR_BACKWARD_BY_WORD(1 << 20), + MOVE_CURSOR_FORWARD_BY_LINE(1 << 21), + MOVE_CURSOR_BACKWARD_BY_LINE(1 << 22), + MOVE_CURSOR_FORWARD_BY_PARAGRAPH(1 << 23), + MOVE_CURSOR_BACKWARD_BY_PARAGRAPH(1 << 24), + MOVE_CURSOR_FORWARD_BY_PAGE(1 << 25), + MOVE_CURSOR_BACKWARD_BY_PAGE(1 << 26); Action(int value) { this.value = value; @@ -172,6 +180,38 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER; } + if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_WORD)) { + result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD; + } + if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_WORD)) { + result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD; + } + if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_LINE)) { + result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE; + } + if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_LINE)) { + result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE; + } + if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PARAGRAPH)) { + result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH; + } + if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PARAGRAPH)) { + result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH; + } + if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PAGE)) { + result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE; + } + if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PAGE)) { + result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); + granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE; + } result.setMovementGranularities(granularities); } if (object.hasAction(Action.SET_SELECTION)) { @@ -480,7 +520,50 @@ boolean performCursorMoveAction( return true; } } - // TODO(goderbauer): support other granularities. + case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD: + if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_WORD)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_FORWARD_BY_WORD, extendSelection); + return true; + } + if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_WORD)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_BACKWARD_BY_WORD, extendSelection); + return true; + } + case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE: + if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_LINE)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_FORWARD_BY_LINE, extendSelection); + return true; + } + if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_LINE)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_BACKWARD_BY_LINE, extendSelection); + return true; + } + case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH: + if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PARAGRAPH)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_FORWARD_BY_PARAGRAPH, extendSelection); + return true; + } + if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PARAGRAPH)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_BACKWARD_BY_PARAGRAPH, extendSelection); + return true; + } + case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE: + if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PAGE)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_FORWARD_BY_PAGE, extendSelection); + return true; + } + if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PAGE)) { + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_BACKWARD_BY_PAGE, extendSelection); + return true; + } } return false; } From 71770cc3513f68e1c2f1a85d049f21c0d5559b23 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 30 Jul 2018 16:30:24 -0700 Subject: [PATCH 2/3] remove granularities we probably can't support --- lib/ui/semantics.dart | 72 ------------------- .../io/flutter/view/AccessibilityBridge.java | 65 +---------------- 2 files changed, 1 insertion(+), 136 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 33d0daaf8ba9f..0b77a2e4804fd 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -30,12 +30,6 @@ class SemanticsAction { static const int _kDismissIndex = 1 << 18; static const int _kMoveCursorForwardByWordIndex = 1 << 19; static const int _kMoveCursorBackwardByWordIndex = 1 << 20; - static const int _kMoveCursorForwardByLineIndex = 1 << 21; - static const int _kMoveCursorBackwardByLineIndex = 1 << 22; - static const int _kMoveCursorForwardByParagraphIndex = 1 << 23; - static const int _kMoveCursorBackwardByParagraphIndex = 1 << 24; - static const int _kMoveCursorForwardByPageIndex = 1 << 25; - static const int _kMoveCursorBackwardByPageIndex = 1 << 26; /// The numerical value for this action. /// @@ -187,54 +181,6 @@ class SemanticsAction { /// movement should extend (or start) a selection. static const SemanticsAction moveCursorBackwardByWord = const SemanticsAction._(_kMoveCursorBackwardByWordIndex); - /// Move the cursor forward by one line. - /// - /// This is for example used by the cursor control in text fields. - /// - /// The action includes a boolean argument, which indicates whether the cursor - /// movement should extend (or start) a selection. - static const SemanticsAction moveCursorForwardByLine = const SemanticsAction._(_kMoveCursorForwardByLineIndex); - - /// Move the cursor backward by one line. - /// - /// This is for example used by the cursor control in text fields. - /// - /// The action includes a boolean argument, which indicates whether the cursor - /// movement should extend (or start) a selection. - static const SemanticsAction moveCursorBackwardByLine = const SemanticsAction._(_kMoveCursorBackwardByLineIndex); - - /// Move the cursor foward by one paragraph. - /// - /// This is for example used by the cursor control in text fields. - /// - /// The action includes a boolean argument, which indicates whether the cursor - /// movement should extend (or start) a selection. - static const SemanticsAction moveCursorForwardByParagraph = const SemanticsAction._(_kMoveCursorForwardByParagraphIndex); - - /// Move the cursor backward by one paragraph. - /// - /// This is for example used by the cursor control in text fields. - /// - /// The action includes a boolean argument, which indicates whether the cursor - /// movement should extend (or start) a selection. - static const SemanticsAction moveCursorBackwardByParagraph = const SemanticsAction._(_kMoveCursorBackwardByParagraphIndex); - - /// Move the cursor forward by one page. - /// - /// This is for example used by the cursor control in text fields. - /// - /// The action includes a boolean argument, which indicates whether the cursor - /// movement should extend (or start) a selection. - static const SemanticsAction moveCursorForwardByPage = const SemanticsAction._(_kMoveCursorForwardByPageIndex); - - /// Move the cursor backward by one page. - /// - /// This is for example used by the cursor control in text fields. - /// - /// The action includes a boolean argument, which indicates whether the cursor - /// movement should extend (or start) a selection. - static const SemanticsAction moveCursorBackwardByPage = const SemanticsAction._(_kMoveCursorBackwardByPageIndex); - /// The possible semantics actions. /// /// The map's key is the [index] of the action and the value is the action @@ -261,12 +207,6 @@ class SemanticsAction { _kDismissIndex: dismiss, _kMoveCursorForwardByWordIndex: moveCursorForwardByWord, _kMoveCursorBackwardByWordIndex: moveCursorBackwardByWord, - _kMoveCursorForwardByLineIndex: moveCursorForwardByLine, - _kMoveCursorBackwardByLineIndex: moveCursorBackwardByLine, - _kMoveCursorForwardByParagraphIndex: moveCursorForwardByParagraph, - _kMoveCursorBackwardByParagraphIndex: moveCursorBackwardByParagraph, - _kMoveCursorForwardByPageIndex: moveCursorForwardByPage, - _kMoveCursorBackwardByPageIndex: moveCursorBackwardByPage, }; @override @@ -314,18 +254,6 @@ class SemanticsAction { return 'SemanticsAction.moveCursorForwardByWord'; case _kMoveCursorBackwardByWordIndex: return 'SemanticsAction.moveCursorBackwardByWord'; - case _kMoveCursorForwardByLineIndex: - return 'SemanticsAction.moveCursorForwardByLine'; - case _kMoveCursorBackwardByLineIndex: - return 'SemanticsAction.moveCursorBackwardByLine'; - case _kMoveCursorForwardByParagraphIndex: - return 'SemanticsAction.moveCursorForwardByParagraph'; - case _kMoveCursorBackwardByParagraphIndex: - return 'SemanticsAction.moveCursorBackwardByParagraph'; - case _kMoveCursorForwardByPageIndex: - return 'SemanticsAction.moveCursorForwardByPage'; - case _kMoveCursorBackwardByPageIndex: - return 'SemanticsAction.moveCursorBackwardByPage'; } return null; } diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 6949fe477a779..1d414eccbc59a 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -65,13 +65,7 @@ enum Action { CUSTOM_ACTION(1 << 17), DISMISS(1 << 18), MOVE_CURSOR_FORWARD_BY_WORD(1 << 19), - MOVE_CURSOR_BACKWARD_BY_WORD(1 << 20), - MOVE_CURSOR_FORWARD_BY_LINE(1 << 21), - MOVE_CURSOR_BACKWARD_BY_LINE(1 << 22), - MOVE_CURSOR_FORWARD_BY_PARAGRAPH(1 << 23), - MOVE_CURSOR_BACKWARD_BY_PARAGRAPH(1 << 24), - MOVE_CURSOR_FORWARD_BY_PAGE(1 << 25), - MOVE_CURSOR_BACKWARD_BY_PAGE(1 << 26); + MOVE_CURSOR_BACKWARD_BY_WORD(1 << 20); Action(int value) { this.value = value; @@ -188,30 +182,6 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD; } - if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_LINE)) { - result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); - granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE; - } - if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_LINE)) { - result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); - granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE; - } - if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PARAGRAPH)) { - result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); - granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH; - } - if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PARAGRAPH)) { - result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); - granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH; - } - if (object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PAGE)) { - result.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); - granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE; - } - if (object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PAGE)) { - result.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); - granularities |= AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE; - } result.setMovementGranularities(granularities); } if (object.hasAction(Action.SET_SELECTION)) { @@ -531,39 +501,6 @@ boolean performCursorMoveAction( Action.MOVE_CURSOR_BACKWARD_BY_WORD, extendSelection); return true; } - case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE: - if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_LINE)) { - mOwner.dispatchSemanticsAction(virtualViewId, - Action.MOVE_CURSOR_FORWARD_BY_LINE, extendSelection); - return true; - } - if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_LINE)) { - mOwner.dispatchSemanticsAction(virtualViewId, - Action.MOVE_CURSOR_BACKWARD_BY_LINE, extendSelection); - return true; - } - case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH: - if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PARAGRAPH)) { - mOwner.dispatchSemanticsAction(virtualViewId, - Action.MOVE_CURSOR_FORWARD_BY_PARAGRAPH, extendSelection); - return true; - } - if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PARAGRAPH)) { - mOwner.dispatchSemanticsAction(virtualViewId, - Action.MOVE_CURSOR_BACKWARD_BY_PARAGRAPH, extendSelection); - return true; - } - case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE: - if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_PAGE)) { - mOwner.dispatchSemanticsAction(virtualViewId, - Action.MOVE_CURSOR_FORWARD_BY_PAGE, extendSelection); - return true; - } - if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_PAGE)) { - mOwner.dispatchSemanticsAction(virtualViewId, - Action.MOVE_CURSOR_BACKWARD_BY_PAGE, extendSelection); - return true; - } } return false; } From b645de4e0fe15d1f8ff191e68909fd5b89d10ff9 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 30 Jul 2018 16:37:38 -0700 Subject: [PATCH 3/3] expansion --- shell/platform/android/io/flutter/view/AccessibilityBridge.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 1d414eccbc59a..9c7f9bef0e02f 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -489,6 +489,7 @@ boolean performCursorMoveAction( Action.MOVE_CURSOR_BACKWARD_BY_CHARACTER, extendSelection); return true; } + break; } case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD: if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_WORD)) { @@ -501,6 +502,7 @@ boolean performCursorMoveAction( Action.MOVE_CURSOR_BACKWARD_BY_WORD, extendSelection); return true; } + break; } return false; }