Commit Graph

7164 Commits

Author SHA1 Message Date
TreeHugger Robot
a20b6ba1f2 Merge "Only classify text when the toolbar is shown." into oc-dev 2017-05-04 15:15:34 +00:00
Abodunrinwa Toki
66c1627301 Only classify text when the toolbar is shown.
classifyText() is used to generate a menu item in the selection toolbar
to handle the selected text. In this cl we avoid calling classifyText()
when the selection is changing but instead call it when we are about to
show the toolbar.

Previously, we depended on invalidateActionModeAsync() to classify text
after a call to startActionMode(). Now that we've introduced
invalidateActionMode() we need to be able to tell
startSelectionActionMode() that we also want the text to be classified,
hence the introduction of an input parameter, "adjustSelection", to
startSelectionActionModeAysnc().

Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Bug: 34966796
Change-Id: I5b9fc9e8ab443f024f8ca461df5a4bcc6485d26b
2017-05-04 13:51:38 +01:00
TreeHugger Robot
6e0332f308 Merge "Revert "Don't add other's child as header or footer"" into oc-dev 2017-05-04 01:04:01 +00:00
Jeff Sharkey
48fef8ce49 Revert "Don't add other's child as header or footer"
This reverts commit 358d0d3297.

This CL resulted in b/37933333 regression, so it'll have to re-land with a target API check.

Change-Id: I1c2e4de43a15c1851d98f6aff432585ada80fb5b
2017-05-03 19:25:08 +00:00
TreeHugger Robot
d30044407e Merge "Avoid classifying text mulitple times." into oc-dev 2017-05-03 12:35:22 +00:00
TreeHugger Robot
33f2b3b3b1 Merge "Fix VideoView touch and trackball handlers to call super." into oc-dev 2017-05-03 07:31:48 +00:00
TreeHugger Robot
9e37a2e419 Merge "Don't add other's child as header or footer" into oc-dev 2017-05-03 02:12:08 +00:00
TreeHugger Robot
3cb61255ab Merge "Support resetting "smart selection" to any word in the selection." into oc-dev 2017-05-02 20:05:48 +00:00
Abodunrinwa Toki
fdf57ba84c Avoid classifying text mulitple times.
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Bug: 34966796
Change-Id: I278dc5f1ca684ff0f336c05f14f5b42196738ba7
2017-05-02 20:32:23 +01:00
Abodunrinwa Toki
8dd3a744a6 Support resetting "smart selection" to any word in the selection.
Test: See topic
Bug: 34779207
Change-Id: I75a9b991571f750b362047baa13675250e929223
2017-05-02 18:44:19 +01:00
Vladislav Kaznacheev
fd48ed6669 Fix VideoView touch and trackball handlers to call super.
Currently VideoView.onTouchEvent and VideoView.onTrackballEvent do not
call super. This completely disables several useful View features
such as long click, context menu or tooltips.

Bug: 37755662
Test: manual
Change-Id: I0c82c32da36e4ca7cacc78027daed2fa298a6b58
2017-05-02 09:39:06 -07:00
Abodunrinwa Toki
ea6cb1215e Add "Paste as plain text" in TextView's toolbar.
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Bug: 36179795
Change-Id: Iee0502678adcfb9de58c107b9247a528718b2c40
2017-05-02 15:16:26 +01:00
TreeHugger Robot
ecc0e16e32 Merge "Use newest scrap view in ListView" into oc-dev 2017-05-01 18:31:39 +00:00
Daichi Hirono
358d0d3297 Don't add other's child as header or footer
Previously ListView#addHeaderView and ListView#addFooterView accepts a
view which is other's child.

The CL adds precondition check not to accept other's child and make the
methods consistent with ViewGroup#addView.

