Commit Graph

5937 Commits

Author SHA1 Message Date
Oren Blasberg
96b22a98ce Merge "Add Cascading submenus implementation." 2015-09-10 16:58:01 +00:00
Oren Blasberg
8e12f8df07 Add Cascading submenus implementation.
This change adds a new Cascading implementation of MenuPopup. When
enabled, submenus will show up in a cascading side by side fashion
when opened next to popup menus.

Bug: 20127825
Change-Id: Ie3c797fb5dbada7521cd93dc4171950af2be2ff7
2015-09-10 09:54:17 -07:00
Alan Viverette
ad0020f807 Invalidate when Drawable.setState() returns true
Ensures views that manage drawables follow the contract set forth in
the Drawable.setState() documentation.

Bug: 23792020
Change-Id: I4e5a449cd6535487873fd8443da50555c38e8ed9
2015-09-04 10:10:42 -04:00
Oren Blasberg
b23976efdd MenuPopupHelper: Factor out a MenuPopup interface.
Move much of the responsibility into implementations of this interface.
Delegate functionality to it where appropriate.
Provide a standard (non-cascading) implementation for this interface.

This CL should have NO BEHAVIOR CHANGES.

A follow-up CL will provide a cascading implementation, whereby a
config variable will enable submenus to open side by side with their
parent menus. That CL will be the first with functional/ actual behavior
changes.

Bug: 20127825
Change-Id: Iecac2d340dd8750ebe4e99162d447c9411f09227
2015-09-02 11:52:24 -07:00
Roozbeh Pournader
008d6d034e Merge "Add LocaleList support to Paint and TextView." 2015-09-01 21:14:11 +00:00
Roozbeh Pournader
a23748a9ff Add LocaleList support to Paint and TextView.
This keeps the existing single-locale APIs working (and adds
parameter annotations to them), while adding an API for setting and
getting the whole locale list.  At the moment, the implementation
ignores the actual data in the locale list except for its primary
locale.

Also add a method to LocaleList to return the system's default locale
list. (Currently a one-member list just containing the system
default locale.)

Change-Id: Icea9d164ddae51f50dd71e18b5d91c96f233b8b8
2015-09-01 14:12:40 -07:00
Oren Blasberg
6b49d30034 Merge "Pull out widget helpers into their own classes." 2015-09-01 21:11:04 +00:00
Oren Blasberg
f44d90b5c2 Pull out widget helpers into their own classes.
This is in service of desktop-style submenus. Follow up CLs will make
use of the newly independent classes. MOST of the changes in this CL
are simply moving code from one place to another. Below are
descriptions of the new files added:

DropDownListView:
Decouple this from ListPopupWindow, so other "menu popup"
implementations [forthcoming] may make use of it.
This class is UNCHANGED except for the addition of the
setListSelectionHidden method.

ForwardingListener:
Decouple this from ListPopupWindow, so that other clients of this
listener can expect a more general ShowableListMenu rather than a
concrete ListPopupWindow.  This will be useful later when we want to
use something other than ListPopupWindow to show a menu.
This class is UNCHANGED, except for (1) using the getListView() on
popup rather than accessing its mDropDownList member, and (2)
replacing ListPopupWindow return values with ShowableListMenu.

MenuAdapter:
Decouple from MenuPopupHelper so it may be used by forthcoming "menu
popup" implementations rather than just by MenuPopupHelper itself.
This class is UNCHANGED.

ShowableListMenu:
A new interface to encapsulate a menu that can be shown or hidden.
This will be implemented by both ListPopupWindow and a forthcoming
"menu popup" class.

Bug: 20127825
Change-Id: I565b444d25e966ff8b8c6ceac7be8de56a9116df
2015-08-31 14:29:34 -07:00
Deepanshu Gupta
88db51084b Merge "Switch SimpleDateFormat to icu version" 2015-08-28 15:54:11 +00:00
Alan Viverette
798253e190 Expose password text to accessibility services, if requested
Otherwise, exposes the hint or the result of whatever transformation
method is set. This is consistent with what is displayed visually.

