Commit Graph

7608 Commits

Author SHA1 Message Date
Mihai Popa
78cab5a596 Merge "[Magnifier-23] Fix invisible cursor in magnifier" 2018-02-21 11:51:34 +00:00
Narayan Kamath
81945916f1 Merge "Remove uses of libcore.util.Objects.hashCode / equals." 2018-02-21 09:34:42 +00:00
TreeHugger Robot
0f5fd79a96 Merge "VideoView2: Remove redundant listeners" 2018-02-21 00:27:13 +00:00
Seigo Nonaka
e68ba070bb Merge "Reorganize MeasuredText API (2nd)" 2018-02-20 21:14:53 +00:00
Phil Weaver
6ef5bbc9b1 Merge "Get text positions from transformed text" 2018-02-20 17:32:27 +00:00
Mihai Popa
a4e39c4f59 [Magnifier-23] Fix invisible cursor in magnifier
Previously, if the magnifier was triggered when the cursor was invisible
between blinks, the cursor would remain invisible until its position
first changed as a result of user dragging. This CL fixes this, by
forcing the cursor to become visible when the magnifier is triggered.

Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Bug: 72314929
Bug: 63531115
Change-Id: I95dd0c2474f1cd1695ff3083e062ee38867b8a0c
2018-02-20 17:22:03 +00:00
Insun Kang
a35d1b1946 VideoView2: Remove redundant listeners
Bug: 73598418
Test: build
Change-Id: Ibc79fde985a98c2323c2c63feef874a90e084652
2018-02-20 01:31:35 +09:00
Narayan Kamath
607223f3b7 Remove uses of libcore.util.Objects.hashCode / equals.
Use public API in java.util.Objects instead.

Test: make
Change-Id: I413280f254743a2efa2640a2194693aeb5980605
2018-02-19 14:12:01 +00:00
TreeHugger Robot
944836c6c7 Merge "TextClassifier: Support service intents." 2018-02-19 11:04:16 +00:00
Seigo Nonaka
beafa1f9d2 Reorganize MeasuredText API (2nd)
This is 2nd attempt of I7db9e2ca4db68a16648cfb8fcf63555f501304c2

This CL changes the MeasuredText API:
- Rename MeasuredText to PrecomputedText.
- Introduce PrecomputedText.Param which holds all text layout parameters.
- Add API to get PrecomputedText.Param from TextView.
- Remove MeasuredText.Builder and add PrecomputedText.create method instead.
- Remove setRange from MeasuredText since it is not for normal use case.
  (It can not be used for TextView)

Bug: 67504091
Bug: 72861572
Test: bit FrameworksCoreTests:android.text.
Test: atest CtsWidgetTestCases:EditTextTest \
    CtsWidgetTestCases:TextViewFadingEdgeTest \
    FrameworksCoreTests:TextViewFallbackLineSpacingTest \
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \
    CtsTextTestCases

Change-Id: Ie73bce52c6c673cda58973ddad04627a7cf2e5e9
2018-02-16 19:42:00 -08:00
Abodunrinwa Toki
2f19b92c75 TextClassifier: Support service intents.
Previously, the TextClassifier only supported Activity intents.

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: Ic488e2f6241eb91a6cd6e16d9f84a49a679164dc
2018-02-17 01:30:55 +00:00
Phil Weaver
cc595bb4a7 Get text positions from transformed text
Using the non-transformed text is bad because the
transformed text is what's actually on the screen,
so it is the thing whose position is relevant.

Bug: 69044691
Test: Updating a11y cts test to use an all-caps
german strong s, which causes the transformed text
to be longer than the original text. That changed
test fails without this fix.

Change-Id: Ia7aac3b4322ffb48f10771f4d1b33c80ca28b120
2018-02-16 16:23:35 -08:00
TreeHugger Robot
243239504a Merge "Always remeasure weighted children, even if there's no excess space" 2018-02-16 22:53:42 +00:00
Alan Viverette
9049fd996a Always remeasure weighted children, even if there's no excess space
Bug: 72630654
Test: atest LinearLayoutTest
Change-Id: Ie9637950aef32f080b8284a63003eb61c0a88841
2018-02-16 14:47:05 -05:00
TreeHugger Robot
f759af6f3b Merge "Optimization: don't call AFM.notifyValueChanged() when value didn't change." 2018-02-16 18:24:18 +00:00
Felipe Leme
27d0446d08 Optimization: don't call AFM.notifyValueChanged() when value didn't change.
Test: manual verification
Test: atest CtsAutoFillServiceTestCases

