Commit Graph

5671 Commits

Author SHA1 Message Date
Andrei Stingaceanu
ee4ab0a55b Merge "Fix toolbar flickering in ExtractedMode when longpressing." into mnc-dr-dev 2015-10-21 15:56:26 +00:00
Andrei Stingaceanu
2aaeefec92 Fix toolbar flickering in ExtractedMode when longpressing.
onPreDraw starts an action mode in extract mode only which
does not consider the type of motion event and since extracted
mode never gets the focus event it never hides so it does not
need to show again.

Stop starting an action mode onPreDraw in extracted mode and
let the onTouchEvent handle starting the mode.

Also re-enabled dragging and dropping for ExtractedMode (most
of the issues were caused by starting the action mode
onPreDraw).

Bug: 25102276
Change-Id: I90d8e9f42f395b6b529e4d023ba6939e0dfb147f
2015-10-21 15:42:00 +01:00
Alan Viverette
4823493647 Merge "DO NOT MERGE Use correct param for heightMode in RelativeLayout horizontal measure" into mnc-dr-dev 2015-10-20 21:44:35 +00:00
Alan Viverette
b5817779a9 DO NOT MERGE Use correct param for heightMode in RelativeLayout horizontal measure
Bug: 22824701
Bug: 25107144
Change-Id: Ia0afd3edc20b8127605aef2653fa9b5472f41be2
(cherry picked from commit 130ce740d1)
2015-10-20 17:29:39 -04:00
Abodunrinwa Toki
3bd3655fd0 Merge "Re-set PROCESS_TEXT selection if nothing was returned." into mnc-dr-dev 2015-10-20 17:47:28 +00:00
Abodunrinwa Toki
3b8a5ea036 Re-set PROCESS_TEXT selection if nothing was returned.
Bug: 25043887
Change-Id: If069a5e23f1adf6a2c3aac8fe7e3f19cff2e28ad
2015-10-20 17:11:26 +01:00
Alan Viverette
01320de844 Update drawable matrix when bounds change in invalidateDrawable()
Bug: 24797872
Change-Id: Ib2bcce6f7d6fab33633a915882821b00d94e4e44
2015-10-20 13:51:21 +00:00
Alan Viverette
a84dda54e4 Avoid OOBE when AbsListView layout is out of sync with adapter
Views are not synchronized with adapter state until a layout pass
occurs, which may cause an OOBE if a list item is removed and an
accessibility node is obtained before the next layout pass.

This CL caches the item's enabled state on the bound view's layout
params, which allows us to avoid relying on the adapter to populate
accessibility nodes. It also aborts actions if the target position
is no longer valid.

Updates the documentation on AdapterView to reflect that the result
of getPositionForView() may not be synchronized with the adapter.

Bug: 23943664
Change-Id: I90ca946bead1d87a179eab1c2f482a54bcce9c38
2015-09-10 15:17:11 +00:00
Alan Viverette
898c7045e0 Avoid NPE when getPositionForView() is called on detached view
Bug: 23557674
Change-Id: I76cb5f06081b2ac4c8f535df8d1a0aee17d2bb20
2015-08-26 15:22:09 -04:00
Clara Bayarri
f95ed10d9d Fix Insertion ActionMode not showing on RTL languages
When long pressing on an empty Text field with the system language set
to RTL, the "paste" popup was not showing up.

The Floating Toolbar requires a content rect to determine where the
text is and place itself close to it. In the case of an empty field,
we create a "fake" content rect by taking the placement of the cursor
+1 pixel to the right. In RTL languages, this +1 causes the content
rect to be considered off the bounds of the view, as the cursor is
aligned to the right, and hence the Floating Toolbar is hidden.

After making the rect a 0 width rect, we ran into the issue that
it was considered out of bounds due to the calculation ignoring rects
that simply touch the edge of the view's bounds.

BUG: 22540083
Change-Id: I29c79b701f586970b2611178233eff082b802ec1
2015-08-12 21:03:28 +01:00
Alan Viverette
c7f8133fa1 Merge "Update anchor background on the correct view in PopupWindow" into mnc-dev 2015-08-06 17:48:22 +00:00
Alan Viverette
697804e8de Update anchor background on the correct view in PopupWindow
We were always setting the background of the decor view when the
"above anchor" state changed, rather than the background view.

