Commit Graph

6865 Commits

Author SHA1 Message Date
TreeHugger Robot
a2b61657c4 Merge "Add @Nullable to CompoundButton#setOnCheckedChangeListener()." 2017-01-09 18:33:44 +00:00
Roozbeh Pournader
edef8505cb Merge "Expand characters temporarily skipped in spellchecking" 2016-12-20 19:36:54 +00:00
TreeHugger Robot
6fc806b56c Merge "Fix casting issue in use of ICU Measures" 2016-12-20 19:31:10 +00:00
TreeHugger Robot
19e2fb57c9 Merge "Implement requestKeyboardShortcuts for PopupDecorView" 2016-12-20 15:38:27 +00:00
Roozbeh Pournader
63a13cf754 Fix casting issue in use of ICU Measures
Bug: 19418509
Bug: 33670388
Bug: 33750033
Test: manual
Change-Id: I286cfed0cfe34166bd1fd1982089a11eb556fc44
2016-12-19 16:03:30 -08:00
Roozbeh Pournader
f6952b8331 Expand characters temporarily skipped in spellchecking
An earlier patch (I4d09576a31df551c96f820242fd2cbc675506dae)
special-cased apostrophe as a character to defer spellchecking on,
since it could cause a word break which could later get removed.

This patch updates that earlier patch to include all characters that
could cause such a behavior according the Unicode word breaking
algorithm defined in UAX #29.

Bug: 17641350
Bug: 17673522
Test: manual
Change-Id: I4029e3d91dfcf96665b003f6fdd30d1208b0ac7c
2016-12-19 11:31:07 -08:00
Roozbeh Pournader
d681725437 Merge "Switch Chronometer to use ICU instead of duration_hours etc" 2016-12-16 18:39:06 +00:00
Roozbeh Pournader
241872a93b Switch Chronometer to use ICU instead of duration_hours etc
The data in ICU has higher quality and is more comprehensive.
(Additionally, the old code was using spaces to separate hours,
minutes, and seconds, which was not correct for some locales.)

Finally, remove duration_hours etc, since there is no longer any user
of it.

Bug: 33670388
Bug: 19418509
Test: manual and CTS (cts-tradefed run cts-dev --module CtsWidgetTestCases --test android.widget.cts.ChronometerTest)
Change-Id: I97efa62186b94ed444fff90fa26bf71ac1599261
2016-12-15 16:00:45 -08:00
Peeyush Agarwal
50db731b54 Implement requestKeyboardShortcuts for PopupDecorView
A call to requestKeyboardShortcuts from popup menu might be dispatched
to PopupDecorView or DecorView depending on WindowManagerService's
focusedWindow at that moment.

In case it gets dispatched to PopupDecorView, we would like to resend it
to parent activity's decor view (which can then handle it
appropriately). The change adds a notion of mParentRootView which keeps
track of popup's parent's decor view. The request is then routed
appropriately so as to display the corresponding shortcuts. mAnchor
cannot be used as it gets nulled (by dismiss) by the time
requestKeyboardShortcuts gets called.

Bug: 31850671
Change-Id: I0ee3a1c7801c6d3fce8748bc7513382f250c5c63
Fixes: 31850671
Test: cts-tradefed run cts-dev -m CtsAppTestCases -t
android.app.cts.ActivityKeyboardShortcutsTest#testRequestShowKeyboardShortcuts
2016-12-14 18:46:39 +00:00
Andrei Stingaceanu
79ada3015b Merge "AutoSize TextView (part 4) - autosize when layout changes" 2016-12-14 10:51:56 +00:00
Andrei Stingaceanu
7c8ba07ed4 AutoSize TextView (part 4) - autosize when layout changes
Whenever TextView#onMeasure(...) gets called make sure to
also autosize is enabled. Also fixes the available space
calculation by taking the drawables padding into consideration
too.

