Loading tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +23 −16 Original line number Diff line number Diff line Loading @@ -327,12 +327,19 @@ public final class BridgeTypedArray extends TypedArray { return null; } // let the framework inflate the ColorStateList from the XML file. try { // Get the state list file content from callback to parse PSI file XmlPullParser parser = mContext.getLayoutlibCallback().getXmlFileParser(value); if (parser == null) { // If used with a version of Android Studio that does not implement getXmlFileParser // fall back to reading the file from disk File f = new File(value); if (f.isFile()) { try { XmlPullParser parser = ParserFactory.create(f); parser = ParserFactory.create(f); } } if (parser != null) { BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser( parser, mContext, resValue.isFramework()); try { Loading @@ -341,6 +348,7 @@ public final class BridgeTypedArray extends TypedArray { } finally { blockParser.ensurePopped(); } } } catch (XmlPullParserException e) { Bridge.getLog().error(LayoutLog.TAG_BROKEN, "Failed to configure parser for " + value, e, null); Loading @@ -353,7 +361,6 @@ public final class BridgeTypedArray extends TypedArray { return null; } } try { int color = ResourceHelper.getColor(value); Loading Loading
tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +23 −16 Original line number Diff line number Diff line Loading @@ -327,12 +327,19 @@ public final class BridgeTypedArray extends TypedArray { return null; } // let the framework inflate the ColorStateList from the XML file. try { // Get the state list file content from callback to parse PSI file XmlPullParser parser = mContext.getLayoutlibCallback().getXmlFileParser(value); if (parser == null) { // If used with a version of Android Studio that does not implement getXmlFileParser // fall back to reading the file from disk File f = new File(value); if (f.isFile()) { try { XmlPullParser parser = ParserFactory.create(f); parser = ParserFactory.create(f); } } if (parser != null) { BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser( parser, mContext, resValue.isFramework()); try { Loading @@ -341,6 +348,7 @@ public final class BridgeTypedArray extends TypedArray { } finally { blockParser.ensurePopped(); } } } catch (XmlPullParserException e) { Bridge.getLog().error(LayoutLog.TAG_BROKEN, "Failed to configure parser for " + value, e, null); Loading @@ -353,7 +361,6 @@ public final class BridgeTypedArray extends TypedArray { return null; } } try { int color = ResourceHelper.getColor(value); Loading