If there is a selection or deletion preview range set, then the corresponding highlight will be displayed, and the cursor or regular selection highlight will be hidden. Once the selection or deletion preview range is cleared, then the cursor or regular selection highlight will be displayed again.
Bug: 240436893
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I30285942396a11b5b38a9e83ee13e7c0485baa7d
Added measure to try & ensure popups have time to collapse before trying to send TYPE_VIEW_SELECTED
Bug: 256048559
Test: Test in topic
Change-Id: I8ef5ff37ca08a4adb8c7ffda53a7ac810ba2763d
Introduce a new constant FontStyle.FONT_WEIGHT_UNSPECIFIED = -1, which is used when text weight is not specified. Also replace -1 with it in TextView, TextAppearanceSpan.
Bug: 256995042
Test: manually test
Change-Id: Ia8334f5513cc3e5b7383b67b24b27bf2866d05ad
Add a new group of information related to text appearance in
CursorAnchorInfo, which is extracted from TextView.
Bug: 231894524
Test: atest android.view.inputmethod.cts.CursorAnchorInfoTest#testBuilder
atest android.view.inputmethod.cts.CursorAnchorInfoTest#testEquality
atest android.view.inputmethod.cts.InputMethodServiceTest#testOnUpdateCursorAnchorInfo
Change-Id: I8b96f055506b0a426dcfc6334db867dda7073868
To keep the old behavior in case of API call or a11y events, use
SOURCE_TOUCHSCREEN as the last input source to be able to show
existing ActionMode UI.
Bug: 244175906
Test: atest TextViewTest
Change-Id: Ie20b37e851b4600a6ad86ad7fffb9e2d466e0be1
android.util.Range is not suitable for text ranges since it uses
inclusive boundaries, whereas the convention in text is to represent
ranges with an inclusive start boundary and exclusive end boundary. So
the API is updated to use an array of two ints to represent the text
range.
Bug: 251085162
Test: atest android.text.cts.LayoutGetRangeForRectTest
Change-Id: I54ab6d2741d1cfbbb743e477de4fa7299382fcfb
Point-based handwriting gestures are supported for points within text
line bounds. With this change, they will also be supported for points
which are outside the line bounds but within a margin of the line bounds.
The margin is added to ViewConfiguration so that the value can be
accessed by other UI toolkits so that they can implement the same
behavior.
The dimension resource is added as a @SystemApi so that OEMs may
override the value.
Bug: 243967209
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I0e64f20c670808580346a485d06a0da0f21d3ed2
The initial implementation using Layout#getOffsetForHorizontal could
miss whitespace characters at the endpoints. This new implementation
using Layout#getRangeForRect ensures all whitespace characters touched
are included in the range.
Bug: 247557062
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I800407a6d89d77cd5e750530d9dae8ccb268869f
The implementation of whitespace removal in
performHandwritingDeleteGesture had a bug causing an
IndexOutOfBoundsException when the whitespace was at the start or end of
the text.
This also fixes the whitespace removal code in
performHandwritingJoinOrSplitGesture to properly handle supplementary
characters.
Bug: 243983058
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I3cfef91d05d5619668ccfc0d1259b6b1fd96bed9
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
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
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