2537 Commits

Author SHA1 Message Date
Dan Sandler
d63f9321e6 Icon support comes to Notification.
And you may ask yourself: what is that beautiful icon?
  And you may ask yourself: where does that API go to?
  And you may ask yourself: is it a resource? is it a Bitmap?
  And you may say to yourself: my god, what have I done

(This patch fixes a number of bugs in the initial
implementation, but other than that, it's the same as it
ever was.)

Bug: 18568715
Bug: 21141842
Change-Id: I1d3f9427abd7f0bb57e533fcfac708851ff644b6
2015-05-15 12:35:21 +00:00
Dan Sandler
aee0c2ce39 Merge "Use Context instead of Resources in Icon.createWithResource." into mnc-dev 2015-05-15 04:39:42 +00:00
Yorke Lee
d76a81f519 Merge "Fix missing break in Icon class" into mnc-dev 2015-05-15 01:39:04 +00:00
Yorke Lee
220239e371 Fix missing break in Icon class
This causes RuntimeExceptions to fall through to the next
case statement.

Bug: 21168985
Change-Id: Ie69610b22c6caf9f6536ebd48673067880cb75a2
2015-05-14 18:24:31 -07:00
Doris Liu
4b4d475769 Merge "Start AnimationDrawable from the zeroth frame." into mnc-dev 2015-05-15 00:28:33 +00:00
Doris Liu
c7741d467b Start AnimationDrawable from the zeroth frame.
This CL fixes the issue where when start is called, we run the next frame
of the animation drawable while mCurFrame is already set to 0. The result
is that the first frame of the AnimationDrawable is then skipped.

Bug: 21168854
Change-Id: I2b77ae017d3debd0f8cfec81ea86d1120e78bb55
2015-05-14 17:23:43 -07:00
John Reck
0e4a2b5ff0 Merge "Check for setting to already set" into mnc-dev 2015-05-14 23:27:49 +00:00
John Reck
6d8371e73f Check for setting to already set
Bug: 20105644
Change-Id: Ia79d2ae5c725c139d2b7c423a899be625cb8f14f
2015-05-14 16:06:12 -07:00
Dan Sandler
02cd9f91a6 Use Context instead of Resources in Icon.createWithResource.
This works around situations where corrupted packages cause
Resources.getResourcePackageName to return something that
does't actually work.

Bug: 21144636
Change-Id: I271518599a8eb89d493f1ceda6cb2e47fb38a4ff
2015-05-14 13:23:12 -04:00
Daniel Sandler
09e51a739f Revert "Icon support comes to Notification."
This reverts commit 08a04c15245c970856022d0779aa27d4d63cdee3.
This also reverts commit 5bcbf857d129f4513e562801a4e88077b2655ade.

Change-Id: Ia0b0a5339d523581c877822a3a1feec97ae4b73d
2015-05-14 12:23:24 -04:00
Dan Sandler
08a04c1524 Icon support comes to Notification.
And you may ask yourself: what is that beautiful icon?
  And you may ask yourself: where does that API go to?
  And you may ask yourself: is it a resource? is it a Bitmap?
  And you may say to yourself: my god, what have I done

Bug: 18568715
Change-Id: I4377b311c538bd1cf36b3fba22326bae81af40c9
2015-05-13 23:50:43 -04:00
Santos Cordon
d9e1fe3cd4 Merge "[1/4] Use new Icon class in PhoneAccount." into mnc-dev 2015-05-14 02:07:58 +00:00
Santos Cordon
cad84a2070 [1/4] Use new Icon class in PhoneAccount.
Bug: 21088522
Change-Id: Ia03171d4861f758701e89733f4082863587e8c11
2015-05-13 16:57:48 -07:00
Chris Craik
d6acd422af Merge "Revert "Anti-alias by default"" into mnc-dev 2015-05-13 20:47:47 +00:00
Chris Craik
74a727d061 Merge "Anti-Alias ColorDrawable" into mnc-dev 2015-05-13 20:44:49 +00:00
Chris Craik
caa6226b17 Revert "Anti-alias by default"
bug:20948129

Keep HIDDEN_DEFAULT_PAINT_FLAGS name.

This reverts commit 1b60cc0529161b5eca6407b551d67d355994c567.

Change-Id: I97cd9c556375c74c52b006bda4fc7b3a2cfa89e1
2015-05-13 13:44:30 -07:00
Chris Craik
b846b58f7a Anti-Alias ColorDrawable
Change-Id: I4d0ee2a496de908b99b0f1d8bef1b6f861c94c6f
2015-05-13 13:16:56 -07:00
Dan Sandler
b27333bcca Merge "Icon API tuneups:" into mnc-dev 2015-05-13 17:32:17 +00:00
Dan Sandler
877d696c38 Icon API tuneups:
- Reorder parameters to loadDrawableAsync()
- New version of createWithResource that takes a package
  name instead of a Resources