Bug: 32221168
Bug: 33573642
Test: attached in topic
Change-Id: I1a01454f3863e51afd7e16cfa27f544db6ca0783
2016-12-13 16:44:59 +00:00
TreeHugger Robot
d4f08a007d Merge "AutoFill Framework refactoring." 2016-12-13 04:05:51 +00:00
Felipe Leme
1ca634a544 AutoFill Framework refactoring.
The AutoFill Framework uses the same AssitStructure provided by the Assist API
and so far it was using the same methods as well, both internally and externally
(public API).

Sharing that internal code internally is fine, but the public APIs must distinguish between the 2 cases so they can fill the assist structures accordingly (although the initial implementation still shares the same logic).

This CL also splits the original 'auto-fill' request in 2 types of requests,
which are set by View flags:

- ASSIST_FLAG_SANITIZED_TEXT
- ASSIST_FLAG_NON_SANITIZED_TEXT

It also added new methods and callbacks to handle save requests.

Bug: 31001899
Test: manual verification

Change-Id:  I4eb09099dc19a43cb7e053e64d939aed3704b410
2016-12-12 18:22:45 -08:00
TreeHugger Robot
cf4d2ce358 Merge "Introduce TextClassificationManager." 2016-12-12 21:42:19 +00:00
Sunny Goyal
c50b1d1022 Merge "Enforcing a maximum depth on nested RemoteViews calls" 2016-12-12 20:19:24 +00:00
Abodunrinwa Toki
8158af53e8 Introduce TextClassificationManager.
This handles smart selection and language detection features.
This CL only contains code to integrate the TextClassificationManager.
Implementation will be added in a follow up CL.

Test: Test will be added when TextClassificationManager is added.
Bug:32503402
Change-Id: I5f22150ff998156fbc91b51c733d93478efaa51f
2016-12-12 19:52:31 +00:00
Alan Viverette
054c172ec6 Show popup transitions when there is no anchor set
Allow anchorRoot to be null when starting exit transition. Pushes
epicenter callback creation into startExitTransition. Adds nullability
annotations.

Bug: 33035511
Test: PopupWindowTest#testEnterExitTransition
Change-Id: Ie752a0d6b29d5eb11c160771d8a78fa6234de5bb
2016-12-07 18:05:35 +00:00
Andrei Stingaceanu
5038d58c83 AutoSize TextView (part 3) - define who supports autosize
Introduces a new protected hidden method that
specifies if the TextView (or descendant) widget
supports the autosize feature. All direct children of
TextView (besides EditText) support it.

Bug: 33098425
Bug: 32221168
Test: attached in the topic

Change-Id: I6f0092b4c9948afb427fe597b0515a39b1f258f6
2016-12-06 13:14:22 +00:00
Jason Long
acdaaea50c Add @Nullable to CompoundButton#setOnCheckedChangeListener().
Test: n/a

Change-Id: I3db93bfcfba528e7271be21356e585e9f9a0799d
2016-12-01 22:56:22 -08:00
Phil Weaver
7584b074ae Don't invalidate list data during layout. am: a9d976f39a
am: 84a0d97b85

Change-Id: I0dc549674ed7e026cbe15ac6d06626305729e7b8
2016-11-30 18:05:26 +00:00
Phil Weaver
84a0d97b85 Don't invalidate list data during layout.
am: a9d976f39a

Change-Id: I865fda193961bb0e5229cba1034b818572662001
2016-11-30 18:00:54 +00:00
Andrei Stingaceanu
5cd7efb267 AutoSize TextView (part 1) - minimal end-to-end
Introduced the minimal number of attributes needed
to do autosizing and the autosize functions
bundled in TextView (for now). Note that in this
first version the autosizing can only be controlled
via construction.

Next: introduce getters/setters for the new attributes.

Bug: 32221168
Test: added a minimal smoke-ish CTS which exercises the
      new attributes.

Change-Id: Idf2195f6a600bfb7908b703ea046209b5868c521
2016-11-24 10:59:01 +00:00
Abodunrinwa Toki
d0d9ceb30c Introduce TextAssistant for Smart Text Share feature.
Bug: 30982298
Test: CTS tests to be added in a follow up CL.
Future CLs will add implementation detail.

