695 Commits

Author SHA1 Message Date
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
Xavier Ducrohet
b3830b8978 LayoutLib: only support animator-type animations.
Change-Id: Ia3609fc5d11555190bc323d61a3577144a4692fd
2011-01-11 10:54:12 -08:00
Xavier Ducrohet
eb87b3bb53 LayoutLib: fix some issue with resource resolution.
TypedArray.getResourceId() is not only about id/foo,
it can be any type of resources.

Change-Id: Ia5e147bc078bb349a3fa500a04c596ae44ea34ce
2011-01-10 21:51:55 -08:00
Xavier Ducrohet
419e8296ea LayoutLib: move asserts around.
Change-Id: I6fcfcf2e6fad1d9fa172b9a8c20c72fa2533e7fa
2011-01-10 11:57:49 -08:00
Xavier Ducrohet
c77515e590 LayoutLib: display warning when a resource reference fails to resolve.
Also fixed some warnings where a field hid one from a parent class.

Change-Id: I04ed19ebc49ae0bb0abdb0b25bc1c182fa0db440
2011-01-09 18:11:54 -08:00
Xavier Ducrohet
479101a9b4 LayoutLib: Fix moveChild animation.
Only support animation for view move inside
the same layout.

Also fix animation thread to property support multiple
animation running at once.

Change-Id: I45cad84e7b9f3a4f281c956d32934eb74e807afb
2011-01-09 14:57:20 -08:00
Xavier Ducrohet
b6e53f4812 LayoutLib: add a few misc implementations.
Change-Id: I586f1d5ecc4f254fc04ea1171eb499d06ac592eb
2011-01-07 18:37:49 -08:00
Xavier Ducrohet
46a329244d LayoutLib: finish Typeface and unload them in dispose.
Change-Id: I3a48f84678f62d669d303fc73b041bb3fe5f333b
2011-01-07 18:16:43 -08:00
Xavier Ducrohet
7550ec1d8e LayoutLib: remove fade in/out transition on moveChild.
Change-Id: I69a70ecb165f19feca55fc30a3f48ebea896daa3
2011-01-07 17:14:36 -08:00
Xavier Ducrohet
d7cc1244d7 LayoutLib: fix moveChild again.
Change-Id: Ib69a06e44be1e332f0f43c36c795c86270cb1b71
2011-01-07 16:16:21 -08:00
Xavier Ducrohet
2b9c38ab62 LayoutLib: fix animated moveChild.
The child can only be added to the new viewgroup
after it's been removed from the previous one, which
is delayed if there's an animation.

Change-Id: I9123a2670d0d17b3eb6f8f89085ebab8ca2b800f
2011-01-07 12:49:49 -08:00
Xavier Ducrohet
10af738336 LayoutLib: Finish the matrix delegate.
Change-Id: Ife70a4707c113f4a2aed18e303cb2f221c73db2a
2011-01-06 19:20:03 -08:00
Xavier Ducrohet
a7cac5e054 LayoutLib: fix clipping issues.
There were two issues:
- Graphics2D.setClip only works on rectangular shapes.
  This means doing a setClip on a non rectangular shape should
  basically reset the clip and intersect with the new shape.

- the current clip can be null, so the combineShape method
  must handle it.

Change-Id: Id2cd7475e991d8b533ff2e8850cc2c27663f9e52
2011-01-06 18:13:49 -08:00
Xavier Ducrohet
29c288da52 Cherry-pick 9b53dd9d60a01ddb1307177c296c7b4fd6114753 from master
Change-Id: I670872542feb62c47fe693eb183b19e2eef2b20d
LayoutLib: use new API with log in init method.
2011-01-06 11:11:05 -08:00
Dianne Hackborn
f31161a0e7 Add new "animator" and "interpolator" resource directories.
First phase, allowing apps to move over to the new names.

Change-Id: Ia16f3e2383e4a6599a0011d0464f0aacb1ce9207
2011-01-05 14:12:55 -08:00
Shachar Shemesh
9872bf4a2d Normalize output from aapt d
Make the output from aapt dump --values resources and aapt dump xmltree normalized, so that it is unambigously displayed
regardless of the content of the strings.

Change-Id: Ia3bff36c4ee1e9a44f474534e154830948beabdf
2011-01-04 20:52:08 +02:00
Johan Redestig
5ef0b9d724 Make AaptGroupEntry::getMncName accept mnc00
MNC 00 is a valid network code and is used by
some operators, see http://en.wikipedia.org/wiki/Mobile_Network_Code.

Remove the test that checks if atoi returns zero.
The string is validated to contain only numbers
already.

Also discussed here:
https://code.google.com/p/android/issues/detail?id=3657

Change-Id: I3220d7980abe4067c9e7aa4cbc10b5fd0b8c9ea7
2011-01-04 07:30:32 +01:00
Xavier Ducrohet
c226e571fd LayoutLib: Misc javadoc fixes.
Change-Id: Iabe081c20b361b034c2e66b975b8756c0fdcd3d1
2011-01-03 03:28:20 -08:00
Xavier Ducrohet
b44b43b157 LayoutLib: Support Region through delegates.
also finish supporting some clip operation
on the canvas.

