-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
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
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
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
This fixes a crash that happened because mStartOffset
could point to an invalid offset after changing the text.
Bug: 21178876
Change-Id: I2fbb5ea3d6b8c5a97ca7248116b58ead673a8b0a
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
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
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
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
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
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
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
This CL sets the position of EdgeEffect based on whether
clipToPadding is enabled. When enabled, the EdgeEffect will be
bounded to the padding. Otherwise, it will be drawn at the view's
bounds.
Bug: 21595866
Change-Id: I3968e5b8d3a75ce2d7607e2037bc372024694d5b
When we got rid of the paste popup, we merged it into the Selection
ActionMode and moved all its invocations to the ActionMode. Some apps
actually want the paste popup without the Selection ActionMode, hence
separating them again allows them to cancel the one they want.
Bug: 21571422
Change-Id: I91bcd0d9c3e68d9c736698fe0bec010b4c9f5cf3
This CL was a can of worms. More extensive changes are
needed to decouple AdapterView state from measure/layout
passes.
This reverts commit abed07f6c0.
Change-Id: I4e4e01692a1f660a04e9dfd16db882f13c3d0b94
Previously, the selected item data could become inconsistent between a
call to Adapter.notifyDataSetChanged()/Invalidated() and the subsequent
layout pass.
Bug: 21614294
Change-Id: I45c9c98b2f6a8d8b8fb17de2065efa505cbf3c92
The existing implementation started the ActionMode even when knowing
a drag would start. Moved this logic to once the drag is complete,
to avoid the toolbar popping up while the user is still dragging.
Since the existing method selected the initial word when no other
selection existed, refactored that logic so it is also performed at
the start of the drag. Otherwise, the user sees no selection until
he drags over 2 or more words.
Bug: 21144634
Change-Id: I97cf89b1c4c3ebdbbd1af50bd1ce5aa4af72164b
StaticLayout.Builder used "setTextDir" as a shorthand, but it's not
as clear as spelling it out. So, setTextDirection.
Bug: 21572282
Change-Id: Ia94476562d70678f963196b87bb63511d30836b6
Previously this value was only updated when interacting with the
selection handles, so if you started a selection, entered by-char mode,
and then started another selection you would still be in by-char mode.
This resulted in incorrect behavior.
This CL alters the logic to update the handle state whenever the cursor
is placed which will included the initial long press to select a word.
Bug: 21301589
Change-Id: I15dbe6f2b76c7edd8ea4b3ba53e7107c47bc48fa