Change-Id: Iad550447a4b3552340c0ada75fda60f97f0913aa
2016-11-22 14:41:16 +00:00
Abodunrinwa Toki
1b304e4073 TRON logging for TextView gesture - Long press.
Bug: 32572232
Test: Manually confirmed that stats were sent for logging by checking
  adb logs according to go/tron-howto.
Change-Id: I1ea09174190247c219ce42f70c7db75148033685
2016-11-17 10:51:26 +00:00
Sunny Goyal
692f8c9324 Enforcing a maximum depth on nested RemoteViews calls
An unchecked read from parcel can lead to StackOverflowError

Test: am instrument -w -e class android.widget.RemoteViewsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 26755067
Change-Id: I36ea253846d5c823899097821270dcfca2472b65
2016-11-16 08:29:57 -08:00
Sunny Goyal
d998c08231 Merge "Preventing widgets from exceeding Bitmap memory limit" 2016-11-15 03:33:46 +00:00
Sunny Goyal
349b412b4b Preventing widgets from exceeding Bitmap memory limit
> Moving the size check to a comman place so that it is executed in
all related code
> Fixing size calculation when views are merged as a result of partial
update

Test: Manually tested with a dummy app
Bug: 31790171
Change-Id: Id0ea776796f156455d2cba31c8392d4875116949
2016-11-14 17:19:25 -08:00
Siyamed Sinir
302d57c649 Merge "Update TextView ApiDocs." 2016-11-11 23:31:15 +00:00
Yigit Boyar
a7e523d6fe List all methods that change data in the docs am: 42c69b9ce4 am: 7e6fdaab69 am: 93f130e232
am: 586c7e26f7

Change-Id: I28fb42476eebb0437b58b076574b1119d233ec01
2016-11-11 23:04:10 +00:00
Yigit Boyar
586c7e26f7 List all methods that change data in the docs am: 42c69b9ce4 am: 7e6fdaab69
am: 93f130e232

Change-Id: Id95fff602b22d376cfd81fbafdc22fac376a644c
2016-11-11 22:52:01 +00:00
Yigit Boyar
7e6fdaab69 List all methods that change data in the docs
am: 42c69b9ce4

Change-Id: I0808918c44981da63ace801c486d442ff1a99700
2016-11-11 22:31:15 +00:00
Sunny Goyal
0a1ce4237f Merge "Fixing async inflation for nested RemoteViews" 2016-11-09 20:20:46 +00:00
Sunny Goyal
7b0e2c7659 Fixing async inflation for nested RemoteViews
> Fixing isRootNamespace check
> Updating ViewTree when ViewStub is inflated
> Applying ViewGroupAction on previously found views instead of finding it again
  as the viewTree might have changed.

Test: am instrument -w -e class android.widget.RemoteViewsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 32639592

Change-Id: I0815fb3a981efbc04fb0d080b81949985c2d9bc3
2016-11-09 10:02:44 -08:00
Siyamed Sinir
9aba698bd1 Merge "StaticLayout visual fix for maxLines" 2016-11-08 00:56:18 +00:00
Tony Wickham
400ef79b8e Add safety net if StackView duration would be negative.
Bug: 32699754
Change-Id: I00d4b2398fa7f4ab4cdad290a346b0f09c2af242
2016-11-07 18:27:41 +00:00
Seigo Nonaka
4b56177429 Merge "Make sure the Typeface is loaded before calling measureText." 2016-11-07 05:22:52 +00:00
Phil Weaver
a9d976f39a Don't invalidate list data during layout.
When a FastScroller is enabled, we were invalidating the
list data during layout, which left the UI in a bad state.
Long-presses didn't work properly, and TalkBack touches
were impossible to perform.

Bug: 31160338

Test: Manually tested long pressing, and verified
that TalkBack now works with the TestActivity in ag/1567328.
Change-Id: Iecd2d597259748a3ecbf5573950e565a0e9faa42
(cherry picked from commit 2112742be6)
2016-11-02 17:37:53 +00:00
Phil Weaver
8de23283b6 Revert "Don't invalidate list data during layout." am: 866ded50bb am: 96b4a68c06 am: b8a314427b
am: 1b5e3d98d2

