Commit Graph

5147 Commits

Author SHA1 Message Date
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
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
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
Narayan Kamath
4a02b70aae am f1eaa123: am 4d8caa55: am 8cba382f: Merge "Bad month value in DatePicker in Calendar Mode"
* commit 'f1eaa12385e36d835e805005e9bafde67f560f20':
  Bad month value in DatePicker in Calendar Mode
2015-02-26 18:16:16 +00:00
Narayan Kamath
f1eaa12385 am 4d8caa55: am 8cba382f: Merge "Bad month value in DatePicker in Calendar Mode"
* commit '4d8caa557670626768aabb55d213f9d091433d73':
  Bad month value in DatePicker in Calendar Mode
2015-02-26 17:56:52 +00:00
Narayan Kamath
4d8caa5576 am 8cba382f: Merge "Bad month value in DatePicker in Calendar Mode"
* commit '8cba382f04e4ead4a6b8c4a74216ddb383e8db91':
  Bad month value in DatePicker in Calendar Mode
2015-02-26 17:49:19 +00:00
Alan Viverette
62c79e9a64 Implement landscape layout for time picker dialog
Adds support overriding default alert dialog panel elements by including
them in the dialog's custom content view, but no public API (yet!) since
the panel IDs have never been public. Some minor cleanup and refactoring
in TimePickerDialog. Removes Holo styles for "clock" and "calendar" style
pickers since they are new in Material. If the new styles are used against
Holo they will match Material but with Holo primary/accent colors.

Also implements themed color state lists to resolve TODOs in both time
and date pickers.

Bug: 19431361
Change-Id: I095fd8d653e02d9e5d20d66611432a08a7a5685e
2015-02-26 09:47:10 -08:00
You Kim
49e6c4adbf Bad month value in DatePicker in Calendar Mode
Calendar MONTH field is zero based. Use predefined month.

Change-Id: I957bf385dc8e877e8698dacad68808f4d9d8a6d0
2015-02-26 19:06:16 +09:00
Alan Viverette
745677f117 Merge "Clean up AlertDialog javadocs, add overlay theme for dialogs" 2015-02-26 01:36:49 +00:00
Keisuke Kuroyanagi
b103709d02 Paste as plain text by Ctrl-Shift-V
Detect Ctrl-Shft-V in onKeyShortcut() and perform paste
as plain text.

Bug: 19287899
Change-Id: I0b27bf6155222a042eeb61dfbd4544c8312904ce
2015-02-24 12:51:46 +09:00
Alan Viverette
49f118ef08 Clean up AlertDialog javadocs, add overlay theme for dialogs
Also cleans up CheckedTextView javadocs.

Bug: 19482450
Change-Id: I47559533784b19267e9381af10c456ce0d20d329
2015-02-23 17:15:27 -08:00
Alan Viverette
6a8253fdc9 Update progress bar and seek bar backgrounds, fix seek bar thumb
Ensures LayerDrawable copies out the correct layer properties during
"tileification". This really needs to be deprecated or replaced in a
future CL, though, because it is potentially lossy (e.g. for
RippleDrawable, which is an instanceof LayerDrawable).

Bug: 19448441
Change-Id: I483e9c34fd781e280c13eb5951f96bc71a252819
2015-02-23 12:49:47 -08:00
James Cook
db871da48f Merge "Improvements to TextView Ctrl-Z undo support" 2015-02-23 20:31:14 +00:00
James Cook
7713d18847 Improvements to TextView Ctrl-Z undo support
* 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
Change-Id: I9c7887aecdd0209e783fb7cda4cb7081a97a98cd
2015-02-23 12:23:47 -08:00
Alan Viverette
adbc95f015 Update time picker to match latest Material spec
Also removes saveLayerAlpha() call from radial time picker's disabled
drawing path.

Bug: 19431361
Change-Id: I18641bb9544107bb8704fc43d0dd6c5b18ff99ce
2015-02-20 10:51:33 -08:00
James Cook
9201e79783 Add basic support for Ctrl-Z to editable TextViews
* 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.

Tests in CTS TextViewTest will land separately in ag/635321

Bug: 19332904
Change-Id: Ibd23843f86b4cd556751faa0b3ad1f35d6d49785
2015-02-19 10:32:14 -08:00
Tor Norbye
7b9c912f53 Add @ResourceInt annotations on APIs
Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
2015-02-18 07:49:03 -08:00
Alan Viverette
7a94dcfb71 am 7286d1ff: am 157c75e4: am 504c77e1: am d611fc4e: Merge "Fix year picker initial range" into lmp-mr1-dev
* commit '7286d1ff3747d3a71aeb2c8724947b35cc77d2d5':
  Fix year picker initial range
2015-02-18 00:30:15 +00:00
Alan Viverette
7286d1ff37 am 157c75e4: am 504c77e1: am d611fc4e: Merge "Fix year picker initial range" into lmp-mr1-dev
* commit '157c75e4b55d34d0426d08044130d74c2369be07':
  Fix year picker initial range
