For the setClipToScreen case we need constraint to
the available display area, but not to the parent window.
If we don't pass FLAG_LAYOUT_NO_LIMITS, we will be constrained
to the parent window. However when we do pass it, we will
not be constrained to the system insets. So, we can pass
FLAG_LAYOUT_NO_LIMITS and constrain ourselves to the insets
via getWindowVisibleDisplayFrame. We also need to avoid
calling setWidth/Height with these resolved values
so we can preserve the indeterminate values in case
layout changes (e.g. rotation).
Bug: 29166136
Change-Id: I4c7c6204e6bc1cdcf4ad86f7e99e3511d4312ae4
This CL fixes a bug in AbsListView where it was not invalidating
children's bounds when AbsListView's bounds change. This was
triggering bugs where if you set padding on a list view, it would
not resize its children.
Bug: 28800232
Change-Id: I81a4e9ea234c395de80efea5ef5e47a71cb95136
A partial revert for the CL I5dbc48a6c7f0f4ac4c693d5c95f0a99b989e07f4.
The mentioned CL tried to always set the maxLines attribute of
StaticLayout. However this caused regressions at certain points.
Bug: 28885989
Bug: 28468120
Change-Id: Ic09cb194c8811a06b5d53de50bfb77938b91b88d
The relative time was unclear for certain locales
and even worse 1m was spoken as 1 meter.
Change-Id: Ie172092da27ea8119906b0c301b5569bf3efabbb
Fixes: 28961667
When maxLines is set on StaticLayout and the text is wrapped, during
onMeasure TextView couldn’t recognize the wrap in the layout and tried
to reuse the layout which in turn caused width calculation problems.
This CL checks if maxLines is set, and if there is a text cut-off in
order to reuse existing layout.
Bug: 28468120
Change-Id: Ide43df8512a09112715067cbadf29cc64fd53247
When transformation method is set via API, text direction heuristics has
to be reset since for PasswordTransformationMethod it is set to LTR. Not
resetting it causes inconsistencies with the remaining of the TextView.
Bug: 28562779
Change-Id: I225e35e39bde60d4296852ff17b107d5b7b99f8a
When the countdown was set to true and the chronometer was set to
count down it wasn't updating the time, which is now fixed.
Change-Id: I4887d9eb09193c5636070edee9ba1bd13b9a23b5
Fixes: 28829131
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.
Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
Some application set textColorPrimary as white, as the result the
suggestion window draws white text on white background.
To avoid this UX, always uses original theme for suggestions popup
window.
Bug: 28371168
Change-Id: I2ef41d162b63a7e277decc2065609a7d43590afe
If we intend to clip to the screen we can't pass NO_LIMITS.
Luckily the default behavior for LAYOUT_IN_PARENT_FRAME is to not
clip to the parent frame, so we don't have to do anything except
update our local flag we use for explicit size calculations.
Bug: 28194524
Change-Id: I1465efce7f5412cf646bccd83e23a4b049f4dbc4
This CL fixes a bug in list view where an unused
scrap view would stay in temporarily detached
state until it is re-used.
It is an invalid state for a view and to fix
that issue, I've changed AbsListView to fully
detached scrap views at the end of a layout
pass and also treat them as regular new views once
they are re-used after being fully detached.
Bug: 28672259
Change-Id: I6e3f4da29f8cbca32787862402f5c21f674a7145
ListView was leaving header and footer views
in the detached state, which is a problem because
no view should be left in that state after a layout
calculation. This was also causing the view to never
received detached-from-window callback if
the ListView is detached while the header is not
visible.
This CL fixes an issue by traversing fixed views
and removing the ones that match the criteria.
To keep the behavior as similar as possible,
we still do not call startTmpDispatch on
fixed views unless we'll remove them.
Bug: 24490656
Change-Id: I8acfbd1a9d9b8b24c1c4b7692ef82cfe0f4d43a8
Drag handles are blocked from being shown if batch edit mode is active
when onPreDraw is called; however, IME can start and end batch edit
mode regardless of onPreDraw timing.
As a result, drag handles are sometimes not shown even if selection is
created and text action mode is started.
With this CL, drag handles are shown after finishing batch edit mode
if the handles were blocked from being shown in the above case.
Bug: 28366507
Change-Id: I7f099d0626bee70a63bb14bc75eefc2551a52d53
Hour was not updated correctly when a new hour was selected using the
radial picker or when AM/PM was changed, which prevented programmatic
calls from working.
Bug: 28398738
Change-Id: I0c1ffd9f9e569d980e72e74dc62568a56930afc4
Touch position is adjusted in HandleView#onTouchEvent to snap to
ideal offset.
Previously, screen coordinate was used for input, but window
coordinate is used for the ideal offset. As a result, window adjusted touch
position will be adjusted to improper position and a handle being
dragged will get moved to unintended line.
Bug: 22308836
Change-Id: I4a5a3cc695a874c85aa341f06ffcba8b7f5e318c
List items are always positioned using the divider height, even if there
is no divider drawable, so we should account for that when calculating
list height.
Bug: 28402970
Change-Id: I14b8d3b04a369749ff4b7e6f1e6e003ac08f6b7f
Restrict restoring the selected position when AdapterView
gets restored for Spinner instances only.
Bug: 26991402
Bug: 23619366
Change-Id: Ib002eac5ed0b8810a3e9988ad36f03450cb03b9b
A text filter may shorten the text, so we need to use the text
that's actually in the View, not the text we requested, to move
the selection.
Also removing the override of performAccessibilityActionInternal,
which should have been done as part of adding text actions initially.
Bug: 28253708
Change-Id: I184f49dcba0238f4ccc222597cefca258393b263