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
This CL introduces a API variant of IC#deleteSurroundingText(), named
IC#deleteSurroundingTextInCodePoints(). Major differences from
the existing one are:
- The lengths are supplied in code points rather than code units.
- This API does nothing if there are one or more invalid surrogate
pairs in the requested range. (Failure Atomicity)
Note that due to the asynchronous nature of the input method
architecture in Android, implementing the same logic in the input method
side basically ends up with unreliable and unpredictable results.
Bug: 6526420
Change-Id: I7f6a2c5d3d52079ae71623fd5e40d60c688dd5fb
We don't show the ripple on press for bounded ripples any more, so there's
no reason to delay the click.
Also adds method annotations.
Bug: 25849904
Bug: 25821164
Change-Id: I4f493b369deb00a19345a319befa277170d09a15
When adjusting the popup's layout param to clip it to screen, we
have to convert x, y into screen coords to make any comparision
to the display frame, which is in screen coords.
bug: 25346252
Change-Id: I996286dec83ef2a1782dd2a66435eab45abf1bae
Previously, drag and drop is started only when a long click is detected.
With this CL, drag and drop is started on drag when a mouse is used.
Bug: 19544351
Change-Id: If81f9edc6fcff5f7a810b2165c058aa36fb6caad
- Extract SuggestionInfo fetching code as SuggestionHelper and use it for
both context menu and existing suggestion popup.
- Show suggestion in "Replace..." sub menu.
Bug: 19397276
Change-Id: I20a86c1bdeb3616863b846237be55fa1a9b6ffdd
Allows us to differentiate between child windows that always want to be
laid-out in the parent frame regardless of multi-windowing mode
(PopupWindows) and those that don't (SurfaceViews).
Bug: 26255254
Change-Id: Icbc245a24f9a38698444196846ddb25016ef7e2a