695 Commits

Author SHA1 Message Date
Xavier Ducrohet
8a80a85552 LayoutLib: remove some exceptions.
We need to move away from throwing anything and instead
log errors/warnings.

Change-Id: Ib1af71a90c06e8565fbd0c061ba56f4d19baa3df
2011-02-09 19:39:52 -08:00
Xavier Ducrohet
9a4fe29c8d LayoutLib: Annotate the custom delegate methods.
Every method implementing a delegate needed by the
layoutlib_create bytecode modification must now be
annotated with LayoutlibDelegate.

The methods in the original source code that are delegated
are already automatically annotated. Now with the implementations
being annotated we can do bi-directional tests and find not
only missing implementations but also dead obsolete code.

This will be useful when backporting to earlier versions of
Android, or when native (non public) method disappear. In fact,
the new test detected one such method in Shader.

Change-Id: I491708b68ac2736ca5669aa86cd5e930a00f9db3
2011-02-09 17:29:29 -08:00
Xavier Ducrohet
f3f608452c LayoutLib: now depends on tools-common-prebuilt.
Change-Id: I11196c2363da378027fb8ca001e7dce0f58f657f
2011-02-09 16:19:43 -08:00
Xavier Ducrohet
024bbea215 am dc3fc3dc: Merge "LayoutLib: fix the background of title/action bars." into honeycomb
* commit 'dc3fc3dc2717461113a2963c224cb190457599d8':
  LayoutLib: fix the background of title/action bars.
2011-02-08 14:57:19 -08:00
Xavier Ducrohet
abc33e014d LayoutLib: fix the background of title/action bars.
The bars are supposed to sit on top of the window so
that if they are transparent (which is the default case
for the action bar), the window background shows through.

Fix this using a layout to represent the window content
(all but the system bar) in which the title/action bars
and the layout content sits. This layout receives the
windowBackground drawable.

Change-Id: I8072c5ff52f585fa32acb589d8526e1c13cbcd94
2011-02-07 20:33:44 -08:00
Xavier Ducrohet
5ac5388359 am 4dd2299d: LayoutLib: Update to latest API fix.
* commit '4dd2299d5766bf14479578772a0946c5399a0158':
  LayoutLib: Update to latest API fix.
2011-02-07 13:23:20 -08:00
Xavier Ducrohet
4dd2299d57 LayoutLib: Update to latest API fix.
Change-Id: I5147010e4f16a5c2ea0b98709c42f7ecd9412ff6
2011-02-07 13:05:40 -08:00
Xavier Ducrohet
80656fb71e am 62a99c0b: Merge "LayoutLib: Handle color state list in methods returning an int." into honeycomb
* commit '62a99c0b3bca70262ab205a5688ff69cbbbaee78':
  LayoutLib: Handle color state list in methods returning an int.
2011-02-07 10:22:32 -08:00
Xavier Ducrohet
62a99c0b3b Merge "LayoutLib: Handle color state list in methods returning an int." into honeycomb 2011-02-07 10:18:48 -08:00
Xavier Ducrohet
d96a7403cd LayoutLib: Handle color state list in methods returning an int.
Change-Id: Ia35ea09b992a239873026c7ef1629a01dd2e6cec
2011-02-06 21:05:21 -08:00
Xavier Ducrohet
181e321262 am 83d72da7: Merge "LayoutLib: improved rendering for system/title/action bars." into honeycomb
* commit '83d72da7f69f71fd20bd11fc4f98166532136248':
  LayoutLib: improved rendering for system/title/action bars.
2011-02-06 15:15:51 -08:00
Xavier Ducrohet
13bdc3355c LayoutLib: improved rendering for system/title/action bars.
Change-Id: I926531e9ad4a7b98e04e23cac3837794f7c89449
2011-02-06 10:58:16 -08:00
Xavier Ducrohet
1d009fbd17 am 35064e5e: Merge "LayoutLib: add implementation of Bridge.renderDrawable()" into honeycomb
* commit '35064e5e3a04bda6211166630ccd49d522a8bd92':
  LayoutLib: add implementation of Bridge.renderDrawable()
