Commit Graph

5183 Commits

Author SHA1 Message Date
Dianne Hackborn
484bc6e5a7 Merge "More work on collecting assist data." 2015-03-13 16:41:29 +00:00
Dianne Hackborn
a83ce1dd2a More work on collecting assist data.
Optimize parceling of AssistData (which is now renamed to
AssistStructure) by pooling duplicated class name strings.

Change text associated with a view node to a CharSequence,
so styling information comes along.

Include global text attributes -- size, colors, etc.

Introduce a new AssistContent structure, which allows us
to propagate information about the intent and data the
activity is looking at.  This further allows us to propagate
permission grants, so the assistant can dig in to that data.
The default implementation propagates the base intent of an
activity, so if for example you bring up the assistant while
doing a share the assistant itself has the same information
and access that was given to the share activity (so it could
for example share it in another way if it wanted to).

Did some optimization of loading PersistableBundle from xml,
to avoid duplicating hash maps and such.

Changed how we dispatch ACTION_ASSIST to no longer include
the more detailed AssistStructure (and new AssistContent)
data when launching; now the example code that intercepts
that needs to be sure to ask for assist data when it starts
its session.  This is more like it will finally be, and allows
us to get to the UI more quickly.

Change-Id: I88420a55761bf48d34ce3013e81bd96a0e087637
2015-03-12 17:07:51 -07:00
Marco Nelissen
a80ac05f85 resolved conflicts for merge of 42f55d1e to master
Change-Id: I9c26861c5b0e26bb55e50b2133b7561348a01aec
2015-03-12 16:17:45 -07:00
Roozbeh Pournader
4f831caa49 Merge "Fix negative touch word offset that caused crashing when selecting text" 2015-03-12 21:45:22 +00:00
Mady Mellor
27d6b97f63 Fix negative touch word offset that caused crashing when selecting text
Previously the offset between the touch event and the start / end of
the word could result in a negative value - we don't care or want
this value to be negative. The negative value also causes the returned
offset to be outside the bounds of the text which resulted in a crash.

Bug: 19705184
Change-Id: I4287df7778c246dd10654f1a1f1e57538e940730
2015-03-12 19:24:26 +00:00
Clara Bayarri
f84a9724f1 Move the "Replace" popup option to the Text Selection ActionMode.
As a first step in unifying the cut/copy/paste ActionMode in Editor
with the paste/replace popup, I'm moving the replace option to
the CAB ActionMode. Paste is already there, so for now all options
are together.

Missing things to address in upcoming CLs:
- Invoke the ActionMode in all cases where the popup shows up now,
ensuring only the options that are currently available show up.
- Get rid of the current popup
- Make the ActionMode a floating toolbar (pending feature completion)
- Define a keyboard shortcut for replace?

Note that since the ActionMode still shows up in the ActionBar and
replace has no icon it now appears as text and takes up lots of
space. This will improve when we can switch to using a floating
toolbar.

Change-Id: Ib6b60bae9b58e4db96b9c4cee556e19d3f1bb466
2015-03-12 10:31:11 +00:00
Alan Viverette
1130363f18 Merge "Various fixes for popup monkey testing" 2015-03-11 21:04:28 +00:00
Alan Viverette
8fd949e680 Various fixes for popup monkey testing
Ensures PopupMenu works correctly when multiple calls are made to show
and dismiss. Ensure PopupWindow works correctly when multiple calls are
made to showAsDropDown and dismiss (fixes multiple clicks on Spinner).

Bug: 19672907
Bug: 19671831
Change-Id: Ib92accd8fd70a1ff1f8cda27155347b007a4d25b
2015-03-11 12:21:30 -07:00
Marco Nelissen
42f55d1e68 am a3d25d74: Merge "Fix context leak"
* commit 'a3d25d7489d7e071fb6db01b62ec9d925e1d493d':
  Fix context leak
