379 Commits

Author SHA1 Message Date
Xavier Ducrohet
10df650f0d LayoutLib: add support for layout_only render.
Change-Id: I1cd791cf9560156c1ac488f8e454240c84e29cc6
2011-02-17 10:24:46 -08:00
Xavier Ducrohet
559358fdf6 am 1858c95e: am 02d2b5a4: LayoutLib: When possible ensure parsers are popped from the stack.
* commit '1858c95e99f81ac46eea93288cb8866260b3d5d8':
  LayoutLib: When possible ensure parsers are popped from the stack.
2011-02-14 09:59:58 -08:00
Xavier Ducrohet
02d2b5a403 LayoutLib: When possible ensure parsers are popped from the stack.
Some parser consumers (seems to be mostly resource inflation)
don't use the pull parser up to the END_DOCUMENT tag, making
the parser not pop itself from the parser stack automatically.

This is likely due to the XML resources being very shallow (1-2 levels
max), and the inflater just reading the content that it expects instead
of parsing till the document is done.

This ensures that *some* parsers are pop'ed from the stack when
used. Some other parsers we don't really control and hope the
user will parse till END_DOCUMENT.

Change-Id: Ie1f5762983fed2b2ae97b896218ae12b493e7ad9
2011-02-14 09:42:19 -08:00
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
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
4dd2299d57 LayoutLib: Update to latest API fix.
Change-Id: I5147010e4f16a5c2ea0b98709c42f7ecd9412ff6
2011-02-07 13:05:40 -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
13bdc3355c LayoutLib: improved rendering for system/title/action bars.
Change-Id: I926531e9ad4a7b98e04e23cac3837794f7c89449
2011-02-06 10:58:16 -08:00
Xavier Ducrohet
fd18f57328 LayoutLib: add implementation of Bridge.renderDrawable()
Change-Id: Ic4d96488fd1a2e5b7d24353bebc8fdb24262c1d1
2011-02-04 19:30:35 -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
1126422ee1 LayoutLib: update to the new API.
Change-Id: Ice028933cd2270c81c3d17f7bef7c5a9d14bd802
2011-02-04 17:41: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
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
33758ef8c9 LayoutLib: Fix some rendering issues
Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
2011-02-02 18:37:59 -08:00
Xavier Ducrohet
345f866bfd Make TimePicker/DatePicker/CalendarView render in Eclipse.
Change-Id: Id5313a6f0f53bf45f6eaabc0e10fcf0660eeac08
2011-02-02 14:04:50 -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
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
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
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
Xavier Ducrohet
9d0577ec0c LayoutLib: properly configure ApplicationInfo with targetSdkVersion.
Change-Id: I1bfef890206552843d1a7a8d0564741f2a37494f
2011-01-17 22:58:41 -08:00
Tor Norbye
796992a942 Allow TabHosts to have no children in the tabcontent widget
Replace the code which throws an exception if there are no children in
the FrameLayout that is the tabcontent, with code to add a single
dummy tab.

This makes the TabHost renderable in those scenarios where the real
tabs are added dynamically rather than via XML.

Change-Id: I72442bd7d40eddd875b3507585c1f372fcae3329
2011-01-17 21:57:34 -08:00
Xavier Ducrohet
70552fb92d LayoutLib: Update to use the new RenderResources API.
Change-Id: Ic64eff3f324c4519da89bab10e6d59f0a9341a04
2011-01-17 14:00:29 -08:00
Xavier Ducrohet
87ab45c0fe Merge "LayoutLib: extract resource resolution into its own class." into honeycomb 2011-01-16 19:38:33 -08:00
Jeff Brown
fbf0977321 Support non-rectangular input regions.
This enables the system bar to carve out a region through which
events will be sent to the IME behind it.

Bug: 3238092
Change-Id: I69b855a8d9b5b3ee525266c0861826e53e5b5028
2011-01-16 18:58:49 -08:00
Xavier Ducrohet
d1d6fafc7f LayoutLib: extract resource resolution into its own class.
Next step is to make it a jar that will also live in
ADT.
The version in layoutlib will be through a prebuilt jar
file, like ninepatch.

Also add ninepatch.jar inside the layoutlib.jar file.

Change-Id: I4a0cc9f2dd99709de6408386054c6d4abae7c824
2011-01-16 11:18:28 -08:00
Xavier Ducrohet
51a7e5447d LayoutLib: update logs to use new data bundle
Also change some resource.resolve tags to resource.format

