Commit Graph

801 Commits

Author SHA1 Message Date
Raph Levien
93e48e8cf1 Fix missing ellipsis when just one character is truncated
The "moreChars" test in StaticLayout's generate method would evaluate to
false when the last character in a word caused the break. This in turn
suppressed the ellipsis in this case. The proposed fix is always to set
moreChars true in the code path where the line is broken because more
text wouldn't fit.

Bug: 17738112
Change-Id: Ifa1a69841ca952da4d1937dc8326778179b026b3
2014-11-19 15:39:34 -08:00
Adrian Roos
e8dce89a83 am 34c45bb9: am b2a6c7b8: am 418f4ed0: Merge "Round charging indication to nearest minute" into lmp-mr1-dev
* commit '34c45bb953f3fc230207bacb1a3b4d073068ca9f':
  Round charging indication to nearest minute
2014-11-06 16:36:04 +00:00
Adrian Roos
34c45bb953 am b2a6c7b8: am 418f4ed0: Merge "Round charging indication to nearest minute" into lmp-mr1-dev
* commit 'b2a6c7b83f894922663e7144048264af96239a1e':
  Round charging indication to nearest minute
2014-11-06 16:31:43 +00:00
Adrian Roos
874b35b836 Round charging indication to nearest minute
Bug: 18177374
Change-Id: I4eb7fcac83398a4d8432bf092d8d91506646b5a1
2014-11-05 16:11:10 +01:00
Narayan Kamath
f47a6db44b am f2196a6e: am 6220810b: am 78a3b7d5: Merge "Remove deprecated DateFormat APIs." into lmp-mr1-dev
* commit 'f2196a6ed5988f87d0e04cc30f0f82f7ea431095':
  Remove deprecated DateFormat APIs.
2014-11-04 10:16:22 +00:00
Narayan Kamath
f2196a6ed5 am 6220810b: am 78a3b7d5: Merge "Remove deprecated DateFormat APIs." into lmp-mr1-dev
* commit '6220810b8167deee7bf2577f5136736473cbea1c':
  Remove deprecated DateFormat APIs.
2014-11-04 10:08:53 +00:00
Narayan Kamath
9d68b3c839 Remove deprecated DateFormat APIs.
bug: 18074066
Change-Id: I99cef45105c9f25075c596cf4f52ec5573565596
2014-11-03 16:01:32 +00:00
Elliott Hughes
64a1a901dc am 87ce99ca: am ced7ebdb: Merge "Migrate off timeFormat12 and timeFormat24."
* commit '87ce99ca7243e4556a6cfe9f42cc51531301e979':
  Migrate off timeFormat12 and timeFormat24.
2014-10-29 17:13:38 +00:00
Elliott Hughes
87ce99ca72 am ced7ebdb: Merge "Migrate off timeFormat12 and timeFormat24."
* commit 'ced7ebdb1d522b4206e2048b278554ca841aeaba':
  Migrate off timeFormat12 and timeFormat24.
2014-10-28 04:39:24 +00:00
Neil Fuller
4400f96d1f am a021e922: resolved conflicts for merge of 12260ad7 to lmp-mr1-dev-plus-aosp
* commit 'a021e922184ee16fc019e29c066719daa793dd2b':
  Deprecating FloatMath and Time
2014-10-24 10:41:46 +00:00
Neil Fuller
a021e92218 resolved conflicts for merge of 12260ad7 to lmp-mr1-dev-plus-aosp
Change-Id: Ie2222794208475216941289cf062e05ca9c75e0f
2014-10-24 11:36:46 +01:00
Elliott Hughes
ced7ebdb1d Merge "Migrate off timeFormat12 and timeFormat24." 2014-10-23 18:21:56 +00:00
Elliott Hughes
f7d5e0a53e Migrate off timeFormat12 and timeFormat24.
libcore now offers a wider variety of 12-/24-hour time formats,
so be more specific about which one we want here.

