Commit Graph

6294 Commits

Author SHA1 Message Date
Alan Viverette
a3a3f35e8d Merge "Pull weekday names directly from ICU" into nyc-dev 2016-03-30 13:35:18 +00:00
Siyamed Sinir
d225f87ebc Merge "Revert "TextView setText/append methods set movement method"" into nyc-dev 2016-03-29 23:59:15 +00:00
Siyamed Sinir
6ffb0a6818 Revert "TextView setText/append methods set movement method"
This reverts commit 4ba0aa598e.

Change-Id: I7d6eb2584a1348014ce9c3fc3e53b4cf96e30db1
2016-03-29 21:43:27 +00:00
Adam Powell
679be2d6c4 Add contentInsetStartWithNavigation/EndWithActions
Allow developers to set different content insets on toolbars and
action bars to be used when navigation buttons or menu actions are
present. Set the default values for these according to the material
spec.

Bug 19317855

Change-Id: I13e04e1f19f0982bf551a3027eb70904d6b4674c
2016-03-29 14:24:15 -07:00
Alan Viverette
11c041576d Merge "Always use existing PopupWindow dimension if not otherwise specified" into nyc-dev 2016-03-29 20:35:59 +00:00
Alan Viverette
b91d6d06b8 Always use existing PopupWindow dimension if not otherwise specified
Removes mPopupWidth/Height, which have been moved entirely into the
width and height of the LayoutParams.

Bug: 27878812
Change-Id: Id9fe99c7d57d5c15c7fe10ea95d97be562301a8e
2016-03-29 14:55:04 -04:00
Alan Viverette
d5c85c824b Pull weekday names directly from ICU
Also adds more debug logging to setMonthParams().

Bug: 27238545
Change-Id: Ib7a0685a54a560bbfffee72455aafcd85c07eb2d
2016-03-29 11:44:32 -04:00
Siyamed Sinir
eb90e4406f Merge "Update get/setFontFeatureSettings JavaDoc" into nyc-dev 2016-03-28 23:16:20 +00:00
Siyamed Sinir
0925f40372 Update get/setFontFeatureSettings JavaDoc
Add CSS font-feature-settings URL to get/setFontFeatureSettings method
JavaDoc in both TextView and Paint.

Bug: 27857640
Change-Id: I8c20068801032407d493e4f4a15b89dcf35949d2
2016-03-28 16:14:46 -07:00
Yigit Boyar
e0827355a5 Merge "Recover focus on size change in ListView" into nyc-dev 2016-03-28 19:10:08 +00:00
Yigit Boyar
0363341f6c Recover focus on size change in ListView
This CL fixes a bug in ListView where if items are not selectable,
not focusable(in terms of ListView flags) but get focus (because
they can), ListView would not recover the focus properly although
it would make the child visible.

The major issue seems like AbsListView marks data set changed when
the list resizes. It seems like a workaround for some other issue
and the code is from 2009 so instead of changing it, I've decided
to implement a workaround to minimize the potential of breaking
something else.

Bug: 27488391
Change-Id: I5babd00e97bba7cb8cc9cfd0697ef79dfae12b97
2016-03-28 10:09:22 -07:00
Keisuke Kuroyanagi
1e632ba426 Merge "Improve selection handle behavior for bidi text." into nyc-dev 2016-03-28 06:06:02 +00:00
Alan Viverette
6acf2f909b Clean up popup window positioning
- Only move the popup above the anchor when necessary
- Adjust the y position when displaying the popup above the anchor
  rather than changing the popup gravity
- Reduce popup height if it's still too large after repositioning

Bug: 27819843
Change-Id: I1ecc235816a61b9431568a34d3116e286e092c11
2016-03-24 17:11:37 -04:00
Alan Viverette
f50df4362a Ensure correct width and height are used during popup positioning
Passes the width and height into findDropDownPosition() rather than
relying on global state. Ensures that an update is forced if any
aspects of the LayoutParams are changed during drop down position
computetion. Cleans up method and argument naming.

