Commit Graph

5535 Commits

Author SHA1 Message Date
Doris Liu
ec6a4cdeda Fix logic for whether beginning/end divider should be drawn
Bug: 18945384
Change-Id: Ib8e785cb97d288e39a39b968bcb9c05410acbe34
2015-06-25 15:29:41 -07:00
Mady Mellor
03709c780a Merge "Text selection: update touch delta when moving towards handles" into mnc-dev 2015-06-18 17:26:04 +00:00
Adam Powell
2a1f916418 Merge "Un-hide ViewGroup#onViewAdded/onViewRemoved" into mnc-dev 2015-06-18 17:20:44 +00:00
Adam Powell
6690d018b9 Un-hide ViewGroup#onViewAdded/onViewRemoved
These methods are generally useful for writing custom views, and by
exposing them we make it easier for custom view authors to still allow
app developers to use an OnHierarchyChangedListener since it will not
be occupied by a custom view's implementation.

Also move the actual dispatch to package-scoped dispatch methods so
that a developer forgetting to call super won't stop a listener from
functioning.

Bug 21866523

Change-Id: Ie2bb5e241d7c5a02a5033f33ecdaeb40aceb20b5
2015-06-18 10:19:18 -07:00
Mady Mellor
9a08fe2aca Merge "Update button press in AbsListView to use new MotionEvent APIs" into mnc-dev 2015-06-18 15:46:27 +00:00
Keisuke Kuroyanagi
fe67c1ec6d Merge "Fix: Drag handle jumps between bidi boundaries." into mnc-dev 2015-06-18 03:43:44 +00:00
Chet Haase
45bb0ca49a Merge "ImageView updates cached drawable dimensions when drawable updates" into mnc-dev 2015-06-17 23:07:17 +00:00
Raph Levien
8872ca4d55 Merge "Remove indents from TextView" into mnc-dev 2015-06-17 23:06:17 +00:00
Raph Levien
8edac58e55 Remove indents from TextView
On more careful reflection, the "indents" feature was not ready for
inclusion in the public API. It is still available at a lower level
in StaticLayout.

Also fix a minor typo in the doc for breakStrategy.

Bug: 20641996
Change-Id: I5cd976a536c48615980860396b1564b51b19e14a
2015-06-17 15:53:33 -07:00
Chet Haase
8473f5a768 ImageView updates cached drawable dimensions when drawable updates
Changes to drawable dimensions were not propagated to cached dimension
values in ImageView. Now this is done when the drawable is invalidated.

Issue #18798152  ImageView caches wrong value of mDrawableWidth and mDrawableHeight

Change-Id: I8da7d82b0543fa02d8ef3d896595bd0e5ea2a61e
2015-06-17 15:28:25 -07:00
Alan Viverette
e1c947263f Merge "Work around inconsistent views in RelativeLayout.onMeasure()" into mnc-dev 2015-06-17 22:10:11 +00:00
Alan Viverette
3e2e064a1f Work around inconsistent views in RelativeLayout.onMeasure()
Previously, RelativeLayout's measure pass could crash if the view's
children were modified without calling requestLayout() prior to the
next measure pass. This avoids the issue by only looking at the most
recent set of sorted views and preserves the previous behavior where
onMeasure() could return incorrect data.

Bug: 21123292
Change-Id: If471d071d1d2e2729cf13854d95b1f517c1fe73a
2015-06-17 13:42:32 -07:00
Adam Powell
074c340420 Merge "Add matching xml attributes for existing Toolbar properties" into mnc-dev 2015-06-17 20:22:37 +00:00
Yigit Boyar
5ddaa72b9a Merge "Handle negative view types properly in getScrapView" into mnc-dev 2015-06-17 17:58:27 +00:00
Mady Mellor
5279d11f25 Merge "Drag to select text: add some slop for moving between lines" into mnc-dev 2015-06-17 17:36:31 +00:00
Mady Mellor
ee3821e565 Insertion cursor: add some slop for moving between lines
Applying same method to insertion cursor as the text selection drag
handles to improve moving along lines.