- Add loadDrawableAsUser() for INTERACT_ACROSS_USERS clients
  like SystemUI
- Docs cleanups

Bug: 21089268
Bug: 21031774
Change-Id: I465d2b865e35e12094b564f994e59d55e522f65a
2015-05-13 13:15:46 -04:00
Alan Viverette
aa358194f0 AnimatedRotateDrawable should inflate child elements
This was missed during the update that extended from DrawableWrapper.

Bug: 20089503
Change-Id: Ie84c040deaecb415e882842f2172a344afa8df7b
2015-05-12 16:44:59 -07:00
Chris Craik
6af2857ae0 Merge "Revert "Fix build - Revert "Revert "Use default constructor to get anti-aliasing"""" into mnc-dev 2015-05-12 19:40:26 +00:00
Chris Craik
6a49ddef62 Revert "Fix build - Revert "Revert "Use default constructor to get anti-aliasing"""
Fix import

This reverts commit 7ed1431c83286abc83b9e5afc45fbd21ecb777b1.

Change-Id: Id93eba3ed1d47a90384ba20dea6f74d78755792b
2015-05-12 10:44:30 -07:00
Doris Liu
4b403557bc Merge "Avoid setting mCurFrame to -1" into mnc-dev 2015-05-12 17:32:30 +00:00
Chris Craik
7ed1431c83 Fix build - Revert "Revert "Use default constructor to get anti-aliasing""
This reverts commit dfe0a66ceca530e0777ebfab20f81103baa18f14.

Change-Id: I58a1bae649a284f3d3b6213064d903ea7fcf185a
2015-05-12 17:22:22 +00:00
Doris Liu
56ef127df7 Avoid setting mCurFrame to -1
Use the dedicated flag mRunning to check whether the DrawableAnimation
is running, rather than comparing mCurFrame with -1. This CL aims to
simplify the use of mCurFrame.

Bug: 17112962
Change-Id: I15f9e4c102f504b8c806f029949fe9ec872479a5
2015-05-12 10:07:25 -07:00
Chris Craik
dfe0a66cec Revert "Use default constructor to get anti-aliasing"
bug:20948129

This reverts commit 58fc522a69e8ddf9ac8530ce88e9c2c92da1dd14.

Change-Id: Iddeccb4ad15b843bb3e610bd3673a0c7abc1bf46
2015-05-12 16:36:49 +00:00
John Reck
9298c54141 Clarify assert
Bug: 20918138
Change-Id: I39a9f8bbfb3752f9a6e5f5215ed8cd3c93ce87fc
2015-05-11 11:03:43 -07:00
John Reck
ad57442fd0 Add a few missing asserts
Bug: 20918138
Change-Id: I6823cfe531ff6f63a7d9fde22278e6780726c9f1
2015-05-11 09:43:47 -07:00
John Reck
3e776dee3e Compatibility hack
Bug: 20940526

Rather than throwing an exception on accessing a recycled()
bitmap let certain operations succeed and just return dummy
values. Apps appear to be relying on this.

Change-Id: I74df2efdc29d93facd8553ed31cda3addf0b28eb
2015-05-08 14:02:02 -07:00
John Reck
a039182d61 Delete a bunch of dead code
Rotation wasn't supported, so just nuke all the code
around it. Fixes some unused field warnings

Change-Id: Ic33d56ed3b42e3261bddc5007c5a029831254f83
2015-05-07 11:06:46 -07:00
Alexander Martinz
27cf86939d Fix setting hotspot bounds in a drawable container
We are passing the wrong parameters for setting hotspot bounds.
Bottom and right are in the wrong order, correct it.

Change-Id: I2762fc3a4c29f05ba8b7e71a5c6cad0be16c2ae0
2015-05-06 09:55:49 -07:00
John Reck
c64b3fab95 Merge "Attempt to solve the double-GC problem" into mnc-dev 2015-05-05 14:50:50 +00:00
John Reck
f29ed28c7b Attempt to solve the double-GC problem
Fix the issue where Bitmap requires two GC passes
to release its byte[] by using some questionable
ref-counting hacks to manage whether or not
native has a strong or weak ref to the byte[]

Change-Id: Ia90a883579f61c0b1904b5549a66bd0ef34b32c5
2015-05-04 16:05:12 -07:00
Alan Viverette
d21be49975 More documentation for handling RippleDrawable mask at run time
The docs are now really explicit about the layer's ID and how to set
or update the mask layer from code.