Bug: 27819843
Change-Id: Id85e2a0e81e0ea6a754dadf7c1d1c2493a5979b0
2016-03-24 14:08:24 -04:00
Yigit Boyar
8b88a85032 Merge "Fix generate layout params to preserve margins" into nyc-dev 2016-03-23 18:22:58 +00:00
Yigit Boyar
885c50b6df Fix generate layout params to preserve margins
This CL fixes a common bug in framework's widgets where they
were not converting a child's margin layout params properly.

The CL fixes, FrameLayout, RelativeLayout, GridLayout and
LinearLayout.

Bug: 27785449
Change-Id: Icecd9181ff82107e412174fe152f35d32d36b2e6
2016-03-22 17:07:44 -07:00
Alan Viverette
9e6fe19046 Merge "Ensure that popup width and height are correct on update" into nyc-dev 2016-03-22 19:31:28 +00:00
Adam Powell
35e2ea0203 Only call Drawable.setVisible(false) for visible outgoing drawables
In framework views where we're handling the new visibility aggregated
call we only update the drawable visibility when we're attached to a
window. For old outgoing drawables being replaced, gate this on
whether the drawable is already marked visible instead.

This catches a case where views being inflated might set drawables in
in a superclass constructor and have them replaced in a later
constructor. Gating the call into a drawable that might invoke its
callback (the view being constructed) avoids potential problems where
overridden methods are called unexpectedly on a view subclass that has
not finished running its constructor.

This is a better check than isAttachedToWindow, as isAttachedToWindow
will return false if the view has been temporarily detached from its
parent by a view-recycling container. In those cases, the view would
not correctly update the outgoing drawable.

Bug 27461617

Change-Id: I733a2dd3e3df0a8d80d5dc542ca7b30064159d5d
2016-03-22 11:14:16 -07:00
Alan Viverette
f95b2d9aab Ensure that popup width and height are correct on update
Bug: 26696843
Change-Id: I8b0409aeca02b4ad551689bdf003d95f5435e567
2016-03-22 11:23:05 -04:00
Alan Viverette
aa43b1563c Merge "Account for top and bottom padding in ListPopupWindow" into nyc-dev 2016-03-21 19:30:15 +00:00
Adrian Roos
6f54b224af Merge "Don't copy Bitmaps when cloning RemoteViews" into nyc-dev 2016-03-21 19:03:51 +00:00
Alan Viverette
1e2c2d4509 Account for top and bottom padding in ListPopupWindow
Bug: 27550635
Change-Id: Icbd3190c35dfeb915cfb9f0b08a2f9d2b1307b24
2016-03-21 13:45:33 -04:00
Adrian Roos
7da889d81d Don't copy Bitmaps when cloning RemoteViews
Bug: 27385859
Fixes: 27385859

Change-Id: I9f0768b20e6e71d5366eb21df76c984bfe6989b1
2016-03-21 10:39:16 -07:00
Alan Viverette
46b5258138 Merge "Revert linear layout weight distribution algorithm" into nyc-dev 2016-03-18 17:08:15 +00:00
Kirill Grouchnikov
fa89fbb9c3 Merge "Tweak Javadocs of ListPopupWindow.onKeyXXX" into nyc-dev 2016-03-18 14:49:36 +00:00
Alan Viverette
bb09b7bf59 Merge "Clean up docs, attrs, and APIs for PopupWindow enter/exit transitions" into nyc-dev 2016-03-18 14:18:28 +00:00
Alan Viverette
1e940dc2d1 Clean up docs, attrs, and APIs for PopupWindow enter/exit transitions
Bug: 27654124
Change-Id: I9a323eeea464b4b9ca6111ef47192fdbcc5bca24
2016-03-18 09:55:10 -04:00
Keisuke Kuroyanagi
f0bb87b7c4 Improve selection handle behavior for bidi text.
A point on a direction boundary can be mapped to two offset and
one offset on a direction boundary can be mapped to two points.
Previously, paragraph's primary direction is always used for deciding
offset and coordinates; thus, handle movement around a direction
boundary is often nonintuitive.

