Commit Graph

5706 Commits

Author SHA1 Message Date
Dan Sandler
b18c2c4276 am 7bd8e6a8: DateTimeView: don\'t assume you have an ApplicationContext.
* commit '7bd8e6a8f2d0d200fd9a74b55469492cc02de6a4':
  DateTimeView: don't assume you have an ApplicationContext.
2015-07-30 17:22:14 +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
Daniel Sandler
b10d22ff93 am bbe1682b: Merge changes from topic \'fix-media-notifications\' into mnc-dev
* commit 'bbe1682b1652c37b66609676e5829517279ff141':
  Fully support Icons in Notification actions.
  Fix media notification action icons.
2015-07-30 03:12:32 +00: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
Dan Sandler
b4c12fdb52 am 25ffc7ad: Accessibility: Read the time correctly in quick settings.
* commit '25ffc7ad950d9b2857abe9cb66ed53aed7a18ecf':
  Accessibility: Read the time correctly in quick settings.
2015-07-29 22:32:44 +00: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
0322ccf69a am 47a74e7e: Merge "Ensure maxHeight is at least 0 during measureChildHorizontal()" into mnc-dev
* commit '47a74e7e2b45d9ec462f47f6741c381c478b4156':
  Ensure maxHeight is at least 0 during measureChildHorizontal()
2015-07-29 20:13:07 +00:00
Alan Viverette
401de11f16 am 5c380efa: Merge "Always distribute excess space in LinearLayout measurement" into mnc-dev
* commit '5c380efa2c0bf3617aedbb9270fa02cce59c7935':
  Always distribute excess space in LinearLayout measurement
2015-07-29 20:12:59 +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
506424fc99 am beb6e668: Merge "Allow text selection handles to scroll horizontally" into mnc-dev
* commit 'beb6e66817e084c8a1ac92ecaeb6f0c73d11cc49':
  Allow text selection handles to scroll horizontally
2015-07-28 00:36:07 +00: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
da90571750 am 45794910: Merge "Disallow dragging text in extracted mode" into mnc-dev
* commit '45794910031ce2a0e2df3d1694783da7e3c4352b':
  Disallow dragging text in extracted mode
2015-07-24 14:47:50 +00:00
Andrei Stingaceanu
4579491003 Merge "Disallow dragging text in extracted mode" into mnc-dev 2015-07-24 14:35:48 +00:00
Svetoslav Ganov
4b4aceb5a4 am 41a62e11: Merge "Do not show normal permissions in sideloading UI" into mnc-dev
* commit '41a62e111d8de8e64ffc61c176add6cc6217b960':
  Do not show normal permissions in sideloading UI
2015-07-23 18:58:46 +00:00
Alan Viverette
803e75126b am 9478bf0e: Merge "Fix handling of RelativeLayout measurement using UNSPECIFIED spec" into mnc-dev
* commit '9478bf0e6f9618b8a5b844deaf548fc5ad1ff024':
  Fix handling of RelativeLayout measurement using UNSPECIFIED spec
2015-07-23 18:57:24 +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
69ac7236b3 am 81adda25: Merge "Always create nodes for views backed by an adapter." into mnc-dev
* commit '81adda25b396ee3db794bc9a7946b579d01c2aa0':
  Always create nodes for views backed by an adapter.
2015-07-21 19:12:16 +00: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
e97602ac2f am 437eb6ce: Merge "Fix: Wrong suggestion popup position in extract mode." into mnc-dev
* commit '437eb6ce483a34e28c06d70c0b408ba4a495293a':
  Fix: Wrong suggestion popup position in extract mode.
2015-07-20 21:23:54 +00: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
f5f85001c8 am d3f327be: Merge "Localize SimpleMonthView" into mnc-dev
* commit 'd3f327be2d1f8facd709895f2d05757351e8be07':
  Localize SimpleMonthView
2015-07-17 23:31:34 +00: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
dfa2f61849 am 353886b2: am e67416ec: am 4859a612: Merge "docs: Clarified how to find out when a switch is toggled" into mnc-preview-docs
* commit '353886b2dd1d6751d83469ddd3eb01dd0039231e':
  docs: Clarified how to find out when a switch is toggled
