OSDN Git Service

Bring in more layout lib changes from hc-mr1.
authorXavier Ducrohet <xav@android.com>
Fri, 10 Jun 2011 02:14:06 +0000 (19:14 -0700)
committerXavier Ducrohet <xav@android.com>
Thu, 16 Jun 2011 20:23:53 +0000 (13:23 -0700)
commit04ce81113107d2bfa0b8248b13145b4cf24cb943
treea9715c622a2b04360a8f47fb3a166fd5047b193f
parent8e18668d14adf601cbe5973030c310ec23d88461
Bring in more layout lib changes from hc-mr1.

fe051bb2 : Change the way the layoutlib instantiate its XmlPullParser.

A lot of the init code was duplicated so I made a ParserFactory class.

Also created an extension of the KXmlPullParser to override toString().
This allows easier debugging when dealing with multiple parsers (which
is always the case).

Also added some (disabled) debugging printf to deal with parser stack
as it can be tricky figuring out which parsers are in the stack at
which point.

8969147c : Fix case where the int[] attrs doesn't directly match a styleable.

In the case of the FastScroller the int[] is a custom mix of attr
instead of a int[] that exists as R.styleable.foo.

This makes our reflection based mechanism used to find the styleable
fail, so instead we search for each attribute separately (like
we probably should have done from the beginning).

0c264b35: Fix various cases of getDimension to report error if unit is missing.

if getDimention###() is called for a string that has no unit,
then an error is output through LayoutLog, but the rendering keeps
going by using dp as a default.

0beb7eea: Make (Bridge)TypedArray.getInteger() call out to getInt()

Only getInt() resolved attribute flags/enum and I'm not sure why
there's two to begin with.
14 files changed:
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParser.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FakeActionBar.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/PhoneSystemBar.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/TabletSystemBar.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/TitleBar.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java [new file with mode: 0644]
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java