Commit Graph

6167 Commits

Author SHA1 Message Date
Siyamed Sinir
0b9e35ab30 Merge "AbsListView invalidates data when it isn’t changed" 2016-01-27 17:53:32 +00:00
Vladislav Kaznacheev
a74e729fa9 Merge "Fix SecurityException in Editor.onDrop" 2016-01-27 00:38:38 +00:00
Vladislav Kaznacheev
c14df8e73d Fix SecurityException in Editor.onDrop
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
2016-01-26 11:53:00 -08:00
Keisuke Kuroyanagi
0837daa464 Merge "Make scroll bar mouse draggable." 2016-01-26 01:46:53 +00:00
Keisuke Kuroyanagi
dfea1a3336 Merge "TextView: start drag and drop when dragging selection by mouse." 2016-01-26 01:26:06 +00:00
Siyamed Sinir
135554e628 AbsListView invalidates data when it isn’t changed
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
2016-01-25 16:01:18 -08:00
Alan Viverette
09a02f1c34 Merge "Ensure all showContextMenu() overrides have matching x,y overrides" 2016-01-22 15:20:43 +00:00
Yohei Yukawa
094e64b7cf Merge "Clarify the purpose of EditorInfo#hintLocales." 2016-01-22 09:54:19 +00:00
Yohei Yukawa
d469f2122e Clarify the purpose of EditorInfo#hintLocales.
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
2016-01-21 21:13:06 +00:00
Alan Viverette
62bbd1a952 Ensure all showContextMenu() overrides have matching x,y overrides
Bug: 26340507
Change-Id: I9c6da434954d40fe689c18fa9559a80c8ca61f95
2016-01-21 14:47:30 -05:00
Adam Powell
bd918aad63 Don't show TextView "share" option for an unprovisioned device
Bug 26600141

Change-Id: Ifc59752c146c2203a66cdd463b648a891ebf12c8
2016-01-21 10:49:39 -08:00
Yohei Yukawa
88f0430980 Merge "Ensure EditorInfo#locales is set before return." 2016-01-21 06:06:49 +00:00
Keisuke Kuroyanagi
d85bc5074d Make scroll bar mouse draggable.
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
2016-01-21 14:50:38 +09:00
Yohei Yukawa
0445fdf321 Ensure EditorInfo#locales is set before return.
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
2016-01-20 21:09:33 -08:00
Jaesung Chung
69c8cc2930 Merge "Support for CEA-708 closed caption" 2016-01-21 03:41:01 +00:00
Alan Viverette
1c3f701807 Merge "Postpone hover state resolution in DropDownListView" 2016-01-20 20:49:54 +00:00
Alan Viverette
fb4cbc4a06 Postpone hover state resolution in DropDownListView
Prevents a HOVER_EXIT => TOUCH_DOWN transition from triggering two
Drawable.setState() calls in the same frame.

Bug: 25849904
Change-Id: Ib10f127fd68e433992b6b11e62ac2263d790ef52
2016-01-20 11:26:06 -05:00
Jason Monk
8bcbb9bc87 Merge "Add LinearLayout#getGravity" 2016-01-20 15:55:44 +00:00
Jason Monk
efe916c3c7 Add LinearLayout#getGravity
Change-Id: I290790b8e84e14f2702c6fc9c679b1c435cc13a8
2016-01-20 10:55:09 -05:00
Seigo Nonaka
74fb6dc7b1 Merge "Fix material style errors in suggestion popup window." 2016-01-20 07:07:30 +00:00
Seigo Nonaka
3ed1b39f40 Fix material style errors in suggestion popup window.
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
2016-01-20 13:45:00 +09:00
Alan Viverette
91098574f9 Animate context popup menu around origin point
Also enables the context popup menu enter transition.

