@@ -296,12 +296,17 @@ public ResourceReference resolveId(int id) {
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 Pair<View, Boolean> inflateView(ResourceReference resource, ViewGroup par
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 );
0 commit comments