Bug: 23568127
Change-Id: Ib5c7fe78fb3b58feb36f0314638345bd40e401ab
2015-08-27 14:53:48 -04:00
Alan Viverette
bd1d652f37 am 8d8c53df: am 76c73ae4: am 12874d2d: am b9b57225: am 95137857: Merge "Avoid NPE when getPositionForView() is called on detached view" into mnc-dev
* commit '8d8c53df26ac29fa3c6df782eb49e8d50683a1dd':
  Avoid NPE when getPositionForView() is called on detached view
2015-08-26 21:23:45 +00:00
Alan Viverette
8d8c53df26 am 76c73ae4: am 12874d2d: am b9b57225: am 95137857: Merge "Avoid NPE when getPositionForView() is called on detached view" into mnc-dev
* commit '76c73ae495fe9bad5ed51b96cd8e509dbb8de46f':
  Avoid NPE when getPositionForView() is called on detached view
2015-08-26 21:13:04 +00:00
Seigo Nonaka
2041ffb8b5 Merge "Introduce simple SuggestionsPopupWindowTest." 2015-08-26 21:06:58 +00:00
Alan Viverette
898c7045e0 Avoid NPE when getPositionForView() is called on detached view
Bug: 23557674
Change-Id: I76cb5f06081b2ac4c8f535df8d1a0aee17d2bb20
2015-08-26 15:22:09 -04:00
Alan Viverette
40e1df34a9 Correctly distribute weight to pre-measured zero-dimension views
Previously, the measurements obtained from LinearLayout when using
EXACTLY and AT_MOST modes would be different even if the resulting
height was the same. This was the result of non-EXACTLY measurement
accounting for the size of zero-dimension views and then redistrib-
uting space as though they had initally been set as AT_MOST, whereas
EXACTLY would always redistribute space as though they had initially
been set as zero-dimension.

Makes perfect sense, right?

This CL updates non-EXACTLY measurement to always calculate the
minimum dimensions requested by zero-dimension views, but then to
redistribute the space according to weight.

Bug: 22810327
Change-Id: Iba8a3d26f2724e5fa9a30457119b4564eb285edb
2015-08-25 16:50:27 -04:00
Alan Viverette
e188fcc283 Merge "Pass Resources when loading ImageView source from stream" 2015-08-25 17:50:29 +00:00
Alan Viverette
8c0a4d0f8b Merge "Clean up ImageView" 2015-08-25 17:40:02 +00:00
Alan Viverette
270a34280e Pass Resources when loading ImageView source from stream
Only targets >M since developers may have already had workarounds in
place or been relying on the incorrect behavior.

Bug: 23383805
Change-Id: Ifa69b204b10b8084cf6486e41d5393969e197826
2015-08-25 13:25:16 -04:00
Alan Viverette
6aa92d1cfa Clean up ImageView
Refactors ImageView to use LOG_TAG constant, fixes indentation, trailing
whitespace, uses of final. No functional changes.

Change-Id: I9e67d9a152e1c6d646719afa5010c45868db9c6f
2015-08-25 13:19:25 -04:00
Alan Viverette
53b165ea54 Hide SearchView icon when no drawable set
Bug: 23511899
Change-Id: Ic2a4622f905779fc713482c60706c727274f9be5
2015-08-25 12:33:01 -04:00
Seigo Nonaka
a60160b30b Introduce simple SuggestionsPopupWindowTest.
This CL introduces very simple test case for SuggestionPopupWindow.
I'm going to introduce more test cases for complex scenario once this
approach is accepted, e.g. multiple suggestion span and misspelled flag.

This CL is a part of groundwork for Bug 15347319 and no user visible
change is intended with this CL.

Bug: 15347319
Change-Id: Idf166cbecb3e33be213e4104cf1afd827906f2ad
2015-08-20 12:03:20 -07:00
Alan Viverette
895615c363 Ensure layout resolution occurs when relative rules are removed
Bug: 23295655
Change-Id: Ic46b018859c5af8cabf2fa0677e002de7cb6a996
2015-08-18 14:51:48 -04:00
Alan Viverette
d920ac6e6f Merge "Use correct param for heightMode in RelativeLayout horizontal measure" 2015-08-18 13:28:44 +00:00
Yohei Yukawa
9dffc27b60 Merge "Clear SuggestionsPopupWindow.mSpansLengths after it is used." 2015-08-17 21:44:24 +00:00
Alan Viverette
46fb1249bc Merge "Separate TabWidget selection from keyboard focus" 2015-08-17 20:44:17 +00:00
Alan Viverette
760a2d845a Re-enable TAB traversal in ListView
This makes navigation asymmetrical, but that's preferable to navigation
straight-up not working at all.