2011-02-04 19:33:27 -08:00
Xavier Ducrohet
fd18f57328 LayoutLib: add implementation of Bridge.renderDrawable()
Change-Id: Ic4d96488fd1a2e5b7d24353bebc8fdb24262c1d1
2011-02-04 19:30:35 -08:00
Xavier Ducrohet
b627f78359 am b0d34f9c: LayoutLib: split RenderSession\'s base method into RenderAction.
* commit 'b0d34f9c99cbd43e8238c5952b19d032f02dd168':
  LayoutLib: split RenderSession's base method into RenderAction.
2011-02-04 18:27:30 -08:00
Xavier Ducrohet
b0d34f9c99 LayoutLib: split RenderSession's base method into RenderAction.
This will allow us to create RenderDrawable that extends RenderAction.

Change-Id: If9cd350453ceffae4859a925a7b436502b311f9c
2011-02-04 18:11:09 -08:00
Xavier Ducrohet
1480942d97 am 1126422e: LayoutLib: update to the new API.
* commit '1126422ee1f532d8582a4e3b56dbfe505c15e775':
  LayoutLib: update to the new API.
2011-02-04 18:05:55 -08:00
Xavier Ducrohet
1126422ee1 LayoutLib: update to the new API.
Change-Id: Ice028933cd2270c81c3d17f7bef7c5a9d14bd802
2011-02-04 17:41:43 -08:00
Xavier Ducrohet
57bb7faf97 am 3944b784: Merge "LayoutLib: Replace custom BitmapFactory by a simpler delegate" into honeycomb
* commit '3944b784e980b5e2cad69b2c8eb5dbc7c1fafc4a':
  LayoutLib: Replace custom BitmapFactory by a simpler delegate
2011-02-04 17:03:43 -08:00
Xavier Ducrohet
779c906592 LayoutLib: Replace custom BitmapFactory by a simpler delegate
Change-Id: Ie61a0a5b4426e64bb71a22d76d05efa4c0865e5e
2011-02-04 16:40:49 -08:00
Xavier Ducrohet
487742ea06 am 331e93e5: Merge "LayoutLib: render system/title/action bars." into honeycomb
* commit '331e93e5a20227665d2db8a46778b9544b91879a':
  LayoutLib: render system/title/action bars.
2011-02-04 11:45:36 -08:00
Xavier Ducrohet
bbbb832602 LayoutLib: render system/title/action bars.
Also a few generic fixes in the layoutlib itself to support
this.

Change-Id: Ie3f24c9056bd3cc72f39f8a4f2c0861be15bff55
2011-02-04 10:46:21 -08:00
Xavier Ducrohet
1ea9930e74 am 5e76e0ae: Merge "LayoutLib: Fix some rendering issues" into honeycomb
* commit '5e76e0aea28042287553ffa21826f59f601a3d2b':
  LayoutLib: Fix some rendering issues
2011-02-03 11:23:39 -08:00
Xavier Ducrohet
33758ef8c9 LayoutLib: Fix some rendering issues
Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
2011-02-02 18:37:59 -08:00
Xavier Ducrohet
ca2f84c8fc am a4747d53: Merge "Make TimePicker/DatePicker/CalendarView render in Eclipse." into honeycomb
* commit 'a4747d536e905c3c34ab0d3c1c9c7485d6fac689':
  Make TimePicker/DatePicker/CalendarView render in Eclipse.
2011-02-02 15:52:18 -08:00
Xavier Ducrohet
345f866bfd Make TimePicker/DatePicker/CalendarView render in Eclipse.
Change-Id: Id5313a6f0f53bf45f6eaabc0e10fcf0660eeac08
2011-02-02 14:04:50 -08:00
Raphael
60e1eb4bfa am 03245a8e: Merge "LayoutLib.Create: support Outer_Inner_Delegate renaming." into honeycomb
* commit '03245a8ec46acc7c2b24d3d680ea5b88bd89ce13':
  LayoutLib.Create: support Outer_Inner_Delegate renaming.
2011-01-31 14:32:56 -08:00
Raphael
811820f440 LayoutLib.Create: support Outer_Inner_Delegate renaming.
When generating delegates, LayoutLib.Create support renaming
inner classes. Only one level of inner class is supported.

The method Outer$Inner#get(...) generates a call to:
  static Outer_Inner_Delegate#get(Outer instance, Outer$Inner instance, ...)