Basically adds some slop above / below the current line and only
allows you to change lines if you move outside of that.

Bug: 21306433
Change-Id: I6c7f3a496fbd1ea66936832f96325736cea872aa
2015-06-17 09:48:38 -07:00
Mady Mellor
f9f8aebdc6 Drag to select text: add some slop for moving between lines
It's pretty easy to accidentally move to a different line when
selecting text. This CL makes an adjustment so that if the user
is on a line, they must move above the top of it + slop to move
up a line, and they must move below the bottom of it + slop to move
down a line. This applies the changes to the drag accelerator.

This CL also makes an adjustment to not apply the finger offset
to the drag accelerator until the user has moved lines, this was
causing an issue where it would immediately include the above line
when initiating the selection.

Bug: 21306433
Bug: 21303943
Change-Id: Id240136493f62524fe6445d8bd65479084fe8126
2015-06-17 09:46:01 -07:00
Mady Mellor
cc65c37f10 Text selection: add some slop for moving between lines
It's pretty easy to accidentally move to a different line when
selecting text. This CL makes an adjustment so that if the user
is on a line, they must move above the top of it + slop to move
up a line, and they must move below the bottom of it + slop to move
down a line.

This CL also makes a small modification to check if the layout is
null and return early which simplifies some of the following code.

Bug: 21306433
Change-Id: I4a854e644faafaf1e159201ae1f2838862f16b25
2015-06-17 09:25:19 -07:00
Mady Mellor
0d85d2af94 Update button press in AbsListView to use new MotionEvent APIs
Button press events now occur in onGenericMotionEvent rather than
onTouch event, this alters the code to listen in onGenericMotionEvent.

Bug: 21148238
Change-Id: Idfbd61683f40a25964c14ec26b71042657e2aaeb
2015-06-16 17:08:27 -07:00
Adam Powell
6b3fc9a903 Add matching xml attributes for existing Toolbar properties
Bug 21010256

Change-Id: I3ac9491d86dd502f7572e37a3c9b70ffb8957ced
2015-06-16 15:47:52 -07:00
Adam Powell
8edfe18c19 Merge "Fully remove Toolbar children when action views expand" into mnc-dev 2015-06-16 21:30:13 +00:00
Abodunrinwa Toki
f444b5c3ae Fix floating toolbar flickers.
-Flicker was a side effect the delay in hiding the toolbar when
there is a down press on a TextView handle. The timing clashed
with the time it takes for the FloatingActionMode to release a
hide lock on a changing content rect. Extra flickers also happened
if the ActionMode happened to be invalidated at about the same time.
Since there was no longer a hide lock, the toolbar refreshed, getting
rid of the "Select all" menu item.
FIX. I believe we don't need the delayed hide on down press on a
TextView handle. I've removed this.

-I've also updated FloatingActionMode to ensure that hide locks
overlap one another if necessary. The toolbar can only be visible if
all locks are off.

Bug: 21793687
Change-Id: I290ea45ab17d5862b453cb319afb4c8ffe084cd0
2015-06-16 15:47:04 +01:00
Yigit Boyar
f85e673980 Handle negative view types properly in getScrapView
ListView had a bug where it would pass wrong view to
the adapter if adapter is using HEADER or IGNORE types
for views.

This CL fixes that issue and ensures that ListView
will not try to search scrap view lists for these
views which are never recycled.

Bug: 19409057
Change-Id: I2653bbca93fbaf48567b47d10f273c8921d59bd2
2015-06-16 02:40:24 +00:00
Adam Powell
5f6228454d Fully remove Toolbar children when action views expand
The previous implementation of toggling visibility resulted
developer-set child visibility getting stomped. Fully detach child
views that shouldn't be shown instead. This is more consistent with
the coming and going of other system child views.

Bug 18156260