Bug: 25801140
Change-Id: Id7fb384e8ac8974189b32a052352bd2f6cbb176e
2016-01-19 14:07:31 -05:00
Yohei Yukawa
ac3e599069 Merge "Introdude IC#deleteSurroundingTextInCodePoints()." 2016-01-18 05:34:26 +00:00
Alan Viverette
a884fbeed9 Merge "Remove delay before performing drop down item click" 2016-01-15 19:04:40 +00:00
Alan Viverette
388eb91c12 Merge "Clean up CalendarView docs and annotations" 2016-01-14 16:17:26 +00:00
Alan Viverette
4bf96caa84 Merge "Apply menu callbacks to existing Toolbar menu view" 2016-01-14 16:16:00 +00:00
Yohei Yukawa
c89e22a6ff Introdude IC#deleteSurroundingTextInCodePoints().
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
2016-01-13 22:48:14 -08:00
Alan Viverette
7a66ba9ddb Merge "Clean up lint warnings in popup menu presenter classes" 2016-01-13 18:56:24 +00:00
Alan Viverette
be91ad5e21 Remove delay before performing drop down item click
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
2016-01-13 13:55:44 -05:00
Alan Viverette
02cd0f9105 Clean up lint warnings in popup menu presenter classes
Change-Id: I6b4cce1c4788b408615af0c93575e02e75b4c3ca
2016-01-13 13:33:17 -05:00
Alan Viverette
5190f1737f Apply menu callbacks to existing Toolbar menu view
Bug: 25872174
Change-Id: I44f4fad27e5e48a8ecdf0c63e135fbf566517cea
2016-01-13 11:20:26 -05:00
Alan Viverette
8a77da8626 Merge "Apply tick mark tint during view construction" 2016-01-13 15:16:11 +00:00
Alan Viverette
d154a5bb8d Apply tick mark tint during view construction
...otherwise it never gets applied.

Change-Id: I06991b3cedcf3dcfb8e98ae61e3d679c35b68839
2016-01-13 10:10:22 -05:00
Keisuke Kuroyanagi
2d12690d70 Merge "TextView: Offer suggestions in context menu." 2016-01-13 08:02:00 +00:00
Alan Viverette
850cd726c8 Apply Spinner dropDownSelector value from XML
Bug: 26400523
Change-Id: I7e09d709214b6841b688cf130638583a9db01f19
2016-01-11 15:34:43 -05:00
Alan Viverette
b097321719 Clean up CalendarView docs and annotations
Change-Id: Ie086af87b4113ef83d07370eb2b25fd7530a8781
2016-01-08 14:20:12 -05:00
Alan Viverette
598d8eafd6 Merge "Add support for tick marks in SeekBar" 2016-01-08 18:16:37 +00:00
Narayan Kamath
8090bb1a3f Merge "Fixed calendar fields comparison" am: 9aeb6edf55
am: cd51388e01

* commit 'cd51388e01fdecd516218c7a9597618b10781843':
  Fixed calendar fields comparison
2016-01-08 09:44:32 +00:00
Philipp Hasper
81fd6b48a0 Fixed calendar fields comparison
Month was compared with the day and vice versa.
Found by dukejeffrie.

Change-Id: Ic4efca440c408325819ff1df85db7b407cf3207e
2016-01-08 09:29:39 +00:00
Alan Viverette
41a90675be Add support for tick marks in SeekBar
Bug: 26399774
Change-Id: Ie4722fb91da96468325b52a22f72372ba4f536d6
2016-01-07 16:35:40 -05:00
Deepanshu Gupta
7a8fb26c20 Prevent infinite loop in case of integer overflow.
Bug: 26331754
Change-Id: I29068159204ecd2e03e44fbb2375d2e116774e07
2016-01-07 13:29:04 -08:00
Alan Viverette
d01fafb7ff Merge "Avoid NPE when ActionMenuPresenter is intialized with null MenuBuilder" 2016-01-07 15:48:40 +00:00
Alan Viverette
28a8468995 Avoid NPE when ActionMenuPresenter is intialized with null MenuBuilder
Also adds annotations to accurately reflect nullability.

Bug: 26318920
Change-Id: Ia3b170dd301edfc0088a11ee5764c24bab2f10aa
2016-01-04 13:43:23 -05:00
Chong Zhang
7c9732db0e Fix popup window position calculation in multiwindow mode
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
2015-12-29 14:53:27 -08:00
Keisuke Kuroyanagi
e876085b5b TextView: start drag and drop when dragging selection by mouse.
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
2015-12-21 18:30:19 +09:00
Keisuke Kuroyanagi
1cd8aac4ea TextView: Offer suggestions in context menu.
- 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
2015-12-21 18:01:40 +09:00
George Mount
0b8056c0bc Merge "Fix problem where enter and space key do nothing on ListView." 2015-12-18 22:32:58 +00:00
George Mount
26268f93ce Fix problem where enter and space key do nothing on ListView.
Enter should select the currently focused item. It was doing
nothing.

Change-Id: I149ed72804234c1c1da4a7a9be8c9f405722d4ec
2015-12-18 13:00:46 -08:00
Wale Ogunwale
8216eb2221 Added PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME window flag
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
2015-12-18 10:42:42 -08:00
Alan Viverette
31c2ac78d9 Merge "Handle null result from getVirtualChildAt()" 2015-12-17 19:07:29 +00:00