Commit Graph

5492 Commits

Author SHA1 Message Date
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
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
Doris Liu
f36c061909 Make ListView's EdgeEffect respect the clipToPadding flag
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
2015-06-04 17:50:47 -07:00
Clara Bayarri
c1f28bc97d Merge "Separate the SelectionActionMode into Insertion and Selection." into mnc-dev 2015-06-05 00:40:43 +00:00
Clara Bayarri
7938cdbf98 Separate the SelectionActionMode into Insertion and Selection.
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
2015-06-04 20:46:19 +01:00
Alan Viverette
97e1be8ef6 Account for margins in ScrollView onMeasure() when filling viewport
Bug: 19247610
Change-Id: I8e43cd9c28652cd8a0fed9b896394b976c9817a9
2015-06-04 10:56:27 -07:00
Alan Viverette
2e4e5d745f Merge "Revert "Synchronize selected item data on-demand after data set invalidation"" into mnc-dev 2015-06-04 17:19:27 +00:00
Alan Viverette
31ff78b146 Revert "Synchronize selected item data on-demand after data set invalidation"
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
2015-06-04 17:18:34 +00:00
Keisuke Kuroyanagi
4186b1d4d8 Merge "Stop offering "Replace..." when there are no suggestions." into mnc-dev 2015-06-04 06:06:52 +00:00
Alan Viverette
8d6a9363a1 Merge "Fix drop down layout inflation in ThemedSpinnerAdapter classes" into mnc-dev 2015-06-03 23:48:41 +00:00
Alan Viverette
d3c9df1a34 Merge "Update number picker styling for Material" into mnc-dev 2015-06-03 23:35:02 +00:00
Alan Viverette
e9bb596cc8 Merge "Synchronize selected item data on-demand after data set invalidation" into mnc-dev 2015-06-03 23:29:10 +00:00
Alan Viverette
7d5967e55e Fix drop down layout inflation in ThemedSpinnerAdapter classes
Bug: 21209640
Change-Id: I32aed1b70977fae25f43714eb3ef6edca53e51e9
2015-06-03 16:27:36 -07:00
Alan Viverette
b8da5340f2 Merge "Pass setEnabled() value in calendar-mode DatePicker delegate" into mnc-dev 2015-06-03 23:20:36 +00:00
Raph Levien
88ac4e04a5 Merge "Rename setTextDir to setTextDirection" into mnc-dev 2015-06-03 23:09:49 +00:00
Clara Bayarri
eb66533716 Merge "Fix Floating tool bar covers text during long press + drag" into mnc-dev 2015-06-03 22:33:59 +00:00
Alan Viverette
abed07f6c0 Synchronize selected item data on-demand after data set invalidation
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
2015-06-03 15:19:13 -07:00
Mady Mellor
95753e2f4b Merge "Ensure to reset state of selecting by word/char for new selections" into mnc-dev 2015-06-03 21:15:19 +00:00
Alan Viverette
f7aa9251d0 Pass setEnabled() value in calendar-mode DatePicker delegate
Fixes mContainer referencing wrong view. Also cleans up getCalendarView()
exception message.

Bug: 21211308
Change-Id: I4ad18206a8071b2c9b75d488e14fd53da6f5fa5b
2015-06-03 14:07:26 -07:00
Clara Bayarri
dfac443516 Fix Floating tool bar covers text during long press + drag
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
2015-06-03 22:06:55 +01:00
James Cook
8fd48ca377 Merge "Fix TabHost stealing focus on hardware keyboard keypress" into mnc-dev 2015-06-03 20:58:52 +00:00
Raph Levien
a6a082862b Rename setTextDir to setTextDirection
StaticLayout.Builder used "setTextDir" as a shorthand, but it's not
as clear as spelling it out. So, setTextDirection.