(cherry-pick of 85f60d3a03b5b5d9a0e8b8a138eb85a6b53a1eca.)

Bug: 10361358
Change-Id: I846ab7a6f84cd49e876ad21e9366aff1600e0530
2014-10-23 11:18:21 -07:00
Elliott Hughes
85f60d3a03 Migrate off timeFormat12 and timeFormat24.
libcore now offers a wider variety of 12-/24-hour time formats,
so be more specific about which one we want here.

Bug: 10361358
Change-Id: I846ab7a6f84cd49e876ad21e9366aff1600e0530
2014-10-23 11:06:43 -07:00
Neil Fuller
bbf8871e1c Deprecating FloatMath and Time
Bug: https://code.google.com/p/android/issues/detail?id=36199
Bug: https://code.google.com/p/android/issues/detail?id=37653
Bug: https://code.google.com/p/android/issues/detail?id=42750
Bug: https://code.google.com/p/android/issues/detail?id=61137
Bug: https://code.google.com/p/android/issues/detail?id=74754
Bug: https://code.google.com/p/android/issues/detail?id=76386
Bug: https://code.google.com/p/android/issues/detail?id=76439
Bug: https://code.google.com/p/android/issues/detail?id=77836
Change-Id: Ic9b57d8a575f93b2258a5481df0ed6b3a952f636
2014-10-23 13:13:05 +01:00
Deepanshu Gupta
eea621810c Merge "Add Optimized Line breaking to LayoutLib" 2014-10-21 22:44:38 +00:00
Deepanshu Gupta
7053919a3a Add Optimized Line breaking to LayoutLib
Change-Id: I308a7d07d98ddd7747f16e06bcffcfd14d667534
2014-10-21 15:43:53 -07:00
Neil Fuller
f4d51632a6 am 8ee06212: am 1802567a: am e4625cc1: Merge "Fix Time docs to document various error cases"
* commit '8ee062122f75f5f9e4904ed95ca3778e670c5f88':
  Fix Time docs to document various error cases
2014-10-15 16:10:03 +00:00
Neil Fuller
12f427d0b5 am 1802567a: am e4625cc1: Merge "Fix Time docs to document various error cases"
* commit '1802567a79b2fc94aa1dff387cd55db8521cdca6':
  Fix Time docs to document various error cases
2014-10-15 16:05:56 +00:00
Neil Fuller
8ee062122f am 1802567a: am e4625cc1: Merge "Fix Time docs to document various error cases"
* commit '1802567a79b2fc94aa1dff387cd55db8521cdca6':
  Fix Time docs to document various error cases
2014-10-15 16:05:55 +00:00
Neil Fuller
e4625cc1a8 Merge "Fix Time docs to document various error cases" 2014-10-15 15:56:06 +00:00
Neil Fuller
7079f2003c Fix Time docs to document various error cases
Bug: https://code.google.com/p/android/issues/detail?id=76386
Change-Id: Ibb71405b70453d5abaf45426ec4e36261b6695cf
2014-10-15 12:08:05 +01:00
Newton Allen
df2b8a1cb9 am 58f75627: am 94f5155d: am c68aad9f: am d84ce32b: Merge "Fix some documentation typos." into lmp-dev
* commit '58f75627d195082e263f6d6d8e3c46c6d0970e63':
  Fix some documentation typos.
2014-10-02 19:43:39 +00:00
Newton Allen
408f7534ef am d84ce32b: Merge "Fix some documentation typos." into lmp-dev
* commit 'd84ce32bd2d7c3cebac15545504f4fec464a6956':
  Fix some documentation typos.
2014-10-02 16:46:03 +00:00
Neil Fuller
ebf2e8b451 am c2a0b448: resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
* commit 'c2a0b4482d7144e8382346ea4c22c7b89368fec0':
  Switch from FloatMath -> Math and Math.hypot where possible
