am 4753498d: Merge "CherryPick 06942bc4 from hc-mr1. do not merge." into gingerbread
* commit '4753498d5c1ac3cf93b0730e77946a95b6913a82': CherryPick 06942bc4 from hc-mr1. do not merge.
This commit is contained in:
@@ -296,12 +296,17 @@ public final class BridgeContext extends Activity {
|
|||||||
|
|
||||||
public Pair<View, Boolean> inflateView(ResourceReference resource, ViewGroup parent,
|
public Pair<View, Boolean> inflateView(ResourceReference resource, ViewGroup parent,
|
||||||
boolean attachToRoot, boolean skipCallbackParser) {
|
boolean attachToRoot, boolean skipCallbackParser) {
|
||||||
String layoutName = resource.getName();
|
|
||||||
boolean isPlatformLayout = resource.isFramework();
|
boolean isPlatformLayout = resource.isFramework();
|
||||||
|
|
||||||
if (isPlatformLayout == false && skipCallbackParser == false) {
|
if (isPlatformLayout == false && skipCallbackParser == false) {
|
||||||
// check if the project callback can provide us with a custom parser.
|
// check if the project callback can provide us with a custom parser.
|
||||||
ILayoutPullParser parser = mProjectCallback.getParser(layoutName);
|
ILayoutPullParser parser;
|
||||||
|
if (resource instanceof ResourceValue) {
|
||||||
|
parser = mProjectCallback.getParser((ResourceValue) resource);
|
||||||
|
} else {
|
||||||
|
parser = mProjectCallback.getParser(resource.getName());
|
||||||
|
}
|
||||||
|
|
||||||
if (parser != null) {
|
if (parser != null) {
|
||||||
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(parser,
|
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(parser,
|
||||||
this, resource.isFramework());
|
this, resource.isFramework());
|
||||||
@@ -369,7 +374,7 @@ public final class BridgeContext extends Activity {
|
|||||||
} else {
|
} else {
|
||||||
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
|
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
|
||||||
String.format("Layout %s%s does not exist.", isPlatformLayout ? "android:" : "",
|
String.format("Layout %s%s does not exist.", isPlatformLayout ? "android:" : "",
|
||||||
layoutName), null);
|
resource.getName()), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Pair.of(null, false);
|
return Pair.of(null, false);
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ public final class BridgeResources extends Resources {
|
|||||||
try {
|
try {
|
||||||
// check if the current parser can provide us with a custom parser.
|
// check if the current parser can provide us with a custom parser.
|
||||||
if (mPlatformResourceFlag[0] == false) {
|
if (mPlatformResourceFlag[0] == false) {
|
||||||
parser = mProjectCallback.getParser(value.getName());
|
parser = mProjectCallback.getParser(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new one manually if needed.
|
// create a new one manually if needed.
|
||||||
|
|||||||
Reference in New Issue
Block a user