Bug: 22970244
Change-Id: I3cd7202767ee47cb415736bb3c07369801abccd8
2015-08-06 12:36:47 -04:00
Chet Haase
da493aa6ea Merge "Avoid changing internal state of shared drawable" into mnc-dev 2015-08-06 16:23:20 +00:00
Chet Haase
bfa11e4ab8 Avoid changing internal state of shared drawable
An optimization in ImageView nulled out the internal bitmap of a cached
internal BitmapDrawable object created to wrap a bitmap set on the ImageView.
However, apps can get ahold of that cached object via Drawable.getBitmap(),
resulting in having the state of that object they may be using changing out
from under them.

The change is to null out the cached object when getDrawable() is called, to avoid
leaking internal state that we may change.
That way, the app can continue to use that object if they want to, but we are no longer
relying on it internally, and will create a new one when needed.

Issue #22930646  [1P Regression from L] ImageView is blanked out in Activity in Google Express

Change-Id: Ic86cb93be4897b6ba247c1fabcda507e4ba01300
2015-08-06 07:55:24 -07:00
Vladislav Kaznacheev
84ad7e9ee2 Keep OverScroller.SplineOverScroller state consistent.
Currently update() bails out early if it is called
too soon after mStartTime has been set. In this case
mCurrentPosition remains holding an obsolete value
from a previous animation. This causes some strange
behavior (see the referenced bug).

This patch makes sure that mCurrentPosition is
updated every time that mStart is updated.

Bug: 22950559
Change-Id: I07b92f30ebe29856f4e04dc19a4820123713fd7e
2015-08-04 21:24:59 +00:00
Alan Viverette
5cca30a4ee Merge "Revert two changes to LinearLayout measurement" into mnc-dev 2015-07-31 21:30:48 +00:00
Dianne Hackborn
c1836bb0f1 Merge "Change MNC codename to just M." into mnc-dev 2015-07-31 17:11:58 +00:00
Alan Viverette
5a969dfd8e Revert two changes to LinearLayout measurement
"Include non-zero dimension views in excess space calculation" and
"Always distribute excess space in LinearLayout measurement" changed
LinearLayout behavior significantly in a way that wasn't covered by
CTS tests.

This reverts commits da2f304409 and
4fabc02158.

Bug: 22862047
Change-Id: I8d37a525ccf295445d3239b80e5cacb10bf3c947
2015-07-31 12:42:10 -04:00
Dan Sandler
4b67713709 Make DateTimeView more robust to weird contexts.
In particular, some clients (*ahem* SystemUI) have been
known to inflate RemoteViews with unusual derived contexts
that may not have valid application contexts. DateTimeView
can now resist this.

Bug: 22852700
Change-Id: I5e91ae0e66859f5f5efd7b19c0ae6dfbc26bcc54
2015-07-30 22:33:12 -04:00
Dan Sandler
706274f7ff Make the RemoteViews context safe for Icons.
Icon needs the RemoteViews' internal context to reflect not
just the Resources of the originating application, but its
package name as well.

Bug: 22840771
Bug: 22852700
Change-Id: I1164cd38d99283982b00daadcf927c7cf63539b3
2015-07-30 22:32:54 -04:00
Alan Viverette
559daf7a74 Merge "Include non-zero dimension views in excess space calculation" into mnc-dev 2015-07-30 17:02:45 +00:00
Dan Sandler
7bd8e6a8f2 DateTimeView: don't assume you have an ApplicationContext.
Bug: 22840771
Change-Id: I3be6369936f90e9ce4e61a59ea81b0d3408a0f99
2015-07-30 11:59:30 -04:00
Alan Viverette
da2f304409 Include non-zero dimension views in excess space calculation
Bug: 22840778
Change-Id: Iba44c59bbaa48f63b26f342e0510b4c421e8748b
2015-07-30 11:44:12 -04:00
Daniel Sandler
bbe1682b16 Merge changes from topic 'fix-media-notifications' into mnc-dev
* changes:
  Fully support Icons in Notification actions.
  Fix media notification action icons.