2015-07-14 20:32:12 +00: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
028492f20e am a9b9907f: Merge "Fix insertion handle disappearing in extract mode" into mnc-dev
* commit 'a9b9907f3c472e70d0950964d3e2c83c4926af14':
  Fix insertion handle disappearing in extract mode
2015-07-14 10:14:48 +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
11ece5ceec am fbd0a444: Merge "Remove personal/device group from sideloading screen." into mnc-dev
* commit 'fbd0a444e787c93ee8ef8741fcf24826a8619fcb':
  Remove personal/device group from sideloading screen.
2015-07-13 17:43:59 +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
b5d3e0cc10 am 1c277ca8: Merge "Fix: line slop shouldn\'t always increase / decrease by one line" into mnc-dev
* commit '1c277ca8cd699b15e631342775d996404a75e660':
  Fix: line slop shouldn't always increase / decrease by one line
2015-07-13 07:19:59 +00:00
Mady Mellor
b0fd6bf0d9 am a9f07ccf: Merge "Fix line slop issue at end of line for Thai & CJK" into mnc-dev
* commit 'a9f07ccf38709be29137dec246bca7fea976a294':
  Fix line slop issue at end of line for Thai & CJK
2015-07-13 07:19:50 +00: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
John Reck
d179ca49ea am 2c7ed6e8: Merge "Improve ImageView drawable re-use" into mnc-dev
* commit '2c7ed6e80a7e9504a0c0e13a27e54332c603d1cc':
  Improve ImageView drawable re-use
2015-07-10 17:59:37 +00:00
John Reck
5a1356916d Improve ImageView drawable re-use
Bug 22403868

Initial attempt only helped if setImageBitmap() was the only
thing called but during new-loading content it's common for a
placeholder to be set via setImageDrawable.

Tweak ImageView slightly to just have a BitmapDrawable that it
lazy-creates but will hold on to for any subsequent calls
to setImageBitmap

Change-Id: I7380521c7b363d458e4cda041f1f8b2b1fb3a93a
2015-07-10 10:08:01 -07:00
John Reck
c2d0d09015 am b7ba1220: Teach ImageView to recycle internal drawables
* commit 'b7ba1220a3dc3012d2e22825eaeb0e643333f5a4':
  Teach ImageView to recycle internal drawables
2015-07-10 01:45:02 +00:00
John Reck
b7ba1220a3 Teach ImageView to recycle internal drawables
Bug: 22289362

It's pretty common for ImageView#setBitmap to be called
repeatedly. Avoid re-creating the BitmapDrawable in this scenario
as that has high object churn of semi-expensive objects like
Paint.

Change-Id: Ib77719cd0366d02c1a42f774850bf3b9caa9c288
2015-07-09 17:40:41 -07:00
Mady Mellor
80679071ab Fix: line slop shouldn't always increase / decrease by one line
Touch slop is from the bottom (or top) of the line + line height / 2.
It only makes sense to apply touch slop if the user is within a line
from the previous line. Additionally, not doing this can cause some
undesirable behavior if the user moves very quickly and the selection
catches up with a weird line by line selection increase, potentially
even having the selection be stalled until a next move event.

This CL alters the logic so that if the user isn't within one line
of the previous selection, it'll just use whatever line the user is
currently on.

Bug: 22385003
Change-Id: I4f37988893868e5e2b7925314fe824c3da9c1b97
2015-07-09 16:05:36 -07:00
Andrew Solovay
07e7021e06 docs: Clarified how to find out when a switch is toggled
Per Chris, the existing doc was incorrect: you *can't* check for a
button press and a switch flip the same way. (The button triggers a
click event, but the switch does not.) Chris suggested that we just
remove the reference to onClick and suggest using a listener for
both kinds of buttons (ToggleButton and Switch).

Also pulled one note out of a section where it didn't fit (the bit
about changing a button/switch's state programmatically didn't have
much to do with listening for clicks) and put it at the top, and I
fixed a Javadoc typo for a relevant class that I happened to notice.

See first comment for doc stage location.

bug: 20625504
Change-Id: I9c8975111381e5b169f6a61454ef3a93da635759
2015-07-09 13:22:31 -07:00