With this CL:
1. For selection end handle, direction of character at offset - 1 is
used for deciding handle shape and position.
2. For getting offset from coordinates, previous offset is used to
minimize the offset delta and primary .
3. For getting coordinates form offset, new logic chooses primary or
secondary horizontal coordinate depending on the current run
direction and paragraph direction.
4. When a handle passes another one because it passes a direction
boundary, new logic keeps the handle at the run boundary instead of
minimizing the selection.

Bug: 19199637
Bug: 21480356
Bug: 21649994


Change-Id: I2a7e87ad08416f4bd01a5f68e006240f77d9036b
2016-03-18 14:39:09 +09:00
Alan Viverette
918f886966 Revert linear layout weight distribution algorithm
Ensures that weight is fully (though not necessarily evenly) distributed.
Previously, we could end up with extra undistributed pixels at the end.

Bug: 27690033
Change-Id: If3db83f33145500fa8be006f373c54297733e76f
2016-03-18 02:21:35 +00:00
Adam Powell
a17fa708e7 Merge "Dispatch aggregated visibility when performing attachViewToParent" into nyc-dev 2016-03-18 01:12:58 +00:00
Adam Powell
c5874094eb Dispatch aggregated visibility when performing attachViewToParent
attachViewToParent is generally used for finishing a temporary detach
of a view as seen in ListView, etc. Have it dispatch aggregated
visibility to the newly added view so as to correctly update the view
as to its new state.

Bug 27702014

Change-Id: Ie8a67c78d3edf401641d52ce10bddf7cb49796fe
2016-03-17 16:27:24 -07:00
Siyamed Sinir
e7a414e16d Merge "Do not use hint text for Editor cursor positioning" into nyc-dev 2016-03-17 22:58:35 +00:00
Adrian Roos
237be37fad Merge "Copy/Paste on RemoteInputView" into nyc-dev 2016-03-17 19:55:19 +00:00
Adrian Roos
0bd8a4b29b Copy/Paste on RemoteInputView
Also fixes a bug where the remote input view stays focused
when the inline settings open.

Also prevents sharing from contexts that are not activities,
and prevents text processing when the device is not provisioned.

Bug: 27633360
Change-Id: I8b6e7f661bd873d88e7e2460d043c2aa5f849516
2016-03-17 18:43:55 +00:00
Keisuke Kuroyanagi
cb03689fef Merge "Fix: setExtractedText partial span change handling." into nyc-dev 2016-03-17 06:56:24 +00:00
Siyamed Sinir
987ec6588b Do not use hint text for Editor cursor positioning
When hint text is used for cursor positioning, the cursor may end up
in opposite direction when the locale and the hint text directions are
different. This CL uses the main text layout and discards the hint
layout while deciding on the position of those three views. The change
also includes fix for cursor and floating popup not displaying for
some cases after the change.

Bug: 22358087
Change-Id: I083d17b06273bc1d9b67656c5e12d4ff1231219c
2016-03-16 18:00:23 -07:00
Doris Liu
95ee171e30 Merge "Refinement for onVisibilityAggregated" into nyc-dev 2016-03-16 23:55:04 +00:00
Kirill Grouchnikov
3d25a1f5db Tweak Javadocs of ListPopupWindow.onKeyXXX
Change-Id: I213f7c9d9489ce076fd58fa41205c156ece66eac
2016-03-16 17:34:35 -04:00
Adam Powell
9c146bfee7 Refinement for onVisibilityAggregated
Change the args for onVisibilityAggregated to a single boolean for
visibility to the user. Also fix an ordering bug that could trigger a
view background drawable call to setVisible before the view would
respond true to verifyDrawable, which caused issues with some apps.

Bug 27461617
Bug 27689884