2015-07-30 02:57:06 +00:00
Dianne Hackborn
0e3de6caca Change MNC codename to just M.
Change-Id: I4281d200ff6560791c47cf9073ceea1cb509361e
2015-07-29 15:20:21 -07:00
Dan Sandler
25ffc7ad95 Accessibility: Read the time correctly in quick settings.
The problem is that, for 12-hour locales, we cut the "a"
part of the time format out to show it in a separate
TextView so it can be animated independently of the actual
time. Unfortunately, while TTS is smart enough to pronounce
"1:15 AM" as /wʌn fɪftin eɪ ɛm/, "AM" on its own looks like
the English word "am" and is pronounced /æm/.

To fix this, a TextClock must be able to accept separate
formats for its content description than its presentation.
With this capability we can place the complete 12-hour time
format (including am/pm) in one of the views and suppress
the other one, so that the utterance creates an identical
experience to visual inspection: "1:15 AM" for all users.

Bug: 21718000
Change-Id: Ic9920d71ae4d4ad41ba86d7bd96f9a19b07e2108
2015-07-29 22:19:52 +00:00
Alan Viverette
47a74e7e2b Merge "Ensure maxHeight is at least 0 during measureChildHorizontal()" into mnc-dev 2015-07-29 20:02:41 +00:00
Alan Viverette
7a40d21d89 Ensure maxHeight is at least 0 during measureChildHorizontal()
Bug: 22613599
Change-Id: I11f70ed1f7221874bef0f00f006e0ae294c4bdfa
2015-07-29 15:55:20 -04:00
Alan Viverette
4fabc02158 Always distribute excess space in LinearLayout measurement
Previously, excess space was added to existing measured dimensions.
This consistently resulted in incorrect allocation of excess space,
since the delta already included the height of any measured children
rather than just the excess space itself.

This CL ensures that excess space is always distributed according to the
layout weights.

Bug: 22810327
Change-Id: I482a553c469169769cc40ab3d88b4a44023f3eb5
2015-07-29 15:53:53 -04:00
Dan Sandler
912282e731 Fully support Icons in Notification actions.
RemoteViews now allows Icons as TextView compound
drawables in RemoteViews, but not yet as public API.

Bug: 22600607
Change-Id: I986a0ce3bede09746f0b121884184679f39a79f5
2015-07-29 14:18:38 -04:00
Mady Mellor
beb6e66817 Merge "Allow text selection handles to scroll horizontally" into mnc-dev 2015-07-28 00:16:49 +00:00
Mady Mellor
42390aab46 Allow text selection handles to scroll horizontally
When selecting text and expanding the selection, the handles snap
to the end (or start) of words. The handles don't snap until the
user has moved halfway through the word.

In horizontally scrolling text views, where some of the text is
cut off, the user cannot be halfway through the word, this causes
the selection to get stuck unless the user scrolls the view and then
continues selecting.

This CL does two things:

1) Checks if the user is close to the edge of the view when the
view can scroll horizontally, and places the cursor at next offset
if available.

2) Moves the code to check if handles are crossing into own method
this should be done each time the cursor is placed and avoids the
need to duplicate the check throughout updatePosition code.

Bug: 22657879
Change-Id: Ic14cb0994cd202a897bf6532f3832bb93ed49bfb
2015-07-24 13:08:42 -07:00
Andrei Stingaceanu
4579491003 Merge "Disallow dragging text in extracted mode" into mnc-dev 2015-07-24 14:35:48 +00:00
Svetoslav Ganov
41a62e111d Merge "Do not show normal permissions in sideloading UI" into mnc-dev 2015-07-23 00:27:16 +00:00
Svetoslav
a3f68ef2f6 Do not show normal permissions in sideloading UI
bug:22627493

Change-Id: I5bb900bb2cd68893c21d9e9b2c973d331d355b58
2015-07-22 17:05:05 -07:00
Alan Viverette
5b39ec8b40 Fix handling of RelativeLayout measurement using UNSPECIFIED spec
Bug: 22613599
Change-Id: Ibdac9de1d5b53a46b29ae916e5dcc8b5c4bc9c27
2015-07-22 15:37:14 -04:00
Svetoslav
81adda25b3 Merge "Always create nodes for views backed by an adapter." into mnc-dev 2015-07-21 19:01:19 +00:00
Andrei Stingaceanu
b50045a519 Disallow dragging text in extracted mode
Temporary remove this ability.

