OSDN Git Service

LayoutLib: When possible ensure parsers are popped from the stack.
authorXavier Ducrohet <xav@android.com>
Mon, 14 Feb 2011 04:15:50 +0000 (20:15 -0800)
committerXavier Ducrohet <xav@android.com>
Mon, 14 Feb 2011 17:42:19 +0000 (09:42 -0800)
commit02d2b5a4031c80bfe1012ce2f4f7b3695762abd9
treef4d74330dbd29a475c7464c18fd32e8e76d2c2c1
parentbbcf2079e9978ad6f75732070ce1dcc0dea3ea3f
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
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/impl/RenderSessionImpl.java
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java