Change-Id: I8469d45eeb950dc0232f703efe8401233241c657
2015-06-15 14:33:45 -07:00
Dianne Hackborn
8a435ced67 Merge "Fix APIs." into mnc-dev 2015-06-12 16:34:38 +00:00
Keisuke Kuroyanagi
a31940df17 Merge "Reset drag accelerator state in Editor#sendOnTextChanged." into mnc-dev 2015-06-12 11:10:20 +00:00
Dianne Hackborn
ece0f4f519 Fix APIs.
Issue #21039494: API Review: android.os.PowerManager.isDeviceIdleMode()
Issue #21347000: API Review: android.content.IntentFilter
Issue #20654534: API Review: android.app.assist

Also allow use of ActivityManager.setWatchHeapLimit on any platform
build as long as the calling app is debuggable.

Change-Id: Ic597e596fa772fcdf2553b64f444b3d9269e8b92
2015-06-11 18:07:43 -07:00
Adam Powell
d5dbf4b2a0 Check targetSdkVersion when passing size hints for UNSPECIFIED specs
As of MNC stock widgets will pass a size in UNSPECIFIED MeasureSpec
values as a hint of the container size. This lets things like list items
size themselves at 1/3 the size of their container.

This breaks assumptions in a few existing applications, so maintain the
old expectation of 0 size in UNSPECIFIED MeasureSpecs for apps targeting
older SDK versions.

Bug 20975083

Change-Id: Ic7318e88854e00d96852dde2c0e10376b42bf77f
2015-06-11 13:57:41 -07:00
Keisuke Kuroyanagi
f4e347d6ae Reset drag accelerator state in Editor#sendOnTextChanged.
This fixes a crash that happened because mStartOffset
could point to an invalid offset after changing the text.

Bug: 21178876
Change-Id: I2fbb5ea3d6b8c5a97ca7248116b58ead673a8b0a
2015-06-11 17:41:00 +09:00
Chris Banes
dbdaa9b41e Merge "API council review feedback for ActionMenuView" into mnc-dev 2015-06-11 08:05:42 +00:00
Jun Mukai
b3aa575e3b Merge "Specifies the new height/width for update() on ListPopupWindow.show()." into mnc-dev 2015-06-10 21:13:28 +00:00
Clara Bayarri
89124000c6 Merge "Fix Floating tool bar flickers after long pressing on empty region." into mnc-dev 2015-06-10 16:50:46 +00:00
Keisuke Kuroyanagi
136a462c8b Merge "Revert "Fix: Crash when modifying text while using drag accelerator."" into mnc-dev 2015-06-10 15:13:16 +00:00
Keisuke Kuroyanagi
eac4556e55 Revert "Fix: Crash when modifying text while using drag accelerator."
This reverts commit 259292ff3d.

This introduced another bug (Bug: 21687602) and this is no longer useful
for the original one (Bug: 21178876).


Change-Id: I59acc161e7d8cba633718a3d17292e68740ef79e
2015-06-10 15:02:22 +00:00
Chris Banes
a41b78973d API council review feedback for ActionMenuView
Reverts "MenuItem, navigation and overflow icon tinting" CL,
and adds getter and setter for the overflow icon to ActionMenuView
and Toolbar.

BUG: 21571899

Change-Id: I591f43650356443fa3256e4d74e28b6ddd8c2b33
2015-06-10 11:39:01 +01:00
Jun Mukai
0eaec1f5d1 Specifies the new height/width for update() on ListPopupWindow.show().
The current code is doing setHeight()/setWidth() and then invokes
update() with -1 for height/width params. However, javadoc for
setHeight() says that "If the popup is showing, calling this method
will take effect the next time the popup is shown", and update()
says "Width and height can be set to -1 to update location only."

That said, ListPopupWindow should invoke update() with the obtained
width/height instead of invoking setWidth()/setHeight() to resize
the popup window correctly.