Change-Id: Ie70f2b8e5e5f311ed9c7f26b7f64637ae6157a51
2011-01-31 13:16:04 -08:00
Dianne Hackborn
371de96955 am a1f5e82f: am a30063d8: am 25eb0464: Merge "Normalize output from aapt d"
* commit 'a1f5e82f37c77af7b1d630b5bca715d1742f1234':
  Normalize output from aapt d
2011-01-29 23:07:48 -08:00
Dianne Hackborn
a1f5e82f37 am a30063d8: am 25eb0464: Merge "Normalize output from aapt d"
* commit 'a30063d80c08434ac3c7316f338c6d54110449ab':
  Normalize output from aapt d
2011-01-29 23:04:50 -08:00
Dianne Hackborn
25eb04642c Merge "Normalize output from aapt d" 2011-01-29 22:53:20 -08:00
Dianne Hackborn
13cd966415 am e802b592: am 2107757d: am bbb5a5ce: Merge "Make AaptGroupEntry::getMncName accept mnc00"
* commit 'e802b59280540ce24ea1db61907a0f1f22f01fad':
  Make AaptGroupEntry::getMncName accept mnc00
2011-01-29 15:08:07 -08:00
Dianne Hackborn
e802b59280 am 2107757d: am bbb5a5ce: Merge "Make AaptGroupEntry::getMncName accept mnc00"
* commit '2107757dde0b3159119edcc9084fcb9a87985e88':
  Make AaptGroupEntry::getMncName accept mnc00
2011-01-29 15:05:30 -08:00
Dianne Hackborn
bbb5a5ce19 Merge "Make AaptGroupEntry::getMncName accept mnc00" 2011-01-29 14:38:48 -08:00
Xavier Ducrohet
b353495192 LayoutLib: update with Pair API.
Change-Id: Iba945153f7544872ea84e3311584223aea740e2e
2011-01-28 16:54:15 -08:00
Xavier Ducrohet
35ea7cd4c0 LayoutLib: Update with the new resource map APIs.
Change-Id: I30d83c2bb4569513f4f5e22670cffe938706f105
2011-01-28 11:44:21 -08:00
Xavier Ducrohet
1658422512 LayoutLib: Properly compute available space to layouts.
Also display placeholders for status/title/action bars depending
on if the app is a tablet and its theme.

Change-Id: I651c1a2e5cfde165e004c11b236e6df056853dec
2011-01-27 15:41:38 -08:00
Xavier Ducrohet
31fd1cf769 LayoutLib: put a default image on the quickcontactbadge.
Change-Id: I64b3f4004801ec03f374460384f9a492e66bfaf0
2011-01-26 17:30:59 -08:00
Xavier Ducrohet
5a82d8c58b LayoutLib: properly erase the bitmap when rendering a new session.
This fix the issue where going from a full theme to a dialog theme
would show the dialog on top of the previous rendering.

Change-Id: Ib52b9719f44b04969423547b9de8d039f90b6f46
2011-01-26 16:34:53 -08:00
Xavier Ducrohet
7d7016e724 LayoutLib: return ViewInfo for all merged items + Build init.
android.os.Build is now initialized from the build properties
parsed from the SDK build.prop file.

Change-Id: If16953215ca90fb0beacb51bf405b89a5c8a34fa
2011-01-25 15:55:16 -08:00
Jeff Brown
aaa55d3f45 Merge "New orientation listener." into honeycomb 2011-01-24 15:31:22 -08:00
Xavier Ducrohet
82b9232565 LayoutLib: Use special view cookie for include-merge case.
All items directly under the <merge> tag now return the view cookie
of the referencing <include> tag using a special class for
easy differentiation in the calling client.

Change-Id: I7a2a4e642be9564f47e256fd1586012497d34792
2011-01-24 14:14:53 -08:00
Jeff Brown
4519f07e9c New orientation listener.
The objective in this listener is to be more careful about the
signal processing to prevent spurious orientation changes
and to make all of the tweakable factors physically meaningful.

The calibration is defined in terms of time constants and
does not assume a particular discrete sampling rate.  This is
useful because it allows us to change the accelerometer sampling
interval if desired without having to change the calibration.
Moreover, the accelerometer sampling interval can vary +/- 20ms
from one sample to the next even in normal circumstances.