Change-Id: I91a54e6f1f4d94da93b47cc79a8fdda5a8ae8580
2016-11-02 17:36:24 +00:00
Phil Weaver
1b5e3d98d2 Revert "Don't invalidate list data during layout." am: 866ded50bb am: 96b4a68c06
am: b8a314427b

Change-Id: I5ace1c6b058b795a5b04e48200d2b3d3a1ae2486
2016-11-02 17:30:48 +00:00
Phil Weaver
96b4a68c06 Revert "Don't invalidate list data during layout."
am: 866ded50bb

Change-Id: I191c26bfb9488d5d67514a81387a9cde95a20eb4
2016-11-02 17:20:17 +00:00
Sunny Goyal
e7e563108e Merge "Avoding writing ApplicationInfo multiple times for nested RemoteViews" 2016-11-02 16:46:41 +00:00
Phil Weaver
866ded50bb Revert "Don't invalidate list data during layout."
This reverts commit 456158ffc2.

Change-Id: I7a61dc34dfc81ee650ca0883fe99c0f5dc08ba75
2016-11-01 23:38:44 +00:00
Phil Weaver
112345c1c3 Don't invalidate list data during layout. am: 456158ffc2 am: 06ffff6132
am: 07f434d02f

Change-Id: I6adaa881b70805d46d2425dd979609c6e99e11c9
2016-11-01 23:09:02 +00:00
Phil Weaver
06ffff6132 Don't invalidate list data during layout.
am: 456158ffc2

Change-Id: I550b63d3fd6b5f451083627dc16f369729b1e1d7
2016-11-01 22:55:11 +00:00
Phil Weaver
f74ce2764f Merge "Don't invalidate list data during layout." 2016-11-01 19:20:52 +00:00
Phil Weaver
456158ffc2 Don't invalidate list data during layout.
When a FastScroller is enabled, we were invalidating the
list data during layout, which left the UI in a bad state.
Long-presses didn't work properly, and TalkBack touches
were impossible to perform.

Bug: 31160338

Test: Manually tested long pressing, and verified
that TalkBack now works with the TestActivity in ag/1567328.
Change-Id: Iecd2d597259748a3ecbf5573950e565a0e9faa42
2016-11-01 18:36:16 +00:00
Phil Weaver
2112742be6 Don't invalidate list data during layout.
When a FastScroller is enabled, we were invalidating the
list data during layout, which left the UI in a bad state.
Long-presses didn't work properly, and TalkBack touches
were impossible to perform.

Bug: 31160338

Test: Manually tested long pressing, and verified
that TalkBack now works with the TestActivity in ag/1567328.
Change-Id: Iecd2d597259748a3ecbf5573950e565a0e9faa42
2016-11-01 10:17:57 -07:00
Sunny Goyal
5d8bcdf6a5 Avoding writing ApplicationInfo multiple times for nested RemoteViews
Bug: 32240818
Test: All tests passing
Change-Id: I00eec4d692763c53709e14b25a338e6320166c4a
2016-10-31 14:55:17 -07:00
Sunny Goyal
584264f6af Merge "Adding support for async view loading in RemoteViewsAdapter" 2016-10-27 17:14:47 +00:00
Seigo Nonaka
e2179925df Make sure the Typeface is loaded before calling measureText.
This is a clean up CL by resolving TODO in hwui/Typeface.cpp

Usually Typeface is listed in preloaded-classes and loaded during Zygote
initialization. However, on some devices, class preloading is disabled.
Paint.measureText can not be called before Typeface static initializer
and it may not load Typeface class.

To ensure that the font preloading happens in ZygoteInit even on such
devices, refer Typeface.DEFAULT static field in TextView.preloadFontCache
in TextView which also happens during zygote initialization.

Bug: 32374752
Test: Manually done
Change-Id: I773c154671c170bebad3aa0f9c04eee5a664b849
2016-10-27 18:18:49 +09:00