Change-Id: I3f0b0d2eb69a5ec98375e4014a3bb1bfceb8c855
2011-01-14 16:56:00 -08:00
Xavier Ducrohet
0831b3fae5 LayoutLib: Misc fixes.
- Fix resource resolution for framework
  resources of type "id" that are dynamically generated
  through "@+id/..."

- Proper implementation of setBitmap on a canvas that
  already has a bitmap. Transform/clip are kepts but the
  existing layers are replaced with the new bitmap

- return a null service for INPUT_METHOD_SERVICE in
  Context.getSystemService

Change-Id: I35e46fff50e6492a8995e95427d5f38bc945429d
2011-01-14 15:15:34 -08:00
Xavier Ducrohet
bbefc8662a LayoutLib: Fix multi-line text rendering.
Stupid indices.

Change-Id: I1dbdd04b8f25a5769de8dc21e6c513cef3e35635
2011-01-13 18:02:08 -08:00
Xavier Ducrohet
918aaa5717 LayoutLib: Use the new log tag constants from LayoutLog
Change-Id: I29dd578ae16405358d3673caf13528be393f0967
2011-01-13 11:08:27 -08:00
Xavier Ducrohet
310a4d815b LAyoutLib: Fix build by adding missing IWindowSession implementation.
Change-Id: I0af178d149b782cac3ae0c36fa5fc03f4dc6118b
2011-01-13 10:43:00 -08:00
Xavier Ducrohet
1f1957f50f Merge "LayoutLib: move MockView back into its original package." into honeycomb 2011-01-13 10:22:53 -08:00
Xavier Ducrohet
66a95e4dbe Merge "LayoutLib: Add getViewParent/getViewIndex on RenderSession." into honeycomb 2011-01-13 10:22:43 -08:00
Xavier Ducrohet
ee592fe4e6 LayoutLib: move MockView back into its original package.
This is used by Eclipse when the custom view is not found.
It couldn't find the view in the new package either.

We should probably move this logic of creating a mock view
into the layout library instead.

Change-Id: Ifa1a717cddf7004a7719bb4d0798cd53b43273ea
2011-01-12 20:36:02 -08:00
Xavier Ducrohet
162ee1ed3d LayoutLib: Add getViewParent/getViewIndex on RenderSession.
Change-Id: If91aa837b71a7329f53b1c4190332c2296166940
2011-01-12 20:16:52 -08:00
Xavier Ducrohet
cb27d4b2f5 Merge "LayoutLib: use tags in logs." into honeycomb 2011-01-12 18:23:04 -08:00
Xavier Ducrohet
56222cfbe9 LayoutLib: use tags in logs.
Change-Id: Ib85272249d285ecef409bf063903bcd91514a424
2011-01-12 15:59:49 -08:00
Christopher Tate
02d2b3ba9b API CHANGE: startDrag() now takes "int flags" instead of "boolean localOnly"
There will be, in the future, a flag (View.DRAG_FLAG_GLOBAL) that means
for the drag to be cross-application.  For now that flag constant is @hide
and furthermore the server-side implementation strips it, enforcing
local-only drags.

Change-Id: I8db840480ab90e18a5b8ecf29d62b4e6eafd405e
2011-01-11 18:30:23 -08:00
Xavier Ducrohet
d7cbf3f72c LayoutLib: Log error when style can't be found.
Change-Id: I9a88cdac44a2d31c053e7f0c92a14e69bd82ac83
2011-01-11 17:11:01 -08:00
Xavier Ducrohet
85de0087fc Merge "LayoutLib: misc fix." into honeycomb 2011-01-11 15:34:44 -08:00
Xavier Ducrohet
639e1bd352 LayoutLib: misc fix.
Change-Id: I0e2eff376d8f8e7682c28ef771b886d5fab5ff65
2011-01-11 15:14:51 -08:00
Xavier Ducrohet
6c740cf71e LayoutLib: Improve error reporting.
Change-Id: I37cad7e2efb959202960c57b271c55c759867139
2011-01-11 13:21:57 -08:00
Xavier Ducrohet
0de1607093 LayoutLib: fix XmlUtils.convertValueToInt
It looks like the device implementation of Integer.parseInt
is able to handle converting hexa value > 80000000 while the
desktop VM cannot.

This patch provide a fix for this.

While implementing it and running the TestDegates test I realized
that some delegate methods for Region were mising, so this adds them
too.

Change-Id: Ifee1efd47c8c52adc2f4658ec4fc8bd55adb84b4
2011-01-11 12:15:15 -08:00