Bug: 73078981

Change-Id: Ib0a40d4ab0e6f4a1300622fa4d7a2f6026aa98a1
2018-02-16 08:23:17 -08:00
Siyamed Sinir
813d17d67e Update text OWNERS with set noparent
Test: N/A
Change-Id: Ic3d83909a780ae3e3bac81d39719ad60435d95f2
2018-02-15 15:14:50 -08:00
Dake Gu
eb46f6fc32 Merge "autofill: render autofill ui in fullscreen for tv" 2018-02-15 20:39:24 +00:00
Dake Gu
9f879a2da4 autofill: render autofill ui in fullscreen for tv
When IME and autofill are both showing on TV, it's confusing which
window has the input focus. This CL changes autofill window to
full screen for TV.

Bug: 72122929
Test: Manual tested on TV with github example. Manually tested on
phone that UI doesn't change.

Change-Id: Id97b6389523b2ee744d02f5bc7847b307b0b29e4
2018-02-14 13:02:52 -08:00
Seigo Nonaka
4e90fa262d Revert "Reorganize MeasuredText API"
The last change needs more discussion and found some edge cases. Revert and make small step-by-step changes.

Bug: 73091756

This reverts commit 7fd36d19e3.

Change-Id: I89ff52a70cf6a5d6c553afa20f83719e1f9eb726
2018-02-14 17:03:16 +00:00
Seigo Nonaka
7fd36d19e3 Reorganize MeasuredText API
This CL changes the MeasuredText API:
- Rename MeasuredText to PrecomputedText.
- PrecomputedText is no longer a Spanned.
- Introduce PrecomputedText.Param which holds all text layout parameters.
- Add API to get PrecomputedText.Param from TextView.
- Remove MeasuredText.Builder and add PrecomputedText.create method instead.
- Remove setRange from MeasuredText since it is not for normal use case.
  (It can not be used for TextView)

Here is a performance scores: (median, walleye-userdebug, N=20)

StaticLayout creation time (w/o patch -> w/ patch)
 PrecomputedText Balanced Hyphenation  :    743,615 ->    737,145: (-0.9%)
 PrecomputedText Balanced NoHyphenation:    551,544 ->    542,715: (-1.6%)
 PrecomputedText Greedy Hyphenation    :    500,343 ->    499,601: (-0.1%)
 PrecomputedText Greedy NoHyphenation  :    497,987 ->    492,587: (-1.1%)
 RandomText Balanced Hyphenation       : 19,100,592 -> 19,135,289: (+0.2%)
 RandomText Balanced NoHyphenation     :  8,015,088 ->  7,954,260: (-0.8%)
 RandomText Greedy Hyphenation         :  7,950,915 ->  7,877,424: (-0.9%)
 RandomText Greedy NoHyphenation       :  7,939,337 ->  7,863,471: (-1.0%)

PrecomputedText creation time (w/o patch -> w/ patch)
 NoStyled Hyphenation                  : 18,935,638 -> 18,925,422: (-0.1%)
 NoStyled Hyphenation WidthOnly        : 18,469,726 -> 18,978,413: (+2.8%)
 NoStyled NoHyphenation                :  7,940,792 ->  7,919,127: (-0.3%)
 NoStyled NoHyphenation WidthOnly      :  7,463,230 ->  7,922,643: (+6.2%)
 Styled Hyphenation                    : 14,822,501 -> 14,809,017: (-0.1%)
 Styled Hyphenation WidthOnly          : 13,891,770 -> 14,656,617: (+5.5%)
 Styled NoHyphenation                  : 14,511,134 -> 14,301,503: (-1.4%)
 Styled NoHyphenation WidthOnly        : 13,495,345 -> 14,264,314: (+5.7%)

StaticLayout draw time (w/o patch -> w/ patch)
 PrecomputedText NoStyled              :    663,974 ->    661,610: (-0.4%)
 PrecomputedText NoStyled WithoutCache :    648,294 ->    648,766: (+0.1%)
 PrecomputedText Styled                :    879,322 ->    852,770: (-3.0%)
 PrecomputedText Styled WithoutCache   :  1,084,570 ->  1,110,147: (+2.4%)
 RandomText NoStyled                   :    565,682 ->    555,435: (-1.8%)
 RandomText NoStyled WithoutCache      :  9,070,533 ->  9,064,825: (-0.1%)
 RandomText Styled                     :  2,955,202 ->  2,962,008: (+0.2%)
 RandomText Styled WithoutCache        : 12,242,325 -> 12,228,573: (-0.1%)

