• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修訂fffa6ad777d42c471746b3bba68b9bc3a24fc97a (tree)
時間2011-06-09 09:12:42
作者Xavier Ducrohet <xav@andr...>
CommiterXavier Ducrohet

Log Message

CherryPick 06942bc4 from hc-mr1. do not merge.

Layoutlib - use the new getParser callback when possible.

Change-Id: Ibfc056e5d1f414686a17f30571b173ecdc0936fd

Change Summary

差異

--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -296,12 +296,17 @@ public final class BridgeContext extends Activity {
296296
297297 public Pair<View, Boolean> inflateView(ResourceReference resource, ViewGroup parent,
298298 boolean attachToRoot, boolean skipCallbackParser) {
299- String layoutName = resource.getName();
300299 boolean isPlatformLayout = resource.isFramework();
301300
302301 if (isPlatformLayout == false && skipCallbackParser == false) {
303302 // check if the project callback can provide us with a custom parser.
304- ILayoutPullParser parser = mProjectCallback.getParser(layoutName);
303+ ILayoutPullParser parser;
304+ if (resource instanceof ResourceValue) {
305+ parser = mProjectCallback.getParser((ResourceValue) resource);
306+ } else {
307+ parser = mProjectCallback.getParser(resource.getName());
308+ }
309+
305310 if (parser != null) {
306311 BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(parser,
307312 this, resource.isFramework());
@@ -369,7 +374,7 @@ public final class BridgeContext extends Activity {
369374 } else {
370375 Bridge.getLog().error(LayoutLog.TAG_BROKEN,
371376 String.format("Layout %s%s does not exist.", isPlatformLayout ? "android:" : "",
372- layoutName), null);
377+ resource.getName()), null);
373378 }
374379
375380 return Pair.of(null, false);
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
@@ -234,7 +234,7 @@ public final class BridgeResources extends Resources {
234234 try {
235235 // check if the current parser can provide us with a custom parser.
236236 if (mPlatformResourceFlag[0] == false) {
237- parser = mProjectCallback.getParser(value.getName());
237+ parser = mProjectCallback.getParser(value);
238238 }
239239
240240 // create a new one manually if needed.