2015-02-17 22:51:53 +00:00
Alan Viverette
2a90fa6d94 Fix year picker initial range
BUG: 19410328
Change-Id: I2a2952eb58eb856f93b7af2f49e08abe71078aa9
2015-02-17 21:11:36 +00:00
Alan Viverette
ff8dbfea75 Merge "Add missing accessor to CompoundDrawable, clean up javadoc" 2015-02-13 18:51:44 +00:00
Raph Levien
8ff773a3c8 Merge "Fix EditText RenderNode invalidation bugs" 2015-02-13 18:06:14 +00:00
Raph Levien
bb2397c523 Fix EditText RenderNode invalidation bugs
EditText uses a TextDisplayList data structure to hold RenderNode
objects for optimized incremental drawing. This data structure uses an
isDirty flag to indicate when it has been invalidated and needs to be
re-rendered. This flag was not being computed correctly, leading to
excessive re-rendering.

This patch clears isDirty after rendering text into the RenderNode, so
that it can be reused until it is invalidated, and also explicitly sets
it when it is recycled.

Bug: 19371378
Change-Id: I70239cc30e43bb8631dfffc2ea2705e8d4c452f4
2015-02-12 16:29:25 -08:00
Alan Viverette
6a394f4def Add missing accessor to CompoundDrawable, clean up javadoc
Removes button resource identifier field, which was useless.

Bug: 19369976
Change-Id: I1a34cb981a2db93d10e93ff954294f76ea604006
2015-02-12 15:03:22 -08:00
Neil Fuller
a2c7884518 Merge "Remove usages of FloatMath" automerge: a8e8cdb automerge: 27316a9
automerge: c1a5e82

* commit 'c1a5e82c25dba954cf1c06729e53bfb67667bcbb':
  Remove usages of FloatMath
2015-02-12 19:29:45 +00:00
Neil Fuller
c1a5e82c25 Merge "Remove usages of FloatMath" automerge: a8e8cdb
automerge: 27316a9

* commit '27316a93e5979859ae98f506eca365784353007a':
  Remove usages of FloatMath
2015-02-12 10:00:41 +00:00
Neil Fuller
e573aa9371 Remove usages of FloatMath
Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: Iec8fb663ed54eb967050f6ff25a36ba534204c4d
2015-02-12 09:20:31 +00:00
RoboErik
bb8ed646f0 Merge "Pass the new progress when updating a ProgressBar" 2015-02-11 22:15:49 +00:00
RoboErik
5b07143e36 Pass the new progress when updating a ProgressBar
There was a race condition where the update for a progress change
from the user could pass the wrong progress value causing apps to
treat a non-user update as a user update.

bug:18515012
Change-Id: Ia62a1d07cd15f99effbf644642307c71049748f2
2015-02-11 13:52:05 -08:00
Scott Kennedy
76c382ed67 Add @Nullable to AttributeSet in a couple constructors
Change-Id: I184113680c5dc867b353df81961e93523b91bbc5
2015-02-10 23:15:39 -08:00
Jorim Jaggi
b10e33ff80 Split up android.policy into framework.jar and services.jar 1/3
Change-Id: Ifd69f1f3dd308a7e17a1442e2f3950da8b03cec4
2015-02-10 14:56:02 +01:00
Dianne Hackborn
a7bb6fbeab First quick implementation of auto assist data.
Introduce new AssistData class that contains all data
the framework automatically generates for assist.  Currently
populated with a very simple tree structure representing
the app's view hierarchy.

Reworked how we populate the class name for accessibility
info, so this is provided through a new method call on View
that subclasses can override.  This method is also used
to populate the class name in AssistData.

Change-Id: Ibd0acdc8354727d4291473283b5e4b70894905dc
2015-02-06 10:42:44 -08:00
Alan Viverette
b989c5561e resolve merge conflicts of da9653a to master.
Change-Id: I7458452389fb7b048fe5c6daa375fd4dbb9d9766
2015-02-05 17:10:47 -08:00
Alan Viverette
cbe32de454 am 9a166c7d: Merge "Mutate scroll bar drawables" into lmp-mr1-dev
automerge: 80b381c

* commit '80b381c0736c1af43801b8ed26428abdf4d437b3':
  Mutate scroll bar drawables
2015-02-06 00:53:09 +00:00
Alan Viverette
9a166c7da3 Merge "Mutate scroll bar drawables" into lmp-mr1-dev 2015-02-06 00:19:44 +00:00
Alan Viverette
f8512ce081 Mutate scroll bar drawables
Bug: 19285726
Change-Id: I4bb596433c1fa1cc4e2fa53d0cdae992f9add858
2015-02-05 15:58:56 -08:00
Alan Viverette
323d888b64 am eeb69d17: Move layer-list to be top-level element in seek bar progress automerge: bac8e12 automerge: 6708ac4
* commit 'eeb69d171b4023e92fb729bf61d566540bdd5220':
  Move layer-list to be top-level element in seek bar progress
2015-02-05 03:50:28 +00:00
Alan Viverette
eeb69d171b Move layer-list to be top-level element in seek bar progress automerge: bac8e12
automerge: 6708ac4

* commit '6708ac40f29c2437d3cb67ffa7604aecbdad1fe7':
  Move layer-list to be top-level element in seek bar progress
2015-02-05 03:45:31 +00:00
Alan Viverette
77ad055957 am c2bf7440: Merge "Allow top-level drawable container in progressDrawable" into lmp-mr1-dev automerge: 80252a9 automerge: a638c44
* commit 'c2bf7440ba9e3484d37d9c5df2ef02710682b7ed':
  Allow top-level drawable container in progressDrawable
2015-02-05 02:53:52 +00:00