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
Fix an incorrect unparceling of the previous saved state in
HorizontalScrollView. Remove an unneeded field in the saved state by
storing scroll offset from start instead of scrollX + isRtl.
Bug 20666194
Change-Id: I1ec45b3e3bd0846b5f659356df7ff94f42e61055
ListView caches transient state views for reuse during layout, which calls
dispatchStartTemporaryDetach() before caching the view. This should always
be followed by a corresponding dispatchFinishTemporaryDetach() before
removing the view from the cache and returning it for reuse. While this
was the case for other types of cached views, we missed this call for
views placed in one of the two transient view caches.
Bug: 17387206
Change-Id: I360945006558b2783c098183a7cc9bc28d05d9ab
Don't try to change focus at all on exit from touch mode. The old
behavior might have been useful for very old apps with a TabHost as
their primary UI, but that's not a modern app structure.
Bug: 21417491
Change-Id: I3db2ab42c90b6c82f23216244a8183c4290eb7d7
Moves themed interface out of Spinner and extends SpinnerAdapter, updates
Spinner constructor to take a Theme rather than a Context.
Does NOT change BaseAdapter to implement ThemedSpinnerAdapter, because
the BaseAdapter class does not have any notion of layout inflation and
that would break the contract implied by ThemedSpinnerAdapter.
Bug: 21571899
Change-Id: Id7e8d630458857ce6c93a6a8b8f920e169ee1152
Not calling mutate here had a side-effect making the icon in the
status bar untintable in SysUI.
Bug: 21566007
Change-Id: Ifb78c81ba7f04d496f14031ef635a6e964e6280e
stopSelectionActionMode() was called within hideCursors, and this
gets called in many scenarios. One of them is onWindowFocusChanged,
which is triggered when the user clicks the overflow icon in the
action bar. Removed the action mode call from this use case.
Bug: 21267270
Change-Id: I1cd359e87de67141627e25d2ec520fc91303a48d
The fact that they were all ALWAYS caused the ActionBar version
of the ActionMode to show truncated text to try and fit them all.
In an ideal case we will always have a Floating ActionMode, but
the client can explicitely change this and hence we should fallback
gracefully.
Additionally, remove the SHOW_AS_ACTION_WITH_TEXT flags as we
removed the icons from the items anyway.
Bug: 21264711
Change-Id: I13a9aafd0fc6f6642d3a4a3399f71e739a1dce8d
Changes to the data provided to AssistStructure:
* Text foreground color is correct even if the view has not yet been
painted.
* Text background color is now always 1 (TEXT_COLOR_UNDEFINED) for a
TextView, as it has no separate concept of background color.
* Switch now reports the text size/color/style of the label text
(usually user visible) rather than the on/off text on the button
itself (usually hidden in Material, and not usually revelant when
visible).
Bug: 21080375
Change-Id: I7e15f68d89510a76cab76031c2c8ca6ca3f32435