Currently PopupDecorView temporarily gets FLAG_NOT_FOCUSABLE bit during
exit transition. When doing this we it is important that PopupDecorView
does not have FLAG_ALT_FOCUSABLE_IM bit, because having both
FLAG_NOT_FOCUSABLE and FLAG_ALT_FOCUSABLE_IM means that PopupDecorView
is IME-focusable.
To prevent IMEs from flickering, this CL ensures that PopupDecorView is
not IME-focusable during exit transition.
Bug: 27396330
Change-Id: I0cc81791b826f7d4257f0b6085c028c796fd9536
Propagate setVisible calls to current drawable. Take window visibility
into account when determining drawable visibility.
Bug 27461595
Change-Id: Ia1de1d1686f26c2cf27630c5bde70f23c2c332bd
Update EditText.setEllipsize JavaDoc to describe that MARQUEE is not
supported by EditText.
Bug: 26219977
Change-Id: Ibe709f3470a749c0fbb672c8ec33f0835c5d90ec
This CL fixes a bug in ListView where it might call onClick on an
un-clickable if a new touch arrives before up timeout.
We could actually consider making child position non-changable
but that will change behavior. This seems safer approach.
Bug: 27198796
Change-Id: I7b15d04efa19d1d760a294bd027f3da3aaa3a445
If the screen is smaller than "small" then use the Holo picker layouts.
Unifies the SavedState between delegates so that we can seamlessly
transition between them during configuration changes. Pushes the
DatePickerSpinnerDelegate up to the same level as the calendar delegate.
Bug: 27239893
Change-Id: Ida4dc2748d38bd766ae93d12aef15e963921939c
Unexpected ellipsize issue happens after
Ic8445022634e9130f9462e02bfb08d4877396ba3. By setting match_parent to
ListView, the ListView does not expand to fit the suggestion item.
Thus, explicitly setting the ListView width instead of setting
match_parent or wrap_content.
I manually verified this CL does not revive Issue 27341560 or
unexpected ellipsize for shorter text.
Bug: 27341560
Change-Id: I69b258687b4bf5510d9b2c3e690c88106bf893f5
If ignoreBottomDecorations=true, the display size was extracted from
the resources. However, this didn't work if the parent window was in
multi-window, as all the calculations went wrong. Instead, introduce
View.getWindowDisplayFrame which returns the "full" frame of the task
the window is currently in, without any insets, and use that to
calculate the bottom edge.
Bug: 26255254
Change-Id: I8b235b335775022ae399ee082d1200aa76cc047c
Suggestion pickup was canceled when SuggestionsSpan corresponding
to the suggestion cannot be found.
This was a problem when suggestion is selected in extracted mode.
Selection is cleared just before creating SuggestionsPopup.
The selection update is reported to the original EditText and it
will invoke TextView#setExtractedText of the extracted one.
In this method, SuggestionSpans are replaced with the new
SuggestionSpans that usually have the same contents as the old
SuggestionSpans.
This CL re-enables "Replace" item in extracted mode.
Bug: 22038802
Change-Id: I74bb813b110fb2f633b8578790d14039755f2d79
Text action mode was not correctly updated when the selection
is modified by keyboard, app or IME.
With this CL, Editor#refreshTextActionMode is called always when
selection is updated. This method properly starts, stops or
invalidates text action mode if selection was modified outside of
cursor controllers.
Bug: 10527362
Bug: 22937774
Change-Id: Ic025c109539c3b59638226be4c4c9adf5ea0c38c
Previously, popup window or insertion handle could be shouwn at
a strange position as they could be shown for the original input
field in full screen extracted mode.
This CL stops showing SuggestionPopup for the original input field
in full screen extracted mode.
Bug: 22038802
Bug: 27313458
Change-Id: I585913328182d996f0201c53c028a1991f7b435b
To allow static initialization of a number of View classes based
on TextView, refactor the initialization of the font cache to be
explicit from the zygote.
Bug: 27265238
Change-Id: I1b71086d3f49d8b3e72eea2bf8359351d25fc0fd
I forgot to include Parcelable.Creator when I added SearchView
iconified state saving.
Bug: 27357167
Change-Id: Ia96490aa9c12c4042f50ba4b1aeb7422b37a1d4c
TextView should decide which edge to fade by checking if and where the
text is cut. This CL updates fading edge strength related functions
accordingly.
Bug: 10918591
Change-Id: I57aa964cfbbb44289c52eea99c05c77750dce1cd
This reverts most of commit 21d361806c, which
broke too many expectations in both apps and framework widgets. We need to
find a safer way to handle the exit transition callback.
Bug: 27359366
Bug: 27353218
Change-Id: I769ac7a25cb900c50e857839ca0563fbc5a3cb16
We should run the transition only when the anchor root IS attached,
and we should only call the dismiss callback when the animation has
completed and the window has been removed.
Bug: 25323707
Bug: 26647820
Change-Id: I2bcdc901885d4c0a6c48c2b2c949797def1d7512
The selection handles are implemented based on PopupWindow hence it is
necessary to calculate the transformed location from the TextView's
local coordinates.
This CL only addresses the selection handle locations. Many
functionalities (e.g. selection handle moving direction, handle angle)
doesn't work on transformed view since many components are calculated
on the TextView's local coordinates.
Bug: 24902578
Change-Id: Iaa5fd2812969d097e3bf3219a818ffbc67aaef54
[start, min(end, DRAG_SHADOW_MAX_TEXT_LENGTH)) was used to make drag
shadow. It ignores grapheme cluster, so unexpected shadow was created for
characters that contain multiple code units.
Bug: 23097276
Change-Id: Ic7d34ec02ea04a3f17337e4253babac87ef3b03c
There are instances where an int calculation would result
in a loss of precision and rounding error. Fixed by
using a float instead.
Change-Id: I595872f00552a7fd717a1754c1d8f5a50d776621
This CL make sure that ellipsized and non-ellipsized text have the
same baseline.
- TextView did not set the maxLines for StaticLayout when ellipsized
is false. This resulted in height and baseline calculation
discrepancies between ellipsized and non-ellipsized TextViews using
StaticLayout.
- For single line TextViews when a text is not ellipsized
BoringLayout is used, and when text is ellipsized StaticLayout is
used. Because of the bottom padding added to the last line of
StaticLayout, those two did not have the same baseline.
Bug: 18864800
Change-Id: I5dbc48a6c7f0f4ac4c693d5c95f0a99b989e07f4
Currently there is an internal hidden class named
ControlledInputConnectionWrapper which works as a proxy in the
application process to receive incoming binder calls from input method
and dispatch those method calls again on an appropriate thread.
Although this is a kind of implementation details, basically you can see
the same design everywhere in the Android.
Currently ControlledInputConnectionWrapper is initialized with
view.getHandler(), where the view here is the View which was used to
call View#onCreateInputConnection(). This is actually a reasonable
behavior because we have generally assumed that there the only
reasonable way to implement InputConnection is to extend
BaseInputConnection, which is designed to be able to work only on the
UI-thread associated with the target view.
However, on Android N and onward, we are going to ensure that
BaseInputConnection can be re-implemented on top of public APIs [1].
Although most of applications should not try to do that, for certain
applications such as web browsers and WebView it may make sense to let
custom InputConnection implementation run with a custom Handler so that
the application can respond to the IME without blocking the UI thread.
To do that, this CL introduces a new method
InputConnection#getHandler(), which changes nothing as long as it
returns null, but if it returns non-null Handler, InputMethodManager
will use it to initialize ControlledInputConnectionWrapper.
Note that InputConnection#getHandler() is not for IME developers.
It just returns null when called in the IME process.
[1] See Bug 24688781 for details.
Bug: 26945674
Change-Id: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
EditText tried to draw outside of the padding boundaries because of a
cursor positioning issue in RTL. This CL removes that fix and instead
clamps the cursor position if cursor is outside of the clipped view
boundary.
Bug: 23397961
Change-Id: Id5f1fbe2a0f571100c89b21758fbb81b14d5da57
Currently TextView state is saved whenever selection is set even if
freezesText is false. This causes inconsistencies with the described
behavior for the attribute. This CL updates the behavior as:
- Always save the text for EditText
- Always save the selection if there are any.
- Do not save the text for TextView if freezesText is false.
- During onRestoreInstanceState if selection is out of the text
boundaries, do not restore the selection.
Bug: 22076905
Change-Id: I5e05d343e752a7d106c8881993e4d95ae21a38ce
(cherry picked from commit 8535836673)
Have the new showContextMenuForChild(View, float, float) call through
to the old showContextMenuForChild(View) before recursing up to its
parent. This ensures that existing apps with custom views that
override the old method still get called as expected if they implement
custom behavior.
Unlike some other similar circumstances we aren't implementing this to
be bidirectional as the new behavior doesn't need to be triggered by
invoking the old. If the older method is invoked explicitly we will
still show old-style dialog context menus instead of the newer popup
style since we won't have a good place to visually anchor a popup.
Bug 26919262
Change-Id: Ie09f922d322b5a24789c7867820c4bc43824c385
(cherry picked from commit 759a4c5400)