Commit Graph

9517 Commits

Author SHA1 Message Date
Justin Ghan
3cc4fa15eb Merge changes from topics "inclusion-strategy", "segment-finder"
* changes:
  Rename SegmentIterator to SegmentFinder
  Layout#getRangeForRect support different text inclusion strategies
2022-10-03 23:24:00 +00:00
Justin Ghan
88cd111ca8 Rename SegmentIterator to SegmentFinder
Also clean up some helper methods by inlining the logic.

These APIs will be made public in a follow up change.

Bug: 243969224
Test: atest android.text.LayoutGetRangeForRectTest
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I7991ef1f3abdf575b9adc0c5dc971f0cdd09fc87
2022-10-03 12:17:06 -07:00
Justin Ghan
339e9492d5 Layout#getRangeForRect support different text inclusion strategies
These APIs will be made public in a follow up change.

Bug: 243969224
Test: atest android.text.LayoutGetRangeForRectTest
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I65ddda9d60c486ca8f53bbd9f0d97209d56bec62
2022-10-03 12:14:54 -07:00
Treehugger Robot
67457fc6c1 Merge "Reorganize text related owners" am: 5e89e54398 am: 95ea173c85 am: 38eb872609 am: a35e8a8e8d am: 0605a3c8b6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2226540

Change-Id: I4df8d1492e2e8727896a674460f77e99e7779909
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 19:42:10 +00:00
Treehugger Robot
0605a3c8b6 Merge "Reorganize text related owners" am: 5e89e54398 am: 95ea173c85 am: 38eb872609 am: a35e8a8e8d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2226540

Change-Id: I3ecf084064583b0920becb5bd994fe43a14a7b1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 18:53:36 +00:00
Treehugger Robot
38eb872609 Merge "Reorganize text related owners" am: 5e89e54398 am: 95ea173c85
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2226540

Change-Id: Ib9cc543d2d3cf6f2bedd5e05f1e86e06a60d1cf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-29 17:56:49 +00:00
Zeyin Wu
8bda3be985 Merge "Add CONTENT_CHANGE_TYPE_CONTENT_INVALID CONTENT_CHANGE_TYPE_ERROR" 2022-09-27 21:41:44 +00:00
Justin Ghan
23af096ba2 Merge "Disable handwriting initiation for password fields" 2022-09-27 20:59:51 +00:00
Zeyin Wu
9eef24a570 Add CONTENT_CHANGE_TYPE_CONTENT_INVALID CONTENT_CHANGE_TYPE_ERROR
Bug: 230141621
Test: cts tests & manually verified on talkback_tests
Change-Id: Ifebb197340b9e22b7451eb2292b22bce41a2cc9e
2022-09-26 22:59:46 +00:00
TreeHugger Robot
08b9eefa9a Merge "Add Layout#getLineBottom with includeLineSpacing parameter" 2022-09-26 20:53:57 +00:00
Justin Ghan
5bfd33e89c Add Layout#getLineBottom with includeLineSpacing parameter
Bug: 247609599
Test: atest android.text.cts.StaticLayoutTest
Test: atest android.text.LayoutGetRangeForRectTest
Change-Id: I7363fe3974d712f992bca5aaefa5ca76499656d2
2022-09-26 09:25:26 -07:00
Justin Ghan
e51ef4024c Delete gesture: remove extra whitespace around deleted text
Bug: 243983058
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I759bbb99e94a373390c77cb28fb71aa641c63560
2022-09-23 01:06:09 -07:00
Justin Ghan
25e455e640 Merge "TextView implementation of remove space gesture, and join or split gesture" 2022-09-23 02:44:40 +00:00
Seigo Nonaka
5916f347b3 Reorganize text related owners
Update list of owners of the text team.

Bug: N/A
Test: N/A
Change-Id: Iae227284d69b1251f26f549850909f44c7639c8f
2022-09-22 16:12:23 +09:00
Justin Ghan
b65e9d1c5a Disable handwriting initiation for password fields
Bug: 222375667
Test: atest android.widget.cts.TextViewTest
Change-Id: I93274c14ec607f5b09fc483133cc83e618d9ce3b
2022-09-21 16:11:16 -07:00
Justin Ghan
52b915f439 TextView implementation of remove space gesture, and join or split gesture
Bug: 240436909
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I0a899f0aecd953f67b398df6b48b90f09c73e4d1
2022-09-19 14:24:31 -07:00
Steven Terrell
da54b2835e Merge changes from topic "cursor-bg-blink-cp" into tm-qpr-dev am: 131fb1ff89 am: b2eba6b95d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19955684

Change-Id: I61543684ba63c8a2aa9ee5c9e1b6f9df92d5d2a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-17 12:16:58 +00:00
Steven Terrell
b2eba6b95d Merge changes from topic "cursor-bg-blink-cp" into tm-qpr-dev am: 131fb1ff89
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19955684