2014-10-02 13:39:55 +00:00
Neil Fuller
c2a0b4482d resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2014-10-02 14:32:37 +01:00
Neil Fuller
f7cf5d43aa resolved conflicts for merge of ee665151 to lmp-dev-plus-aosp
Change-Id: I97671e62de26919e391dbb2686511584c59ab990
2014-10-02 11:48:08 +01:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Newton Allen
8f8a11b7fa Fix some documentation typos.
Change-Id: I747a0ade5c7b9c45d4465bf327952338bbc1cfaa
(cherry picked from commit 4465d1a03e)
2014-09-30 02:52:26 +00:00
Newton Allen
4465d1a03e Fix some documentation typos.
Change-Id: I747a0ade5c7b9c45d4465bf327952338bbc1cfaa
2014-09-30 02:49:00 +00:00
Elliott Hughes
51862b168f am 127ba8ff: am 4fec1b48: am 600ca140: Merge "Use constants instead of resources for ellipsis."
* commit '127ba8ff08fd8c317a11831ebf409d249fb5e646':
  Use constants instead of resources for ellipsis.
2014-09-19 23:41:01 +00:00
Elliott Hughes
69eb21074f am 4fec1b48: am 600ca140: Merge "Use constants instead of resources for ellipsis."
* commit '4fec1b488759a89732af151e21a89aa6693ba9bf':
  Use constants instead of resources for ellipsis.
2014-09-19 23:16:52 +00:00
Elliott Hughes
212998ce62 am 4fec1b48: am 600ca140: Merge "Use constants instead of resources for ellipsis."
* commit '4fec1b488759a89732af151e21a89aa6693ba9bf':
  Use constants instead of resources for ellipsis.
2014-09-19 23:02:14 +00:00
Elliott Hughes
600ca140e2 Merge "Use constants instead of resources for ellipsis." 2014-09-19 22:02:45 +00:00
Igor Viarheichyk
ed0daa93e4 Use constants instead of resources for ellipsis.
All supported locales use only U+2025 and U+2026 to represent
ellipses, and it will unlikely change in future. Given translated
resources are inconsistent and often use three dots it is safer
to use constants instead of resources.

Change-Id: I51a6cb903f62f739fbadd6b78e5765c0028d641a
2014-09-19 22:02:08 +00:00
Elliott Hughes
a559a68c36 am d2f9559a: Merge "resolved conflicts for merge of 2008cff7 to lmp-dev-plus-aosp" into lmp-dev-plus-aosp
* commit 'd2f9559ad7cff93527a05cb85172a7bb29f4d9b2':
  Small documentation fixes across many files.
2014-09-08 20:15:07 +00:00
Elliott Hughes
4656e69bf3 resolved conflicts for merge of 2008cff7 to lmp-dev-plus-aosp
Change-Id: I5148eda624e8504f12dbc1288cd4a7a5b7c10850
2014-09-08 13:08:43 -07:00
Elliott Hughes
ab94a1676e Merge "Small documentation fixes across many files." 2014-09-08 18:44:14 +00:00
Mark Doliner
d0646dca40 Small documentation fixes across many files.
Change-Id: I3e8787ce4bc6018ea1dc9aef2a2cd4e0a8dde663
2014-09-05 13:57:51 -07:00
Raph Levien
fa22262ed2 am a5c45276: am 188d9adb: am 43012fec: Merge "Up/down arrow moves to beginning/end of buffer" into lmp-dev
* commit 'a5c452769069bc21c9c8d29fb28dbfa371f6e81b':
  Up/down arrow moves to beginning/end of buffer
2014-09-04 23:42:11 +00:00
Raph Levien
fb0431b525 Up/down arrow moves to beginning/end of buffer
With a hardware keyboard, using up arrow within the top line should
move to the beginning of the buffer, to better match desktop text
editing expectations, and similarly for down arrow on the last line.
This patch implements that behavior.