Bug: 21276583
Change-Id: I0961820ff2e845a0f68c20d6eea827aa898c2101
2015-06-09 15:11:45 -07:00
Selim Cinek
78528b22c2 Fixed a RTL layouting bug with LinearLayout
When the RTL properties of a horizontal LinearLayout
changed, nobody enforced the view to be layouted anew,
even though its layout is dependent on the layout
direction. This could lead to stale layouts being
temporarily layouted the wrong way.

Bug: 20495301
Change-Id: I979c8d86ee711626b2901b65ebdf007c1eb1c0fa
2015-06-09 18:33:19 +00:00
Clara Bayarri
b71ddddfd3 Fix Floating tool bar flickers after long pressing on empty region.
Bug: 21452427
Change-Id: Icc70b85279fde1aa9d5c10bd89bb886797a49235
2015-06-09 01:36:07 +01:00
Mady Mellor
43fd2f426a Text selection: update touch delta when moving towards handles
When the text selection drag handles jump to the end / start of a
word, the delta between the current touch position and where the
handle jumps to is tracked. Previously this value was not updated
if the handle jumped and then the finger moved towards the handle.

This CL adjusts the logic to update the delta in this situation.

Bug: 21131483
Change-Id: I331f53191103e1a3fc08e34b5df5cd6cbc177af6
2015-06-08 14:03:34 -07:00
Clara Bayarri
7184c8aaf1 Remove insertion action mode runnable on selection start
This was in a previous change and accidentally got reverted on a rebase.
When going from an Insertion to a Selection/Drag Mode we want to make
sure no insertion modes are started by pending requests.

Previous change with accidental rebase:
I91bcd0d9c3e68d9c736698fe0bec010b4c9f5cf3

Bug: 21647271
Change-Id: I32c152494d236b693a489ea97448904163c9620a
2015-06-08 17:46:30 +01:00
Abodunrinwa Toki
7d3b8833df Merge "Fix ActionMode.snooze API" into mnc-dev 2015-06-08 11:36:19 +00:00
Jae Seo
63d37d9f16 MediaController: Keep the controller when touch exploration is enabled
Also added missing final and @Override keywords

Bug: 17199815
Change-Id: If96554e36799557a2d81767f287aeb446e4a1983
2015-06-05 17:27:30 -07:00
Adam Powell
cedc7b3ba4 Merge "Use real rounding in ImageView bounds configuration" into mnc-dev 2015-06-05 20:07:07 +00:00
Alan Viverette
42cc892be1 Merge "Account for margins in ScrollView onMeasure() when filling viewport" into mnc-dev 2015-06-05 17:18:47 +00:00
Clara Bayarri
3e85c1ed0c Merge "Fix Select All should not be shown when everything is already selected" into mnc-dev 2015-06-05 16:19:31 +00:00
Adam Powell
14d1f1383f Use real rounding in ImageView bounds configuration
While a useful tactic in previous years, the (int) (float + 0.5f)
trick is inaccurate in some cases. Tradeoffs have changed; do the real
thing now.

Bug 20145160

Change-Id: I8af31bcb1945dc113fd36e094f5970ebd4ec0304
2015-06-05 08:51:45 -07:00
Abodunrinwa Toki
9e211282d3 Fix ActionMode.snooze API
Bug: 21572677
Change-Id: If9fdb8ace3773b983418b0148082712644fd1fa5
2015-06-05 03:35:15 +01:00
Clara Bayarri
01243ac57e Fix Toolbar is not refreshed after Select All
Bug: 21361248
Change-Id: Iab913bd610c208e5881d3d0eb5574efdf9eb5d92
2015-06-05 03:03:31 +01:00
Clara Bayarri
3b69fd81df Fix Select All should not be shown when everything is already selected
Condition Select All on whether the full text is already selected,
and add/remove this item when needed on ActionMode invalidation.

Bug: 21608943
Change-Id: Iad5f8a77a03b98024f7dcf355b2f7f0d1338b94a
2015-06-05 02:53:30 +01:00
Doris Liu
5de55868a9 Merge "Make ListView's EdgeEffect respect the clipToPadding flag" into mnc-dev 2015-06-05 00:57:32 +00:00