Bug: 67504091
Bug: 73091756
Test: bit FrameworksCoreTests:android.text.
Test: atest CtsWidgetTestCases:EditTextTest \
    CtsWidgetTestCases:TextViewFadingEdgeTest \
    FrameworksCoreTests:TextViewFallbackLineSpacingTest \
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest \
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest \
    CtsTextTestCases
Change-Id: I7db9e2ca4db68a16648cfb8fcf63555f501304c2
2018-02-12 20:50:41 -08:00
TreeHugger Robot
9036a88d95 Merge "Logging for linkify selections" 2018-02-12 14:44:35 +00:00
Siyamed Sinir
a454df9c06 Merge "Fix Editor ActionMode content rectangle" 2018-02-09 21:57:14 +00:00
Siyamed Sinir
fdbc5ee763 Fix Editor ActionMode content rectangle
We have made a mistake in a previous change and change the single cursor
selection bounds in a wrong way. 

Test: atest CtsWidgetTestCases:TextViewTest
Bug: 72244890
Change-Id: Ie597ff5a9f82e04d673534e35c49da513132cd5b
2018-02-09 11:24:16 -08:00
Siyamed Sinir
bc48bd8f61 Merge "Remove Toki from text OWNERS files" 2018-02-08 18:55:17 +00:00
Clara Bayarri
d293d6d4b6 Remove Toki from text OWNERS files
Test: none
Change-Id: I9e444318df4a77ee06949d5141667f6c00d9a508
2018-02-08 11:14:10 +00:00
TreeHugger Robot
98517be352 Merge "Revert "Remove @hide from ViewGroup debug methods"" 2018-02-06 22:45:40 +00:00
Richard Ledley
db96b03495 Merge "Remove selection on nonselectable text (which would be there if a user tapped Linkified text) if a TextView loses focus." 2018-02-06 21:34:45 +00:00
TreeHugger Robot
8744f57386 Merge "[Magnifier - 19] Add non-basic CTS tests" 2018-02-06 18:53:33 +00:00
Richard Ledley
5f2f820c81 Remove selection on nonselectable text (which would be there if a user tapped Linkified text) if a TextView loses focus.
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest

Bug: 67629726
Change-Id: Ifc3039f0c814c422b2d727f837ca9c88abc2ebe8
2018-02-06 18:09:49 +00:00
Mihai Popa
137b5843d6 [Magnifier - 19] Add non-basic CTS tests
This CL adds two @TestApis required for the magnifier CTS tests.

Bug: 69407609
Bug: 63531115
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I49e53223730f5fbbf353f6574429c1b1a3d877a1
2018-02-06 15:14:44 +00:00
David Ogutu
93ac6d01bb Fix TimePicker keyboard UI num digits for min
Force the minutes to always format to 2 digits. This is a temporary fix
that's not quite fully Locale aware but fixes UI issue. Will need to
refactor code to seperate Locale info, share code with non-keyboard UI
and use more native Locale functions to determine number of digits.

Test: Manual https://drive.google.com/file/d/1iabh2Zzl0YRhj17gbVKr8GvVDXEHUnWI/view?usp=sharing
Bug: 72041032
Change-Id: I0eb479b9aece4726db7bf7fba04dc50ad0f175c5
2018-02-06 09:22:20 -05:00
Alan Viverette
2d7771ca60 Revert "Remove @hide from ViewGroup debug methods"
This reverts commit 1244815e8f.

Bug: 71555179
Test: make
Change-Id: Ibfd97660e5f91fc7fac13b66efa8aa587ba20b4e
2018-02-05 19:14:14 +00:00
TreeHugger Robot
19160d923d Merge "Updating smart text selection animation" 2018-02-05 15:59:56 +00:00
Jan Althaus
92c6decbb8 Logging for linkify selections
Bug: 67629726, 70246800
Test: Manually validated, ran CTS tests, and framework tests
Change-Id: Icd41f1e171767bc466f47c87a6ab611185745fd4
2018-02-05 16:56:52 +01:00
Jan Althaus
80620c52b9 Updating smart text selection animation
Now animates the highlight itself as opposed to an outline.