Bug: 20493831
Change-Id: I801f10cd08fd1b4bb226c63a1bdf3271229928ea
2015-05-04 12:51:54 -07:00
John Reck
05dc201ff6 Merge "Remove Bitmap#getSkBitmap" into mnc-dev 2015-05-04 14:34:52 +00:00
John Reck
1641c0cb0b Merge "Move AssetAtlas off of SkBitmap*" into mnc-dev 2015-05-04 14:34:39 +00:00
John Reck
7c103a36f6 Remove Bitmap#getSkBitmap
Change-Id: Ifb9047b426122d3e5a445eb7a0eb3fce38dedf27
2015-05-01 14:38:44 -07:00
John Reck
c6e2e8ff47 Move AssetAtlas off of SkBitmap*
Switched to SkPixelRef*

Change-Id: I4a1d9dc6c55c1ebcce6b0b8c585e69559e523898
2015-05-01 14:30:21 -07:00
Dan Sandler
9fc943d1a6 Merge "Icon: a clean, parcelable place for images." into mnc-dev 2015-05-01 17:57:14 +00:00
Dan Sandler
b9f7aac348 Icon: a clean, parcelable place for images.
Binder APIs which wish to consume Bitmaps *and* drawable
resources can now do so by using Icon, a kind of union type
that accommodates each of these. Icon also accepts byte
arrays holding compressed Bitmaps (PNG, JPEG, etc), which
saves clients the additional memory cost of decoding and
sending full uncompressed bitmaps through Binder interfaces.
Receiving clients can call loadDrawable{,Async} and then
getDrawable to start immediately using the image in an
ImageView or other Drawable-hosting container.

Bug: 19609468
Change-Id: Ic1343711c2ac0b15876b46f0b6008b0108a49470
2015-05-01 13:44:42 -04:00
John Reck
78760b4ae4 Merge "A bunch more cleanups" into mnc-dev 2015-05-01 14:42:51 +00:00
John Reck
3731dc220e A bunch more cleanups
Switch a few places to using android::canvas
instead of SkCanvas as well which eliminated
some JNI

Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
2015-04-30 14:34:55 -07:00
John Reck
db672b03a2 Merge "Change how Java Bitmaps are accessed in a few places" into mnc-dev 2015-04-30 21:00:08 +00:00
John Reck
ed207b9274 Change how Java Bitmaps are accessed in a few places
Stop assuming that a Java Bitmap has a SkBitmap* that
has some externally managed lifecycle, and instead switch
a bunch of users to accessing the bitmap by providing
their own SkBitmap* on which to set the (ref counted!)
SkPixelRef* instead

Attempt #2 to land this, original issue was in getSkBitmap
and should be fixed

Change-Id: I0fd9e193968b41e5597784140d56b4885906864a
2015-04-30 12:46:57 -07:00
Alan Viverette
1f29e71c46 Don't propagate level or RTL in LayerDrawable.setDrawable()
The developer used to be responsible for this and automatically
propagating the values breaks some use cases (ex. in Camera).

Bug: 20696311
Change-Id: Ia8ddc132c6d629bcc27d66f654baf30d9f078568
2015-04-29 14:28:25 -07:00
Chris Craik
2f1d09c3c5 Merge "Use default constructor to get anti-aliasing" into mnc-dev 2015-04-28 22:06:17 +00:00
Chris Craik
58fc522a69 Use default constructor to get anti-aliasing
Change-Id: I3e078a3bc91a2fd703984ba18b5e7e98069b32f1
2015-04-28 11:49:27 -07:00
Alan Viverette
a54cd38ba5 Layout layers without intrinsic dimensions using FILL gravity
Addresses a regression in Calendar where a custom drawable that doesn't
implement intrinsic bounds is laid out incorrectly. Also fixes an issue
where ColorDrawable would be laid out incorrectly.

Bug: 20643614
Change-Id: I796f0d3e189e482cf6fa169a5dd13f654d72653c
2015-04-28 10:45:26 -07:00
Raph Levien
c6abf5bff6 Expose drawTextRun publicly
For correct low-level drawing of low level text, a method that
includes context for shaping is necessary, and it's similarly useful
to provide the direction explicitly rather than running the BiDi
algorithm on the text. The drawTextRun method (in both char[] and
CharSequence variants) has provided this functionality for several
major releases but has been internal. This patch exposes the
methods publicly, and also improves the doc strings for both
the new method and some related ones.

Bug: 20193553
Change-Id: I9be33ca5ae3e7db2b69a56298400671d5ef8ad05
2015-04-27 15:33:03 -07:00
Chris Craik
1b60cc0529 Anti-alias by default
Change-Id: I19434717dd3af4fdcffbfcca2ffbb485dfebe644
2015-04-27 18:11:57 +00:00