2015-03-11 18:21:24 +00:00
Roozbeh Pournader
4cdeeadd42 Add a check for invalid spans being set by SpellChecker.
One of the exit conditions of the loop immediately above the code is
when a BreakIterator finishes its input and emits BreakIterator.DONE,
which we were then mistakenly then using as a parameter for setting
spans.

Bug: 12936072
Bug: 5555929
Change-Id: Ib4aba113f2e7838cd040076160c1dd0fb90adb1a
2015-03-11 11:09:34 -07:00
Marco Nelissen
926ebb860a Fix context leak
Using an activity context with AudioManager could cause that context
to be held on to longer than desired, for example if the caller
acquired audio focus but never abandoned it. Fix acquire/abandon in
VideoView, and use the application context in AudioManager to mitigate
the issue for other misbehaving code.

Bug: https://code.google.com/p/android/issues/detail?id=152173
Change-Id: I0fb8390207422c784800dda25b1f2c03d4574bcd
2015-03-11 10:00:28 -07:00
James Cook
2a914cb3ae Merge "Handle undo in TextView fields with no cursor" 2015-03-10 17:42:48 +00:00
James Cook
900185d003 Handle undo in TextView fields with no cursor
This fixes a rare crash in the undo system. In particular, if the
TextView did not have a cursor and the first operation was a
programmatic insert/append the "old cursor position" would be -1.
Attempting to undo would try to restore the cursor to -1 and crash.

Test will land separately in CTS.

Bug: 19332904
Change-Id: I9aa18c1e3621b99d13ac707e483154382effb81c
2015-03-10 10:25:26 -07:00
Alan Viverette
7d6bc4f022 Merge "Revert RelativeLayout's baseline view to API 22 and below behavior" 2015-03-10 17:19:53 +00:00
Roozbeh Pournader
d1eca77c3c Merge "Fix: Drag handles are not shown for selection/insertion" 2015-03-10 01:06:03 +00:00
Alan Viverette
0e14a85768 Revert RelativeLayout's baseline view to API 22 and below behavior
The previous behavior used the top-start-most view, rather than the view
with the bottom-most baseline. Which doesn't really make sense, but
that's what it did.

Bug: 19653790
Change-Id: Ia23476f1d2de5313fd82aac037e90d45b0af8972
2015-03-09 18:01:19 -07:00
Scott Kennedy
6c4c58d6d9 Merge "Add more @Nullable annotations" 2015-03-07 01:34:49 +00:00
Scott Kennedy
ed2b5f8aca Add more @Nullable annotations
Change-Id: I5b2935eb5e63289d80ebf9bf70741800b1c0934a
2015-03-06 17:24:58 -08:00
Yigit Boyar
0c7ffe4418 Merge "Remove original movements record from GridLayout" 2015-03-07 00:09:31 +00:00
Tor Norbye
c0a1b7f9a6 Merge "Annotate ARGB integer parameters with @ColorInt" 2015-03-06 23:15:27 +00:00
Scott Kennedy
1592f98973 Merge "Allow attrs to be @Nullable in TextView and LinearLayout" 2015-03-06 18:45:25 +00:00
James Cook
f7e503de70 Merge "Support undo of some programmatic TextView changes" 2015-03-06 15:42:06 +00:00
Scott Kennedy
3a1fa10e13 Allow attrs to be @Nullable in TextView and LinearLayout
Change-Id: I46ac6cddf010e7ce59de6272c30e824104e28acb
2015-03-05 19:15:11 -08:00
Tor Norbye
80756e3888 Annotate ARGB integer parameters with @ColorInt
Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
2015-03-05 16:34:12 -08:00
Yigit Boyar
38d909a57d Fix build. getAlingment should not be public
Change-Id: I4abde1ddc78367795601215106388d6eb535cbca
2015-03-05 22:40:06 +00:00
Yigit Boyar
fbd9997e68 Remove original movements record from GridLayout
Change-Id: Iebb761d0195b9d123dada1262090a71c4c175c5e
2015-03-05 22:20:12 +00:00
Yigit Boyar
6dafd87fb4 Fix some weight bugs in grid layout
This CL also changes how GONE views are considered.
Previously, they would still participate in weight calculations.
Now, they are ignored.