Bug: 70540865
Test: Manually tested it with single and multi-line - ltr and rtl
Change-Id: I8afee259c9952fcff0b713bca62c82a1022f2b0d
2018-02-05 13:45:13 +01:00
Insun Kang
718c1d122f VV2 & MCV2: Move handling MediaControlView2 visibility logic to VV2
MediaControlView2's setTimeout API is removed and MCV2's visibility
handling logic is moved into VideoView2.

Test: build
Change-Id: I149119148f159c78e86c5061d247f0a434310719
2018-02-05 16:39:58 +09:00
TreeHugger Robot
00f255e795 Merge "VideoView2: Replace showSubtitle with setSubtitleEnabled" 2018-02-05 02:07:55 +00:00
TreeHugger Robot
fdd755df14 Merge "Use ImageDecoder in ImageView.getDrawableFromUri" 2018-02-02 19:51:41 +00:00
Insun Kang
682483d165 VideoView2: Replace showSubtitle with setSubtitleEnabled
- Renames showSubtitle to setSubtitleEnabled
- Introduces isSubtitleEnabled method

Test: build
Change-Id: I4467231870a243706f06e1ccc3c067e769da5824
2018-02-02 10:21:43 +00:00
Insun Kang
8589b7b34b VV2 and MCV2: Override onLayout of ViewGroup and remove MCV2.isShowing()
- Overriding onLayout() is needed as VideoView2 and MediaControlView2
extends ViewGroup.
- Removes MediaControlView2's isShowing() method, since it looks
redundant API.

Test: build, VideoViewTest app
Change-Id: If4608ab56ca3f3883cb674c857f7e53e2dd0e73e
2018-02-02 14:21:19 +09:00
Insun Kang
0d2107bf88 Merge "Make VV2 & MCV2 extend ViewGroup" 2018-02-02 01:40:48 +00:00
Christofer Åkersten
f38d8fb934 Make VV2 & MCV2 extend ViewGroup
Test: VideoViewTest
Change-Id: I91410847de55bef834360d99fcb112b50cef1cea
2018-02-01 21:41:53 +09:00
Sungsoo Lim
7fb54fe9ae MediaControlView2: Remove getProvider()
getProvider() is already in the super class.

Test: build
Change-Id: I89e9dc18da248a94fa8b99e04148278558b1169d
2018-02-01 13:18:12 +09:00
Leon Scroggins III
046a99ebbb Use ImageDecoder in ImageView.getDrawableFromUri
Bug: 63909536
Test: Existing CTS tests

ImageDecoder will bypass the InputStream if possible, allowing it to be
more efficient. In addition, it handles density scaling differently;
instead of using more RAM to scale the image up, it results in scaling
at draw time.

Change-Id: Ied7c0865a736f9ef0de367299264e18ccc3e0b92
2018-01-31 15:43:49 -05:00
Jaewan Kim
bc55661b11 Merge "MediaSession2: Hide system apis" 2018-01-31 14:12:56 +00:00
Abodunrinwa Toki
3bb4436138 Implement TextClassifier.getLogger API
- Introduces getLogger() API.
 - A logger should run in the client's process. This helps us manage
   sessions specific to a client.
 - The logger exposes a tokenizer that clients may use to tokenize
   strings for logging purposes.
 - Logger subclasses need to provide a writeEvent() implementation.
 - SelectionEvent is serializable over IPC.
 - Logger takes care of the session management. It writes session
   specific information into the SelectionEvent.
 - We still keep the SmartSelectionEventTracker for now so clients
   can slowly move off of it. The plan is to delete it.
 - The plan is to include support other event types. e.g. link events.

Bug: 64914512
Bug: 67609167
Test: See topic
Change-Id: Ic9470cf8f969add8a4c6570f78603d0b118956cd
2018-01-31 10:09:54 +00:00
Sungsoo Lim
7d30e1c554 MediaSession2: Hide system apis
Test: build
Change-Id: I6c56c260a002086bbd2c20420b301c66635215c3
2018-01-31 15:43:55 +09:00
TreeHugger Robot
8420d5e596 Merge "Introduce a TextClassifierManagerService." 2018-01-31 05:26:27 +00:00
Christofer Åkersten
a6c97e4615 Move View related methods to helper class
Test: Instantiate MediaControlView2
Change-Id: Ia958a97b38e67f236ee510978c379af9249d2887
2018-01-31 11:27:40 +09:00