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
Ensures views that manage drawables follow the contract set forth in
the Drawable.setState() documentation.
Bug: 23792020
Change-Id: I4e5a449cd6535487873fd8443da50555c38e8ed9
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
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
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
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
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
Only targets >M since developers may have already had workarounds in
place or been relying on the incorrect behavior.
Bug: 23383805
Change-Id: Ifa69b204b10b8084cf6486e41d5393969e197826
Refactors ImageView to use LOG_TAG constant, fixes indentation, trailing
whitespace, uses of final. No functional changes.
Change-Id: I9e67d9a152e1c6d646719afa5010c45868db9c6f
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
This makes navigation asymmetrical, but that's preferable to navigation
straight-up not working at all.
Bug: 14392811
Change-Id: Ifbb41adabdc9e015c8ed7195cbfb92ec0d8458a0
Also removes a bunch of weird accessibility hacks that shouldn't have
been there in the first place.
Bug: 19382871
Change-Id: I8cbdfb6e2dab98cc88028dff5bc23376c98a077a
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
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
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
This is a small refactoring of using substring method.
Calling TextUtils.substring is more efficient than calling
toString and String.substring.
Change-Id: I0a740b2a2fdbfb6b6155c4e926e17889025082f5
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
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