Change-Id: I896302084978f6f22cc52167f981d62feaedc31a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-16 03:15:41 +00:00
Steven Terrell
e23d904d4a Stop cursor from blinking when not visible am: 4ec6dfc389
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19758504

Change-Id: Id4fd25b59737a3095366280de62ab484bda75193
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-16 03:15:20 +00:00
Steven Terrell
131fb1ff89 Merge changes from topic "cursor-bg-blink-cp" into tm-qpr-dev
* changes:
  Add Ability to Check if Cursor is Blinking
  Stop cursor from blinking when not visible
2022-09-16 02:46:30 +00:00
TreeHugger Robot
085455fd72 Merge "Fix: EditText returns wrong CursorAnchorInfo matrix" 2022-09-16 00:39:48 +00:00
Steven Terrell
d2acc476d0 Add Ability to Check if Cursor is Blinking
adds a method for returning whether the cursor is blinking based on the
current value of the mCancelled property in the Blink class.  This
method is only inteded to be used for testing purposes.

Bug: 228354442
Test: manual, method is called in CtsWidgetTestCases:EditTextTest#
      testSuspendAndResumeBlinkingCursor,
      testCursorBlinkingOnNewActivity_WithFocus,
      testCursorNotBlinkingOnNewActivity_WithoutFocus
Change-Id: I02849f6e105cbfe7af78dfb34ffbf1ebbb4a82ae
2022-09-15 22:42:43 +00:00
Haoyu Zhang
85dfb5e356 Fix: EditText returns wrong CursorAnchorInfo matrix
Bug: 245025737
Test: tested manually
Change-Id: Ia8b0b25582cc89b5729cebc27426f54bc3d8007d
2022-09-15 08:06:09 -07:00
TreeHugger Robot
268f971575 Merge "Cancel selection animation when new selection arrives" 2022-09-13 12:56:07 +00:00
Zeyin Wu
8d937f340a Merge "Send AccessibilityEvent.CONTENT_CHANGE_TYPE_INVALID when TextView set errors" 2022-09-12 16:45:38 +00:00
Seigo Nonaka
8a147ba6dc Merge "Implement Ctrl+B/I/U shorcut" 2022-09-09 04:19:47 +00:00
Zeyin Wu
7f8a4a2ff3 Send AccessibilityEvent.CONTENT_CHANGE_TYPE_INVALID when TextView set
errors

Bug: 230141621
Test: atest android.widget.cts.TextViewTest & verified on talkback_tests
Change-Id: I35f60820a5f366f186ff500cbbc77f45c278660d
2022-09-08 19:52:12 +00:00
Seigo Nonaka
9a13cec9a1 Cancel selection animation when new selection arrives
The onAnimationEnd callback will set the selection but there is a race
condition that the new selection may arrive during animation.
The later selection should be honored, so cancel the ongoing animation
before starting new selection.

Bug: 244273440
Test: Manually done on the Pixel 5 with wireless mouse
Change-Id: I977f6cc9244e571caddfe0d79e10ee1c6c8a413d
2022-09-08 18:03:04 +09:00
Seigo Nonaka
66260c6045 Implement Ctrl+B/I/U shorcut
These shortcut works as follows:

- If the selected region is empty, do nothing.
- If the selected region has at least one character that is not styled,
  e.g. bold, apply bold style.
- If the selected region is fully styled, e.g. bold, remove bold style
  from the region.

The default TextView/EditText supports styled editing, but it is used
commonly as plain text fields, e.g. email address in the form, etc.
So, not to style the text in such places, disable styled shortcut by
 default and let developers to enable it when necessary.

Bug: 240628246
Test: TextViewStyleShortcutTest
Change-Id: Id0f1cd85eb198553a852c5c2b628f5d03a2741e1
2022-09-08 13:41:42 +09:00
Haoyu Zhang
7cf6d0618c Merge "Checking TextOperationUser when initialize stylus handwriting" 2022-09-02 09:05:15 +00:00
TreeHugger Robot
25f2a588fa Merge "Assign redo action to Ctrl+Y shortcut" 2022-09-02 07:05:16 +00:00
Seigo Nonaka
96bedec89c Assign redo action to Ctrl+Y shortcut
Bug: 244262525
Test: atest TextViewKeyboardShortcutTest
Change-Id: I43021b42f8f080990600e9fa84ae6dc40ebae148
2022-09-02 14:27:00 +09:00
TreeHugger Robot
d7a11eca6f Merge "Provide gesture result" 2022-09-02 02:20:16 +00:00
Haoyu Zhang
3f655af0b3 Checking TextOperationUser when initialize stylus handwriting
Bug: 237418160
Fix: 244475514
Test: atest HandwritingInitiatorTest
Change-Id: I6c87d034d5bef28383db70f587bdd0ee2db77a79
2022-09-01 18:44:19 -07:00
Haoyu Zhang
49bd302a80 Merge "Introduce visible line bounds to CursorAnchorInfo" 2022-09-01 18:56:12 +00:00
Justin Ghan
19bf9c65a1 Provide gesture result
Bug: 240435922
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I33590176445ee4cf697499688a06fda24bf0cbcf
2022-09-01 10:09:28 -07:00
Haoyu Zhang
4976e19609 Introduce visible line bounds to CursorAnchorInfo
Add visible line bounds to CursorAnchorInfo for IME to improve
scribe rich gesture recognization accuracy.