Change-Id: I743b9e52a7aa6e9340506f1c904cc1cfbf3ff81f
2010-12-24 00:21:51 -08:00
Xavier Ducrohet
d43909c750 LayoutLib: add support for unsupported drawing modifiers.
DrawFilter, Rasterizer, ColorFilter and MaskFilter
are not supported but we need to provide their
JNI counterparts anyway, to at least display warnings
when they are used.

Also improved the API to query Paint for Shaders
and PathEffects, and clean up some code by
moving asserts into the DelegateManager.

Change-Id: I8942514565d28576d5608c6373bda25d86d42ff2
2010-12-24 00:21:51 -08:00
Xavier Ducrohet
2080534329 LayoutLib: Fix Canvas layer support with 2+ layers
- When drawing is not clipped to the top layers,
  drawing should not happen automatically on all
  existing layers. Instead each layer's flags dictate
  whether drawing should happen on layers beneath, starting
  with the top layer.
- upon restore, the same mechanism is taken. Only blit
  a layer into the layer beneath if it was drawn into
  using the logic above.

Also fixed:
- saveLayer() does not, in fact, always save matrix
  and clip info. The flag dictate this, the same way
  it does in save()
- drawing code didn't properly detect the case of drawing
  into layers if a save() was called after saveLayer().
  Now the code only looks at the layer list which provide
  all the needed info (flags mostly), and doesn't rely
  on mLocalLayer (which is used during restore only now).
- Properly handle HAS_ALPHA_LAYER_SAVE_FLAG (or lack
  thereof) when creating the BufferedImage for the layer.

Change-Id: I2fbbcc0f5d3a3dd208763705bc23e6658fd4e573
2010-12-24 00:21:50 -08:00
Xavier Ducrohet
b1da1afa74 LayoutLib: improve bitmap support.
Change-Id: I703c2bdf51380b54fd5c20b08d3bc74833d9bc6e
2010-12-22 10:30:53 -08:00
Xavier Ducrohet
d38e776a3c LayoutLib: support for layers.
Layers require that drawing methods potentially
draw in more than one bitmaps.

To handle this this patch offers the following:
- move all drawing methods to use Drawable
- Drawables are now handled by GcSnapshot since
  its the one handling the layers
- moved Canvas_Delegate.createCustomGraphics to
  GcSnapshot which does not expose the Graphics2D
  objects anymore so its draw() methods are the only
  way to draw.
- handles creating layers in GcSnapshot.save() and
  blitting them in restore()

Other changes:
- Clean up the create/save API in GcSnapshot
- Fixed drawing bitmaps with alpha and other
  composite modes.

Change-Id: I1e230087493d044a10de71f4b6d29083e3f3bf64
2010-12-22 10:30:53 -08:00
Xavier Ducrohet
63fd87113c LayoutLib: Misc rendering fixes.
- always set up the stroke. Paint may not have the proper
  style when drawing lines. stroke should still be setup.

- Fixed vertical linear gradient. Old code generated
  a gradient ratio of NaN

- Fixed alpha rendering when using shaders. In that
  case the alpha channel from the paint color should be
  used in conjunction with the shader.

- Fixed miter limit. Java expects the value to be multiplied
  by the stroke width

- Fixed support for drawing ALPHA_8 bitmaps. Java2D doesn't
  have bitmaps with only alpha channels, so we keep using
  ARGB bitmaps but when drawing them into a bitmap we erase
  the color information.

Change-Id: I4f04341fc843e3f7dadd1fdbf709b11a4f1e24b9
2010-12-21 10:43:18 -08:00
Xavier Ducrohet
d348b6eaa9 LayoutLib: support for Path and BitmapShader using delegates.
Also created delegates for all missing shader, xfermode
and patheffect classes. Moved the logic of the xfermode,
and patheffects that was in Canvas_Delegate into the
xfermode/patheffect classes, and added support (in all
3 clases) for knowing if the shader/xfermode/patheffect
is actually supported or not. Make use of fidelityWarning
in LayoutLog if they are not.
2010-12-21 10:43:18 -08:00
Xavier Ducrohet
19a021038f LayoutLib: Update layoutlib with revised API.
Change-Id: I78929df621f48e85d9cbefe1f5590f9ce99bbaff
2010-12-21 10:43:17 -08:00
Patrick Dubroy
f890fab5a6 Ensure bitmaps aren't freed while referenced from a display list
Also removes the reference queue finalizers. They aren't necessary
anymore now that Bitmaps are allocated in the heap.
2010-12-20 17:02:15 -08:00
Xavier Ducrohet
cfdc784b6c LayoutLib: replace the stack of Graphics2D with custom snapshots.
The first step is to allow the canvas to save only the matrix or
the clip. Previously, since the graphics2D were created completely
new on each save, everything was saved.

Also allows to set transform/clip on the Canvas when no bitmap
has been set (and therefore no Graphics2D exists).

This is required by BitmapFactory.

Change-Id: I37eff6dde1ca708d58ba317b40e9b3236f3ef3d0
2010-12-15 13:44:03 -08:00
Patrick Dubroy
22ff4ef09f Fix build break due to additional arg in Bitmap ctor 2010-12-14 17:26:27 -08:00