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)
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
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
- Exit immediately if the anchor root is already detached
- End ongoing transition if anchor root is detached while exiting
Bug: 25691021
Change-Id: I8f9e721fba965060dc830ab3b674526def53f4ad
The drop shadow of the SuggestionWindow was accidentally gone by
I579c0cc5b7f0dd337bff54af77828b8af25b13d2.
The reason of drop shadow disappearance is setting TRANSPARENT
background to the popup window.
To revive drop shadow of SuggestionWindow, follows the way of floating
toolbar.
- Create PopupWindow and make it transparent. (already exists)
- Wrap contents with RelativeLayout and set layout_margin and elevation
to drop the shadow into the transparent PopupWindow.
The changes in Editor is for keeping this margin during re-calculation
of the contents width and position.
Bug: 15347319
Change-Id: I5a9bcbe29400d6193eb0532a5e711a78a12383cd
This prevents the user from accidentally scrolling the list following a
long-press that, for example, opens a modal window.
Bug: 26799074
Change-Id: I9e4bce9f9fc3edd0a5b0908a868fbf7cdcb73f8c
When a content URI is dropped onto EditText, it tries making sense
of the contents, and in the process it accesses the content provider.
If this content provider requires a permission grant, SecurityException
occurs.
This fix does two things:
1. Editor.onDrop now requests DropPermissions and releases is
when it is done. This required the introduction of a new hidden method
DropPermissions.takeTransient, because the existing method required
access to an Activity instance.
2. If the drag originator neglected to allow the permission grant,
DropPermission request would not help, so a try/catch block
is added to Editor.onDrop to avoid breaking the recipient app.
Bug: 26694948
Change-Id: I714429a507e62c83a150d91fbcdee791bced3ad3
When setItemChecked is called for AbsListView, it does not check if the
value has changed or not. Then it invalidates the data by setting
mDataChanged to true and also requests a layout. This CL changes the
behavior and does not invalidate data or make a layout request when
the old and the new values are same.
Bug: 25793105
Change-Id: Id0e1f9d3ef348549a2aa88cf5ec9fe7a4b870f44
During the initial attempt to support automatic language switching in
LatinIME, it turns out that the current EditorInfo#locales is difficult
to use and even confusing in some situations. Based on that
experience, this CL changes as follows:
* Rename EditorInfo#locales to EditorInfo#hintLocales:
This is mainly to avoid possible confusion when to set this. We want
to make it clear that having non-empty LocaleList there is a clear
signal that the user would switch to certain languages regardless of
the currently selected input method subtype.
* Make EditorInfo#hintLocales nullable:
Previously marshaling EditorInfor causes NPE when
EditorInfo#hintLocales is null. This CL relaxes such a restriction.
* Introduce TextView#{set, get}ImeHintLocales():
In the previous implementation [1], we just copied
TextView#getTextLocales() into EditorInfo. This is, however, does not
work well because it is no more or less than the default value. If
LatinIME supports automatic language switching, having the default
value in EditorInfo actually means that whenever you focus in a new
text field, the keyboard language is reset to the default locale.
In order to make this "hint" useful for IME developers, this "hint"
should be specified only when the application developers are confident
to do so.
[1]: I738ffaaf07091d8b980f8bfc6e16227fcb85a96a
0445fdf321
Bug: 22859862
Change-Id: I0a730011874ea8d01e50624ed3f1ecd197d05f94
This is for Views that have special mouse dragging handling. e.g.
TextView invokes text selection on mouse dragging, so it cannot be
scrolled by mouse dragging.
This provides such Views or ViewGroups a last resort to scroll as we
don't assume that all devices have touch panel, touch pad, or mouse
wheel.
Bug: 20016455
Change-Id: I68a13258a50b5e4ea681b2576da6000a0bb3fa65
This is a follow up CL for the previous CL [1], which mistakenly put
the initialization code of EditorInfo#locales after return statement.
[1]: I77db5b99a7cf745d800db75baf135bb60ad04820
8d6eeb01df
With this CL, the IME starts receiving correctly initialized LocaleList
as expected.
Bug: 22859862
Change-Id: I738ffaaf07091d8b980f8bfc6e16227fcb85a96a
Prevents a HOVER_EXIT => TOUCH_DOWN transition from triggering two
Drawable.setState() calls in the same frame.
Bug: 25849904
Change-Id: Ib10f127fd68e433992b6b11e62ac2263d790ef52
This CL addresses the material style errors from UX team.
- Corners should have a radius of 2dp.
To use the same way with floating toolbar, make the popup window transparent and
set floatingToolbarPopupBackgroundDrawable as the layout background. By this
change, TextSuggestionsPopupWindow style is no longer necessary, removed it.
- Background color for both sections should be #FFFFFF.
It turned out that the window default background is not white. By addressing
above item, this issue is fixed too.
- Divider line alpha=.12
This is fixed by using attr/listDivider instead of attr/dividerHorizontal.
- Remove 8dp padding below last suggestion
Removed 8dip paddingBottom from ListView.
Bug: 15347319
Change-Id: I579c0cc5b7f0dd337bff54af77828b8af25b13d2