Bug: 37726743
Test: CtsWidgetTestCases
Change-Id: Ibe11f162e9af3c153254966796349b94468b08f3
2017-05-01 13:52:57 +09:00
TreeHugger Robot
093eb12994 Merge "TextClassifier: API rename" into oc-dev 2017-04-30 17:15:55 +00:00
TreeHugger Robot
7f90a9fdb0 Merge "Restricted Context layout font loading in TextView" into oc-dev 2017-04-30 06:50:43 +00:00
Abodunrinwa Toki
e0b57893c6 TextClassifier: API rename
getTextClassificationResult() -> classifyText()
 TextClassificationResult -> TextClassification

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 37769880
Change-Id: I2d926e89058babf06bcff390bee3a45e965984e8
2017-04-30 01:06:03 +01:00
Seigo Nonaka
0f07dd5b14 Remove FontVariationAxis.InvalidFormatException.
Use IllegalArgumentException instead.

Bug: 37769084
Bug: 37765945
Test: am instrument -w -e class android.widget.cts.TextViewTest
      android.widget.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.TypefaceTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.PaintTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.graphics.cts.FontVariationAxisTest
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Test: am instrument -w -e class android.text.VariationParserTest
      com.android.frameworks.coretests/\
      android.support.test.runner.AndroidJUnitRunner

Change-Id: I50b70e3e7e37585c937dcce2416a83353de62a5d
2017-04-28 15:24:40 -07:00
Clara Bayarri
b7df9d0d6b Restricted Context layout font loading in TextView
When the context is restricted, avoid loading custom fonts in
layouts. This is currently only done by TextView. Loading
system fonts via their string name is still OK, just not by
resource id.

Test: cts attached in topic
Bug: 35763094, 31218679
Change-Id: I0dc3a3eade0439c503c58a582b083d7ba1dd4aa3
2017-04-28 20:48:14 +00:00
Kirill Grouchnikov
b07544cf69 Merge "Tweak initialization order of LinearLayout's dividers" into oc-dev 2017-04-28 13:56:28 +00:00
Svetoslav Ganov
70c0221813 Merge "Implement the rest of autofill importance modes" into oc-dev 2017-04-28 06:30:07 +00:00
Svetoslav Ganov
64cf2bb19b Merge "Force autofill on overflow only if empty" into oc-dev 2017-04-28 06:29:25 +00:00
Svet Ganov
fd31f85d0c Implement the rest of autofill importance modes
Test: CTS tests pass; augmented tests to verify new behavior

bug:36171235

Change-Id: Ieff2b8d7e1c3a3eba456deca7bed70c8e29c415e
2017-04-27 18:16:08 -07:00
Evan Rosky
d0c6cf9bc0 Merge "Only restrict arrows out of text fields from keyboard" into oc-dev 2017-04-27 21:28:13 +00:00
Svet Ganov
54523413f8 Force autofill on overflow only if empty
Test: manual

bug:37244196

Change-Id: I0953546492ade815617d30f698e92282a1172302
2017-04-27 12:32:08 -07:00
TreeHugger Robot
e6746726bc Merge "Revise method comment on setFontVariationSettings" into oc-dev 2017-04-27 17:34:48 +00:00
TreeHugger Robot
cc7f08e997 Merge "docs: Update EditText JavaDoc comments" into oc-dev 2017-04-27 05:24:51 +00:00
TreeHugger Robot
1e5d0768cd Merge "docs: Update Button JavaDoc comments" into oc-dev 2017-04-27 05:21:23 +00:00
TreeHugger Robot
47ca22e361 Merge "docs: Update ScrollView JavaDoc comments" into oc-dev 2017-04-27 04:29:14 +00:00
TreeHugger Robot
b312d38868 Merge "docs: Update RelativeLayout.LayoutParams JavaDoc comments" into oc-dev 2017-04-27 04:28:36 +00:00
TreeHugger Robot
01d51288df Merge "Handle package changes in autofill manager service" into oc-dev 2017-04-27 04:22:24 +00:00
TreeHugger Robot
ca105f6c29 Merge "docs: Update LinearLayout JavaDoc comments" into oc-dev 2017-04-27 04:21:15 +00:00
TreeHugger Robot
80fe019f6b Merge "docs: Update ProgressBar JavaDoc comments" into oc-dev 2017-04-27 04:12:48 +00:00
Svet Ganov
48f10a2ab5 Handle package changes in autofill manager service
Autofill manager service was not observing package changes thus
we did not properly handle the cases of the service being updated,
added, and removed. Handling, additions is needed to properly
support restore from a backup. Fixed a few missing locks.