Bug: 19546781

Sub bugs:

Bug: 19571249
Bug: 19571653
Bug: 19571319
Bug: 19571841
Change-Id: I7344f757d3a76be98bb92660f07d2a0cafa9ac12
2015-03-05 22:01:14 +00:00
Mady Mellor
138bc2f37b Merge "Text selection changes - smart handles & drag accelerator" 2015-03-05 15:15:26 +00:00
James Cook
48e0fac6c2 Support undo of some programmatic TextView changes
Applications can use TextWatcher.afterTextChanged() to implement
post-edit formatting of text, such as inserting spaces in a credit
card number. From the user's perspective, the insertion of the spaces
is not a separate action, so that change should be merged with the
previous undo operation.

* Force merge undo states for edits that are triggered by callbacks
  after the InputFilter, such as TextWatchers.
* Reset the undo state when the whole field is reset with setText().
* Create separate undo operations for direct programmatic changes to
  the Editable (e.g. directly calling insert).
* Remove part of the non-forced replacement edit merging code. An
  improved version will land in the next CL.

Bug: 19332904
Change-Id: Iba5366a5aadbe3534554b668f8d417250deff505
2015-03-03 14:32:44 -08:00
Chris Craik
4939e2bf36 Merge "Improve docs for drawable tint and color filters" 2015-03-03 16:46:48 +00:00
Chris Craik
bd3bfc5285 Improve docs for drawable tint and color filters
bug:19564477
Change-Id: I7e11baae2d4dd245965904c85b8855de71f6b6ac
2015-03-02 16:21:02 -08:00
Alan Viverette
445e1c5ddd Merge "Improve handling of activity destroy during popup exit animation" 2015-03-02 22:24:25 +00:00
Alan Viverette
df4639a013 Improve handling of activity destroy during popup exit animation
Ensures the decor view isn't double-removed and that we don't try to
dereference a null anchor view.

Bug: 19553353
Bug: 19551371
Change-Id: I191a41f9065b68e49d66f96794cb7456f79d2d34
2015-03-02 12:40:34 -08:00
Mady Mellor
2ff2cd873c Text selection changes - smart handles & drag accelerator
Drag accelerator:
After entering text selection mode, immediately dragging your finger
along the screen will select text. Once you have dragged past the initial
word the selection an offset is added so that the end of the selection is
not below your finger.

Smart handles:
When expanding the selection the handles snap to words, when shrinking the
selection the handles go by character, once you're in by-character mode
you can expand by character until you hit a word boundary where you will
then expand by word again. Your finger must past the first ~2 characters
in a word before the handle will jump to the word boundary.

Bug: 19356160
Bug: 19355947
Change-Id: I79b8ec5ae3159148cd2f15d2e63dd5045c2069e4
2015-03-02 10:37:01 -08:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
James Cook
f1dad1ea82 Add TextView XML attribute for undo support
* Defaults to true, but can easily be changed if we decide that undo
  should be off by default.

Bug: 19332904
Change-Id: Ic4f3814a1b0a5e25171a910f2fe628606e16104e
2015-02-27 13:40:56 -08:00
James Cook
471559f129 Reland: Improvements to TextView Ctrl-Z undo support
This relands commit 7713d18847 which was
reverted in commit 3ac0bcb095.

Original description:
* Undo/redo restores cursor position
* Multiple deletes are consolidated into a single operation
* Don't create undo history for invalid or no-op operations
* Move logic for merging operations into Editor.EditOperation

CTS tests in android.widget.cts.TextViewTest will land separately.