Bug: 17385784
Change-Id: Ia23c23c9cc2462558bca9aaffec7d83e284d55e8
2014-09-04 15:03:14 -07:00
Raph Levien
9278b5f28e am c2a9bb67: am f7380a69: am 58e457cc: Merge "Fix Layout.isRtlCharAt" into lmp-dev
* commit 'c2a9bb67b8d76173e6220f852bcc4c78daa4bdd5':
  Fix Layout.isRtlCharAt
2014-09-04 21:28:29 +00:00
Kenny Guy
d946dfa6b0 am c9e9b3bf: am 68fc49ee: am 56e125ff: Merge "Revert "Ensure all RemoteViews use myUserId rather than context."" into lmp-dev
* commit 'c9e9b3bfc3569260d708270aee9c49380cfb7366':
  Revert "Ensure all RemoteViews use myUserId rather than context."
2014-09-04 19:51:13 +00:00
Raph Levien
875062059c Fix Layout.isRtlCharAt
We weren't getting correct results from Layout.isRtlCharAt, because it
was only testing half of the correct predicate for whether the argument
was inside the run. This patch restores the correct predicate.

Bug: 17381011
Change-Id: Ib0a77cc182f4ca4bfe824e85b7aff7268f465d73
2014-09-04 12:47:03 -07:00
Kenny Guy
692356b7c3 Revert "Ensure all RemoteViews use myUserId rather than context."
This reverts commit 5287e37687f117ac0b690100ad90842eff58d15a.
Reverting because only worked if settings cache had been populated
already.

Bug: 17302505
Change-Id: I4360606e9d9c6409951f0a02bd0b78c55085e0c6
2014-09-04 18:24:31 +01:00
Kenny Guy
3f9c59cea1 am aa0ffe26: am 0d548a70: am 5c32b77f: Merge "Ensure all RemoteViews use myUserId rather than context." into lmp-dev
* commit 'aa0ffe267c3bbdefb548cb5de6c7bda29f5365cb':
  Ensure all RemoteViews use myUserId rather than context.
2014-09-04 13:40:58 +00:00
Kenny Guy
879ebec4e2 Ensure all RemoteViews use myUserId rather than context.
Remote views may be inflated in another user so
explicitly use processes user id rather than the
user id of the context.

Bug: 17302505
Change-Id: I985c91745f03dd7e6b2ab6357600077664d8e6be
2014-09-04 12:40:24 +01:00
Neil Fuller
7e19fb0d69 Merge "Fixing android.text.format.Time for non-English locales" into lmp-dev 2014-08-29 13:36:02 +00:00
Neil Fuller
16566656cd Fixing android.text.format.Time for non-English locales
The test fixes for bug 17262063 showed up a real issue for
non-English locales with the Time.format() method:
If the Android string resources that contain the pattern use
non-ASCII characters then a '?' would be output instead of
those characters.

For example, in France the pattern for '%c' includes a 'à'
(a with a grave accent) and Japan includes 日.

The problem was due to converting the pattern to bytes using
the US_ASCII character set, which turns non-ASCII characters
into '?'. The code has been changed to use char throughout
and avoid bytes.

Internal documentation has been improved.

Some calls to modifyAndAppend() have been replaced with a
direct call to outputBuilder.append() because the
modify step is guaranteed to a no-op for the literals given.

The formatter has been changed to use Locale.US because it
is only used for outputting numbers. It has been renamed
to make this more obvious and the locale field has been
removed.

Bug: 17262063

(cherry picked from commit 788cb18f65)

Change-Id: I96ee158fbeb01827f0bbf022631625416f872fdb
2014-08-29 14:10:35 +01:00
Neil Fuller
38e02cfc35 am 176c0ecd: am 23f6a4ab: am 8178edfc: Merge "Fixing android.text.format.Time for non-English locales"
* commit '176c0ecdb15683cdfb39c0fc9944213a65746b91':
  Fixing android.text.format.Time for non-English locales
2014-08-29 12:02:04 +00:00