Test: all autofill CTS tests pass and manually tested update, add,
      and remove of autofill services.

bug:36638606
bug:36978445

Change-Id: Idd47891774ba2a4e562a1952cbb5a048211fd4e3
2017-04-26 19:22:05 -07:00
Kirill Grouchnikov
3218a4e4f5 Tweak initialization order of LinearLayout's dividers
In ag/969570 we've unified the treatment of divider logic
in LinearLayout. However, setDividerDrawable logic that was
calling setWillNotDraw added condition that the divider
position is not NONE. That made the initial flow effectively
not calling setWillNotDraw(false).

Changing the order to call setDividerDrawable() at the end
invokes the right logic.

Test:  adb shell am instrument -e class 'android.widget.cts.LinearLayoutTest'  -w 'android.widget.cts/android.support.test.runner.AndroidJUnitRunner'
Bug: 37698004
Change-Id: I8d95770b9f48277c402708fbc5279ba2ec56719f
2017-04-26 17:45:28 -04:00
Felipe Leme
5f7979222d Merge "Provide a way to set AutofillId on ViewStructure." into oc-dev 2017-04-26 18:38:21 +00:00
Joe Fernandez
1ef22a5a65 docs: Update ScrollView JavaDoc comments
- reworded introduction for clarity
- crosslink to nestedscrollview
- simplify language around the “don’ts”
- crosslink to the material design guidelines for scrolling techniques

Test: docs only change. Tested with doc build
Change-Id: Ia6d1e5ce0f9abd3db2c1988537bd42013851596f
2017-04-26 00:23:49 -07:00
Joe Fernandez
d9ffaa5eb8 docs: Update LinearLayout JavaDoc comments
Updated top-level description to:

- favor explanations of using XML for setting attributes (instead of using
methods like setGravity()
- add code example
- clarify what "child view" means
- add context around cross-link to layout params
- add context around cross-link Linear Layout guide (this guide focuses on
layout_weight)

Test: docs change only. Tested with doc build
Change-Id: Ifc1fa4cf24e2afa229f1c20b3f725073aff162d7
2017-04-25 23:39:17 -07:00
Joe Fernandez
72a9d591f0 docs: Update ProgressBar JavaDoc comments
- link to material design guidelines for a visual example of
determinate/indeterminate patterns
- reword introduction for clarity
- remove confusing code example, in favor of a concise explanation of
determinate/indeterminate uses
- adds a note about not using progress bar in a dialog

Test: docs change only. Tested with a docs build
Change-Id: I872f7a647eafa6d0f1652549ad2d9d2db4fc81e3
2017-04-25 23:14:09 -07:00
Joe Fernandez
a1bd1712d5 docs: Update RelativeLayout.LayoutParams JavaDoc comments
Added changes to make purpose/usage of RelativeLayout.LayoutParams more
clear:

- clarify the attributes are set on a view contained in a relative layout
- clarify that relative layout uses these values to position the view
- add note that these values are ignored if view is not contained in a
relative layout
- cross-link code sample in Relative Layout guide
- cross-link guide Layout guide to clarify layout params vs regular
attributes

Test: docs change only. Tested with a docs test build.
Change-Id: I4fe1088594c998cee4ff0b2f6295579956c19d6f
2017-04-25 22:38:45 -07:00
Joe Fernandez
38ed689d95 docs: Update EditText JavaDoc comments
rework the edit text introduction and overview.

- adds an example of a basic configuration
- discuss the inputType attribute
- cross link to relevant classes & methods
- Rework the edit text introduction and overview
- wrap guide link in a p to emphasize
- emphasize specifying the inputType is required

Test: docs only change. Verified with doc test build
Change-Id: I78d8c861c51117bfd61e8c37ad83854a2aeec967
2017-04-25 22:06:48 -07:00
Joe Fernandez
bc6c82c20d Merge "docs: Update ListView JavaDoc comments" into oc-dev 2017-04-26 04:56:11 +00:00
Joe Fernandez
0de19fcf6a Merge "docs: Update ArrayAdapter JavaDoc comments" into oc-dev 2017-04-26 04:55:38 +00:00
Felipe Leme
e4f30650ac Provide a way to set AutofillId on ViewStructure.
So far that was done indirectly by public methods that could
be overridden in away that does not set the proper id in the structure,
which would crash apps.

Bug: 36171235
Test: modified VirtualContainerActivityTest#testAutofillOverrideDispatchprovideAutofillStructure

Change-Id: I3f1c64020125cbb8349971a0bc52ccd1e0c81e62
2017-04-25 14:12:03 -07:00
Joe Fernandez
8e342c7b75 docs: Update Button JavaDoc comments
- Simplify first-line description
- Update top-level code sample
- Add caveat about onClick running on main thread
- Simplify button style discussion
- Add distinct See Also section
- Convert future tense to present tense
- Add closing paragraph tags
- Remove references to push-button
- Clean up code introduction sentence
- Use present tense
- Connect reasoning to user experience
- Format threading information as aside
- Change future tense to present tense
- Add transition statement
- Use active language in parameter description
- Use cannot instead of can not
- Use common parlance name for button
- Clean up parameter descriptions

Test: Docs change only. Tested with a doc build run.

Change-Id: Ie0cd25ed4f8372ba5ec58bdf8b7dfce9100ee3fc
2017-04-25 11:55:26 -07:00
Joe Fernandez
a3aa879166 docs: Update ListView JavaDoc comments
- Use more active and descriptive terms in first-line description
 - Recommend using RecyclerView
 - Add XML example code
 - Direct reader to set an adapter to populate list with views
 - Add pre tags to XML code snippet
 - Give example of displaying more complex views in list
 - Add aside about using convertView if provided
 - Link to guide on handling click events
 - Add cross-link to contextual action mode guide
 - Reframe link to list view guide
 - Advise reader to favor alternative approach to using ListActivity
 - Add paragraph tags
 - Escape @ symbol
 - Fix sentence fragment and change modern -> advanced
 - Fix title of cross-reference to layout guide
 - Remove reference to filename
 - Remove cross-link to contextual action mode
 - Fix malformed link tag
 - Add connecting word
 - Clean up links

Test: Docs change only. Tested with docs build.

Change-Id: Ideb5cc517a7bc08056bb2fe8025c7acea388128b
2017-04-25 11:51:17 -07:00
Adrian Roos
4554332475 Merge "Perf: Fix RemoteViews memory leak" into oc-dev 2017-04-25 17:09:24 +00:00
Adrian Roos
83fad0a35c Perf: Fix RemoteViews memory leak
Fixes an issue where the context wrapper created in
RemoteViews leaks the RemoteViews instance through the
implicit this pointer of anonymous inner classes.

Fixed by replacing with a static inner class.

Bug: 37630958
Test: m droid (this change is not testable)
Change-Id: Ia149b3d91f134f0c308200b46880e7f87542a338
2017-04-24 17:00:27 -07:00
Felipe Leme
85d1c2d290 Minor fixes on Autofill Framework:
- Removed default implementation of onProvideAutofillVirtualStructure() that
  was using accessibility API (it's useless because without the View calling
  AutofillManager.notifyViewEntered(), it would never be triggered).
- Fixed obsolete TODOs.
- Removed obsolete service class name constant.
- Removed unused debug constant.

Fixes: 37078783
Fixes: 33197203
Bug: 33802548
Bug: 35956626

Test: CtsAutoFillServiceTestCases pass
Merged-In: I834d34b8af8bf0d781dc7e0ffcd6e600bfa2d183
Change-Id: I834d34b8af8bf0d781dc7e0ffcd6e600bfa2d183
2017-04-24 16:01:12 -07:00
Joe Fernandez
d7ef95af60 docs: Update ArrayAdapter JavaDoc comments
update the introduction to:

- streamline wording by focusing on practical uses in introduction
- include crosslinks to relevant guides & examples
- a note about RecyclerView given it is mentioned in this context
- favor a p element with a note class applied
- incorporate reword via joe’s input on connecting topics

Test: Docs change only. Tested with doc build run.
Change-Id: I66511db5a978bff4e46d3d6080b00c2b7e6dfa64
2017-04-24 13:50:13 -07:00