Bug: 14392811
Change-Id: Ifbb41adabdc9e015c8ed7195cbfb92ec0d8458a0
2015-08-17 14:31:42 -04:00
Alan Viverette
1352a36bee Separate TabWidget selection from keyboard focus
Also removes a bunch of weird accessibility hacks that shouldn't have
been there in the first place.

Bug: 19382871
Change-Id: I8cbdfb6e2dab98cc88028dff5bc23376c98a077a
2015-08-17 14:23:10 -04:00
Alan Viverette
d78036bbec Add accessors for TabWidget strip drawables
Change-Id: Ia6aef6a2221096c2653ae39fcec60289fa0ee2fb
2015-08-14 13:53:56 -04:00
Alan Viverette
7eb09d15cc Clean up TabWidget
No functional changes, just refactoring and cleaning up comments.

Actually, just one functional change so that setting the tab strip to
@empty will actually remove the tab strip drawable. This makes it
consistent with passing null to the accessor method.

Change-Id: I6f5ba8bea4e8b30117de5f12a86957e995812cfe
2015-08-14 11:36:01 -04:00
Alan Viverette
eff1b7175d Merge "Add popup theme to AutoCompleteTextView, clean up constructor" 2015-08-13 13:29:19 +00:00
Raph Levien
8cf6d865cf am d202d15d: am cf2d44be: am 855a862f: am c98a786c: am beabcb92: Merge "Fix Insertion ActionMode not showing on RTL languages" into mnc-dev
* commit 'd202d15d9e4845537c4409c9880eb269b2b59129':
  Fix Insertion ActionMode not showing on RTL languages
2015-08-12 21:40:58 +00:00
Raph Levien
d202d15d9e am cf2d44be: am 855a862f: am c98a786c: am beabcb92: Merge "Fix Insertion ActionMode not showing on RTL languages" into mnc-dev
* commit 'cf2d44bee50dc2950181bbf5974c32eacea6f0a7':
  Fix Insertion ActionMode not showing on RTL languages
2015-08-12 21:31:07 +00:00
Yohei Yukawa
67af994c6c Clear SuggestionsPopupWindow.mSpansLengths after it is used.
This is a no risk optimization that minimizes the time when
strong references to SuggestionSpan and Integer instances are
hold in SuggestionsPopupWindow.mSpansLengths.

SuggestionsPopupWindow.mSpansLengths are used while the given
SuggestionSpans array is being sorted. We don't need to keep
object references there after the sort is completed.

No user visible change is intended with this CL.

Change-Id: I7882d741c08d07ad7f905ad1d171c0d13da39397
2015-08-12 13:55:37 -07:00
Alan Viverette
c60feca6a9 Clear check mark resource ID when set from Drawable object
Bug: 22626247
Change-Id: Ia32bc19512442fdf0d2c091d63a61f992545f2c2
2015-08-12 16:26:37 -04:00
Clara Bayarri
f95ed10d9d Fix Insertion ActionMode not showing on RTL languages
When long pressing on an empty Text field with the system language set
to RTL, the "paste" popup was not showing up.

The Floating Toolbar requires a content rect to determine where the
text is and place itself close to it. In the case of an empty field,
we create a "fake" content rect by taking the placement of the cursor
+1 pixel to the right. In RTL languages, this +1 causes the content
rect to be considered off the bounds of the view, as the cursor is
aligned to the right, and hence the Floating Toolbar is hidden.

After making the rect a 0 width rect, we ran into the issue that
it was considered out of bounds due to the calculation ignoring rects
that simply touch the edge of the view's bounds.