Bug: 22440907
Change-Id: Ifff4c30919bcb04f7d0ab78f5e9c481381ac7a05
2015-07-21 10:24:31 +01:00
Keisuke Kuroyanagi
437eb6ce48 Merge "Fix: Wrong suggestion popup position in extract mode." into mnc-dev 2015-07-20 21:12:38 +00:00
Svetoslav
457ec9e668 Always create nodes for views backed by an adapter.
Some views are backed by adapter and if the adapter changed
but views are not updated we were not reporting the views.
This is not correct as the accessibility layer should always
access whatever is on the screen regardless if we know it
will change in the next layout pass.

bug:20920903

Change-Id: I5851c886848e7b8e59b76419c22124790d7e6f05
2015-07-20 14:01:01 -07:00
Keisuke Kuroyanagi
fd3eff27bd Fix: Wrong suggestion popup position in extract mode.
Replace text was handled by the original EditText; thus, we
couldn't correctly decide popup window position.
Also, changing selection range replaces entire text of the
extracted EditText. As a result, text cannot be replaced
with the selected item when there is a selection.

This change is a workaround for this issue. This quits
offering "Replace" for selection in extract mode.

Bug: 22038802
Change-Id: I052b027cfd10eeb289f77f4c6b228acf58fea636
2015-07-17 16:36:57 -07:00
Chet Haase
1ea4715cec Localize SimpleMonthView
The days of the month were not being localized, resulting in
English numbers for non-English languages. Now we format the numbers
with the current locale.

Issue #22540629  [MRA14D][Arab][Token] numbers displayed in english

Change-Id: I2b17d55ba2d0aa47b5a28c8846c6cf9723ababb1
2015-07-17 14:26:17 -07:00
Andrew Solovay
353886b2dd am e67416ec: am 4859a612: Merge "docs: Clarified how to find out when a switch is toggled" into mnc-preview-docs
* commit 'e67416eccc6092e2fce3619b2244deda36fabd26':
  docs: Clarified how to find out when a switch is toggled
2015-07-14 20:22:59 +00:00
Andrei Stingaceanu
a9b9907f3c Merge "Fix insertion handle disappearing in extract mode" into mnc-dev 2015-07-14 09:57:24 +00:00
Julia Reynolds
fbd0a444e7 Merge "Remove personal/device group from sideloading screen." into mnc-dev 2015-07-13 17:34:20 +00:00
Julia Reynolds
9a5c9118ce Remove personal/device group from sideloading screen.
Also ignore the requestedPermissionFlags of yet to be installed
packages when trying to determine if a permission is new.

Bug: 22229417

Change-Id: I59d579cdc42d64bcfdefdb06e1576959355bb7a4
2015-07-13 08:46:29 -04:00
Andrei Stingaceanu
cfa13a77ed Fix insertion handle disappearing in extract mode
In extract mode, on every screen touch
TextView#setExtractedText gets called which calls
SpannableStringBuilder#sendTextChanged which in turn stops
the action mode. As a fix, if the text is the same only
copy the spans without replacing everything.

Bug: 22315095
Change-Id: I28da760b3dc11e1cfbaf720e547bd817c5b89d7e
2015-07-13 11:14:43 +01:00
Mady Mellor
1c277ca8cd Merge "Fix: line slop shouldn't always increase / decrease by one line" into mnc-dev 2015-07-11 00:30:33 +00:00
Mady Mellor
a9f07ccf38 Merge "Fix line slop issue at end of line for Thai & CJK" into mnc-dev 2015-07-11 00:26:35 +00:00
Mady Mellor
a6a0f7829f Fix line slop issue at end of line for Thai & CJK
Previously touch slop for line movement was based on the line position
of the HandleView, not the previous line touched.

Thai and CJK languages don't have a space at the end of a line so
the handle jumps to the beginning of the next line. This meant that
when calculating the touch slop it'd be from the incorrect line.

This CL tracks the previous line touched and uses that instead to
calculate touch slop and applies it to the selection and insertion
handles.

Note this is *not* added to the drag accelerator because
it does not have the problem of the handle jumping to the next line
since it has no handles.

Bug: 21925162
Change-Id: If4b231725c06489ec780a5b5a308ceffee804c20
2015-07-10 16:43:32 -07:00