Bug: 19332904
Bug: 19450037
Bug: 19505388
Change-Id: Ice27e3c4e5e421b47be8c4e9964c10844e61b0fc
2015-02-27 13:39:56 -08:00
James Cook
7af589995f Merge "Reland: Add basic support for Ctrl-Z to editable TextViews" 2015-02-27 20:44:45 +00:00
Alan Viverette
228fd600ce Merge "Implement landscape layout for time picker dialog" 2015-02-27 18:13:54 +00:00
James Cook
f59152cf00 Reland: Add basic support for Ctrl-Z to editable TextViews
Reland 9201e79783 which was reverted in
c8f08e07a4.

Original description:
* Add an UndoManager to the Editor for each editable TextView
* Record operations as being owned by that Editor
* Parcel the undo state
* Wire hardware keyboard shortcuts Ctrl-Z for undo and Ctrl-Shift-Z
  for redo into TextView shortcut handling.
* Expose IDs for "undo" and "redo" for symmetry with cut/copy/paste.

Additional fix:
* Ensure each UndoOwner always has a valid mManager, even after the
  UndoManager is parceled and restored.

Bug: 19332904
Bug: 19505388
Change-Id: Iad4476e6e9ca952281e69bf22c07cca915dfa7bd
2015-02-27 10:04:08 -08:00
Keisuke Kuroyanagi
7340be7993 Fix: Drag handles are not shown for selection/insertion
Bug: 19538371

Change-Id: I9017ae37bfd456272787aa4705d5a1608690f0cb
2015-02-27 17:57:49 +09:00
Chris Banes
9cc36ca1b5 MenuItem, navigation and overflow icon tinting
- iconTint and iconTintMode attrs for MenuItem, with
  associated setters.
- navigationTint and navigationTintMode attrs for Toolbar
  with associated setters.
- overlflowTint and overflowTintMode attrs for Toolbar
  with associated setters.

BUG: 18126050
BUG: 19148351
BUG: 19305408

Change-Id: Ibd1fae7cdbc7a7c42809e52541fae5d8beb18e92
2015-02-27 08:56:04 +00:00
Alan Viverette
39df5fea22 Merge "Vertically center seek bar track and thumb when maxHeight is set" 2015-02-26 21:48:49 +00:00
Alan Viverette
3afd8b0d1a Vertically center seek bar track and thumb when maxHeight is set
Also removes unused tinting method from ProgressBar.

Bug: 19480491
Change-Id: I9faeff51870088c2b5ba7386dfbfd7c4898c5564
2015-02-26 13:36:28 -08:00
James Cook
14a92fe75d Merge "Revert "Add basic support for Ctrl-Z to editable TextViews"" 2015-02-26 20:34:16 +00:00
James Cook
c8f08e07a4 Revert "Add basic support for Ctrl-Z to editable TextViews"
This reverts commit 9201e79783.

It causes crashes on typing after device orientation change.

Bug: 19332904
Bug: 19505388
Change-Id: I0d9fb728eb6f8d591beb35fab333c0a182e24542
2015-02-26 12:30:04 -08:00
Brian Attwell
32e819131b Merge "QuickContacts can prioritize phone mimetype. Part1" 2015-02-26 20:19:20 +00:00
James Cook
cd2a712f1b Merge "Revert "Improvements to TextView Ctrl-Z undo support"" 2015-02-26 19:55:45 +00:00
Brian Attwell
7035f2be61 QuickContacts can prioritize phone mimetype. Part1
Define the ContactsContract for a new QuickContact extra.
This can be used to tell QuickContacts to prioritize a
given mimetype.

Bug: 18391003
Change-Id: Ie5a93ad9e1919f470a638d4235d91fe337cb5ca3
2015-02-26 11:47:25 -08:00
James Cook
3ac0bcb095 Revert "Improvements to TextView Ctrl-Z undo support"
This reverts commit 7713d18847.

It causes crashes on text input after device orientation change.

Bug: 19332904
Bug: 19450037
BUG: 19505388
2015-02-26 10:53:41 -08:00