BUG: 22540083
Change-Id: I29c79b701f586970b2611178233eff082b802ec1
2015-08-12 21:03:28 +01:00
Alan Viverette
130ce740d1 Use correct param for heightMode in RelativeLayout horizontal measure
Bug: 22824701
Change-Id: Ia0afd3edc20b8127605aef2653fa9b5472f41be2
2015-08-12 13:04:16 -04:00
Alan Viverette
da6b2f6ccb Add popup theme to AutoCompleteTextView, clean up constructor
Bug: 22912507
Change-Id: I48d8b1ccae980847c743020d3f2a0d2eb6017e40
2015-08-12 11:26:15 -04:00
Alan Viverette
cd703b6235 Clean up Spinner constructor docs, final class vars
Change-Id: I8c7eef08718474bbdebe8eceaf34ebac4007d945
2015-08-12 11:14:33 -04:00
Seigo Nonaka
62aeada120 Use TextUtils.substring instead of String.substring.
This is a small refactoring of using substring method.
Calling TextUtils.substring is more efficient than calling
toString and String.substring.

Change-Id: I0a740b2a2fdbfb6b6155c4e926e17889025082f5
2015-08-07 16:42:22 -07:00
Alan Viverette
42a5284cc8 Merge "Always set switch state following drag" 2015-08-07 15:45:37 +00:00
Alan Viverette
03306a0b27 Always set switch state following drag
Bug: 23029815
Change-Id: Ic291803f02cab2a9ccb96622ac0569e1c78c7291
2015-08-07 11:34:25 -04:00
Alan Viverette
400997be3c am 1da56c0b: am 3fd42737: am 8a782c9d: am db576e1d: am c7f8133f: Merge "Update anchor background on the correct view in PopupWindow" into mnc-dev
* commit '1da56c0bc9d30649e255d721428a95b79fa668b2':
  Update anchor background on the correct view in PopupWindow
2015-08-06 18:28:25 +00:00
Alan Viverette
1da56c0bc9 am 3fd42737: am 8a782c9d: am db576e1d: am c7f8133f: Merge "Update anchor background on the correct view in PopupWindow" into mnc-dev
* commit '3fd42737b77e499a0f8ed5ef8aa14ebdcf5f7767':
  Update anchor background on the correct view in PopupWindow
2015-08-06 18:19:40 +00:00
Alan Viverette
c7f8133fa1 Merge "Update anchor background on the correct view in PopupWindow" into mnc-dev 2015-08-06 17:48:22 +00:00
Deepanshu Gupta
a7f827bab3 Switch SimpleDateFormat to icu version
Change-Id: Ic603c7849edc91b010febfa9013d1e0dc8b7c0f0
2015-08-06 17:17:32 +00:00
Chet Haase
950af418c3 am ddc15988: am f7d8577e: am 42c70645: am aed2e8ba: am da493aa6: Merge "Avoid changing internal state of shared drawable" into mnc-dev
* commit 'ddc1598871be09e132dc49dba011d38007c4335b':
  Avoid changing internal state of shared drawable
2015-08-06 16:56:52 +00:00
Chet Haase
ddc1598871 am f7d8577e: am 42c70645: am aed2e8ba: am da493aa6: Merge "Avoid changing internal state of shared drawable" into mnc-dev
* commit 'f7d8577ed048361ffac711a721acc69f83ab6e01':
  Avoid changing internal state of shared drawable
2015-08-06 16:50:40 +00:00
Alan Viverette
697804e8de Update anchor background on the correct view in PopupWindow
We were always setting the background of the decor view when the
"above anchor" state changed, rather than the background view.

Bug: 22970244
Change-Id: I3cd7202767ee47cb415736bb3c07369801abccd8
2015-08-06 12:36:47 -04:00
Chet Haase
da493aa6ea Merge "Avoid changing internal state of shared drawable" into mnc-dev 2015-08-06 16:23:20 +00:00
Chet Haase
bfa11e4ab8 Avoid changing internal state of shared drawable
An optimization in ImageView nulled out the internal bitmap of a cached
internal BitmapDrawable object created to wrap a bitmap set on the ImageView.
However, apps can get ahold of that cached object via Drawable.getBitmap(),
resulting in having the state of that object they may be using changing out
from under them.

The change is to null out the cached object when getDrawable() is called, to avoid
leaking internal state that we may change.
That way, the app can continue to use that object if they want to, but we are no longer
relying on it internally, and will create a new one when needed.

Issue #22930646  [1P Regression from L] ImageView is blanked out in Activity in Google Express

Change-Id: Ic86cb93be4897b6ba247c1fabcda507e4ba01300
2015-08-06 07:55:24 -07:00