Change-Id: I58bdc7c4364264f7fa0863689ba2b76df904ef81
2016-03-16 13:32:01 -07:00
Yigit Boyar
f1f8bfb764 Merge "DO NOT MERGE Fix conditional when checking for confirm key." into nyc-dev 2016-03-16 20:27:21 +00:00
Michael Wright
759f9fed70 DO NOT MERGE Fix conditional when checking for confirm key.
Bug: 26914975
Bug: 27599828
Change-Id: I1641a44e860901d2aab83138e47af6dad3ad87b1
(cherry picked from commit 6cbdc339ce)
2016-03-16 00:09:19 +00:00
Adam Powell
41d9690c3e Add View#onVisibilityAggregated
There's a common misconception (even across the framework) that
View#onVisibilityChanged determines and reports visibility on 'this'
up to the changed view and the total visibility within the
window. Knowing this is useful for things like starting/stopping
animations. onVisibilityChanged only reports the visibility for the
specific changed view, not the effects that would have down the tree.

Add onVisibilityAggregated to report what some code thought it was
getting already, and move ImageView and ProgressBar over to using it.

Bug 27461617

Change-Id: I433f41de453e27a53f907f1d9805350f30f31de9
2016-03-15 16:20:11 -07:00
Keisuke Kuroyanagi
531d8d2fae Merge "Re-disable drag and drop in full screen extracted mode." into nyc-dev 2016-03-15 08:21:11 +00:00
Keisuke Kuroyanagi
126fdf1082 Merge "Stop automatically creating selection action mode." into nyc-dev 2016-03-15 07:41:07 +00:00
Keisuke Kuroyanagi
6e0860d959 Add a check for misspelled span change.
Previously, misspelled span is directly used in AddToDicitonary's
OnClickListener. It can crash because misspelled span can have been
updated since SuggestiosPopup is shown.
Also, AddToDictionary didn't work correctly in full screen extracted
mode. Use findEquivalentSuggestionSpan to resolve it.

Bug: 27557526
Change-Id: I51d713dbdd0c44ea2c553164b81b1123a2325aa1
2016-03-15 15:40:43 +09:00
Keisuke Kuroyanagi
c477b5830a Stop automatically creating selection action mode.
With Ic025c109539c3b5963, selection action mode is created always
when selection is made. It causes distraction in some cases.
This CL fixes this issue. This CL stops starting selection action
mode when action mode is currently not active and not intended to
restart.

Bug: 27536744
Bug: 27551819
Change-Id: I94ee66864000934a21ef0d18c1d71429c67114fa
2016-03-15 15:38:40 +09:00
Keisuke Kuroyanagi
fdfc93d770 Re-disable drag and drop in full screen extracted mode.
Drag and drop in full screen extracted mode was disabled by
Ifff4c30919bcb04f7d and re-enabled by I90d8e9f42f395b6b52.
However, related issues have not been fixed. This CL re-disables it.

Bug: 22440907
Change-Id: I753f69e170aa7e79478a5a4a3b89e4a7ef88c9e2
2016-03-15 14:47:08 +09:00
Keisuke Kuroyanagi
70ab0eec2b Fix: setExtractedText partial span change handling.
ExtractedText represents a partial text change when
partialStartOffset and partialEndOffset are set.
TextView#setExtractedText handles partial updates correctly when text
is changed, but it didn't handle them for span updates when text is
not changed.

Bug: 27635763
Change-Id: I7dc2ad0c0b7f1867738be3d6d40ea36d0d9a3e7e
2016-03-14 20:33:25 +09:00
Keisuke Kuroyanagi
f8e0da2624 Show SuggestionsPopup when there is a misspelled span.
Due to I20a86c1bdeb361686, SuggestionsPopup was not shown when there
is a suggestion span that has misspelled flag and doesn't has any
suggestions. This CL makes SuggestionHelper#getSuggestionInfo return
misspelled span info separately.

Bug: 27534987

Change-Id: Ib76588f9388287a04f1f6c9d9067ae439e493a95
2016-03-14 15:48:18 +09:00
Alan Viverette
79936ddda4 Merge "Add consistent @NonNull annotations for drawable callbacks" into nyc-dev 2016-03-11 18:42:43 +00:00