Bug: 215533103
Bug: 239843501
Test: manually tested
Change-Id: I7039b75388ae34d24feb38d18d8da9a91df89504
2022-09-01 05:07:37 -07:00
Justin Ghan
496de1565d TextView report supported handwriting gestures
Bug: 244355876
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: Ie0263f4732a329089be171fbb24d7473c667ceb5
2022-08-31 08:43:14 -07:00
Seigo Nonaka
ce46186c15 Merge "Move mLastInputSource member to TextView from Editor" 2022-08-30 01:59:22 +00:00
Alan Viverette
411af7b504 Merge "Fixed the reference to the compat version of the widget. Revised the class description." into tm-dev am: 96d92cfeda am: 86fec4c5ad am: 1e6efa818e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19748654

Change-Id: I1722a5c7993ac4d6a09d2b1736df83a66f2cc8ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 15:46:03 +00:00
Alan Viverette
1e6efa818e Merge "Fixed the reference to the compat version of the widget. Revised the class description." into tm-dev am: 96d92cfeda am: 86fec4c5ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19748654

Change-Id: I295cfcd5d4070eefef89c9dc16b38e7aaec13199
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 15:21:09 +00:00
Alan Viverette
cd62cff626 Merge "Fixed the reference to the compat version of the widget. Revised the class description." into tm-dev am: 96d92cfeda
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19748654

Change-Id: I5712f596bc91f84269943566e7ef7440a18743cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 14:52:15 +00:00
Seigo Nonaka
d68f864369 Move mLastInputSource member to TextView from Editor
The ActionMode could be initiated from LinkMovementMethod
which can be handled without Editor instance. So, moving
mLastInputSource member from Editor to TextView.

Test: TextViewIntegrationTest TextViewMouseInteractionTest
Bug: 243922672
Change-Id: I05679f8dbd30fd69e11ed4e315b5b309647ecafb
2022-08-29 12:19:07 +09:00
Justin Ghan
3ebab3f7c2 TextView implementation of insert gesture
Bug: 240435922
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I3c7eb06925081bd5e699999c69437ef8bb929741
2022-08-26 23:19:28 -07:00
Justin Ghan
8b5d4bd91e TextView implementation of select and delete gestures
Bug: 240435922
Test: atest android.text.LayoutGetRangeForRectTest
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I6ceaa4555b82f1c2650d2db3bf39674641d53b8f
2022-08-26 23:18:00 -07:00
Steven Terrell
4ec6dfc389 Stop cursor from blinking when not visible
Cursor continues to blink in a text field even when the text field is
not currently visible. This change checks the visibility of the window
that houses the text field in addition to checking if the view is in
focus.

Bug: 228354442

Test: Added logging to the shouldBlink() method ran following steps:
     1: open contacts app
     2: tap add new contact, tap in an edit field
     3: move back to home screen
     4: lock screen, then unlock screen
     5: observed logs written out to logcat console when app not
        visible.
     after change logs no longer printed to console, cursor still blinks
     correctly after app is re-opened or when new field becomes in
     focus.
Test: CtsWidgetTestCases:EditTextTest#
        testCursorNotBlinkingOnNewActivity_WithoutFocus()
	testCursorBlinkingOnNewActivity_WithFocus()
	testSuspendAndResumeBlinkingCursor()
Change-Id: Iad4396e5f7fd810344c711320d65c57ea25eda70
Merged-In: Iad4396e5f7fd810344c711320d65c57ea25eda70
2022-08-26 20:31:56 +00:00
TreeHugger Robot
c7ab586fa3 Merge "Use event source for the UI visibility" 2022-08-26 10:53:19 +00:00
Seigo Nonaka
8630c53160 Use event source for the UI visibility
Bug: 240383641
Test: atest TextViewMouseInteractionTest
Change-Id: Iefc5c27a05c716b06678266582a89c275a3a74f2
2022-08-26 13:24:06 +09:00
Daniel Norman
47d8fe5c9f Merge changes from topic "reland-a11y-adp"
* changes:
  Tweak behavior of isAccessibilityDataPrivate() to reduce CPU usage.
  Revert "Revert "Limit off-label accessibility access using a new..."
2022-08-25 23:25:12 +00:00
joneckenrode
6dbcd1f835 Fixed the reference to the compat version of the widget. Revised the class description.
Cherry-picked from CL 19211934 merged on master. See https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/19211934.

Test: Built API documentation
Change-Id: If74178eba609346eb7cf9e462bdb3edf40db4d81
2022-08-25 23:18:47 +00:00