Proposed orientation changes are weighted by confidence factors
that vary exponentially in relation to how close the device
is to the ideal orientation change posture (screen is vertical,
angle is exactly at the midpoint of the orientation quadrant,
and no external acceleration beside gravity).  When not in an ideal
posture, the device takes proportionally longer to settle into a
new orientation state.

Added a little tool to plot the log output of the
WindowOrientationListener.  Check the README for more information
about how to use it.

Change-Id: I787f02d03582ff26367df65eda8d9ce85c5cb343
2011-01-24 13:46:57 -08:00
Joe Onorato
4c541b1303 Merge "visibility ("lights out") API." into honeycomb 2011-01-23 19:26:13 -08:00
Joe Onorato
664644d9e0 visibility ("lights out") API.
1. Views may setSystemUiVisibility() to recommend that
the system chrome (status bar or other UI) show or hide
itself.  (This functionality was previously available only
via the FLAG_FULLSCREEN window flag for some SystemUI
implementations.)

2. Views may register a OnSystemUiVisibilityChangedListener
on a view, and find out when the system UI actually
appears or disappears, allowing apps to coordinate the
appearance of their own UI if desired.

Bug: 3241144
Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829
2011-01-23 19:22:52 -08:00
Josh Stone
02feeb4b2b aapt: Allow raw "%" in unformatted string-arrays
Commit 15fe2cb added format checking for translatable strings, enforcing
the use of positional args.  This check can be disabled on <string>
values with translatable="false" or formatted="false".  But they didn't
check for those attributes on <string-array>, so some of CM's strings
fail when they're not really format strings, just because they contain
percent signs.  (e.g. brightness widget's "Auto/Dim/40%/100%")

So now the formatted/translatable attributes are checked in string-array
too, and we can restore our proper percent signs.

Change-Id: I3478ab7e0b939e61fe0cec20201ac55096264080
2011-01-23 16:00:36 -08:00
Dianne Hackborn
1240719ae0 am bcf2adeb: Merge "aapt: Allow raw "%" in unformatted string-arrays"
* commit 'bcf2adeb10c41becec3baa2bcb8de9212272399a':
  aapt: Allow raw "%" in unformatted string-arrays
2011-01-23 12:57:33 -08:00
Josh Stone
bf50322a24 aapt: Allow raw "%" in unformatted string-arrays
Commit 15fe2cb added format checking for translatable strings, enforcing
the use of positional args.  This check can be disabled on <string>
values with translatable="false" or formatted="false".  But they didn't
check for those attributes on <string-array>, so some of CM's strings
fail when they're not really format strings, just because they contain
percent signs.  (e.g. brightness widget's "Auto/Dim/40%/100%")

So now the formatted/translatable attributes are checked in string-array
too, and we can restore our proper percent signs.

Change-Id: I3478ab7e0b939e61fe0cec20201ac55096264080
2011-01-22 21:13:12 -08:00
Jesse Wilson
8068618ebe Update preloaded-classes for Honeycomb.
We preload classes for two reasons. Classes that are popular can be
shared and can increase the number of apps that can be run concurrently.
Classes that initialize slowly can be initialized at system boot time
by the zygote, decreasing the time to launch a specific app.

To select which classes to preload, I exercised Android's built-in apps
as well as these apps from Market: ESPN score center, Amazon, Flixster,
Twitter, Adobe Reader, Ebay Mobile, Facebook, Solitare (Ken Magic),
Barcode Reader, Google Earth and Square.

A cycle of launching ~460 (non unique) activities in sequence took 9m35s
with the previous preloaded-classes list. The update improves the launch
time of the same sequence to 9m27s: the marginal improvement over the
previous set of preloaded classes is negligible.

http://b/3004763

Change-Id: Ida511ae31eeff6d95d9cb6aacae68b9bb9dd2ebe
2011-01-21 17:25:55 -08:00
Xavier Ducrohet
9d0577ec0c LayoutLib: properly configure ApplicationInfo with targetSdkVersion.
Change-Id: I1bfef890206552843d1a7a8d0564741f2a37494f
2011-01-17 22:58:41 -08:00