Bug: 21572282
Change-Id: Ia94476562d70678f963196b87bb63511d30836b6
2015-06-03 13:20:45 -07:00
Mady Mellor
36d5a7b225 Ensure to reset state of selecting by word/char for new selections
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
2015-06-03 19:53:52 +00:00
Adam Powell
c52e0d900c Merge "Properly restore RTL state in HorizontalScrollView" into mnc-dev 2015-06-03 19:52:26 +00:00
Alan Viverette
4a7bb4624f Merge "Call dispatchFinishTemporaryDetach before returning a transient view" into mnc-dev 2015-06-03 18:28:50 +00:00
Adam Powell
a3aa6d8278 Properly restore RTL state in HorizontalScrollView
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
2015-06-03 10:56:45 -07:00
Alan Viverette
6c413ce638 Call dispatchFinishTemporaryDetach before returning a transient view
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
2015-06-03 10:35:44 -07:00
James Cook
d8b7d2ce2d Fix TabHost stealing focus on hardware keyboard keypress
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
2015-06-02 16:02:12 -07:00
Alan Viverette
d281428abd Update number picker styling for Material
Implements several missing drawable maintenance methods (state, etc.)
for NumberPicker's divider.

Bug: 21588885
Change-Id: Ibe37884354864c43fbf84d9eb79d7183af46fcad
2015-06-02 15:47:37 -07:00
Alan Viverette
2add9bcf8c API review feedback for ThemedSpinnerAdapter, Spinner
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
2015-06-02 14:54:40 -07:00
Clara Bayarri
a0b77dd5e2 Merge "Fix TextView ActionMode overflow finishes the ActionMode" into mnc-dev 2015-06-02 01:15:50 +00:00
Clara Bayarri
d63a177670 Merge "Make Text Selection Action Mode secondary items IF_ROOM" into mnc-dev 2015-06-02 01:15:03 +00:00
Jorim Jaggi
03a7c4c6d4 Fix shared drawable state
Not calling mutate here had a side-effect making the icon in the
status bar untintable in SysUI.

Bug: 21566007
Change-Id: Ifb78c81ba7f04d496f14031ef635a6e964e6280e
2015-06-01 23:59:00 +00:00
Alan Viverette
b0f94ae5d2 Merge "Always send VIEW_CLICKED event from AdapterView.performItemClick()" into mnc-dev 2015-06-01 23:52:36 +00:00
Alan Viverette
376c32f268 Always send VIEW_CLICKED event from AdapterView.performItemClick()
This makes it consistent with View.performClick().

Bug: 19574976
Change-Id: I00b222d56aa6fac03c2e6ead0604ee2ff3a6969d
2015-06-01 16:41:42 -07:00
Alan Viverette
e0e5c1cf19 Merge "Clean up AbsListView constructor" into mnc-dev 2015-06-01 21:56:36 +00:00
Alan Viverette
7eceda3020 Clean up AbsListView constructor
Change-Id: I5ebe0074849228e5c7fd629df6d1055c867debc8
2015-06-01 10:47:29 -07:00
Alan Viverette
7b2f86488c Don't ignore explicit dividerHeight of 0 specified in XML
Also minor cleanup and adding annotations.

Bug: 21420748
Change-Id: I89edcd3ce423ad75a4028bebf0dcd828b9619c15
2015-06-01 10:30:21 -07:00
Alan Viverette
db2911321b Merge "Replace PNG-based seekbar thumb animation with AVD" into mnc-dev 2015-05-29 22:51:04 +00:00
Alan Viverette
87e1938be8 Replace PNG-based seekbar thumb animation with AVD
Adds optical inset support for VectorDrawable and GradientDrawable.

Bug: 19944181
Change-Id: I9df04d9fe17ad858413e7f93694bf37ee2c43c85
2015-05-29 15:12:14 -07:00
James Cook
63b6320af4 Merge "assist: Fix reported colors/styles for TextView/Switch" into mnc-dev 2015-05-29 17:30:23 +00:00
Clara Bayarri
a447937dd3 Fix TextView ActionMode overflow finishes the ActionMode
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
2015-05-29 16:33:35 +01:00
Clara Bayarri
aee243b825 Make Text Selection Action Mode secondary items IF_ROOM
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
2015-05-29 16:33:35 +01:00
James Cook
5cfaae4aae assist: Fix reported colors/styles for TextView/Switch
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
2015-05-28 15:52:44 -07:00