Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +58 −53 Original line number Diff line number Diff line Loading @@ -509,14 +509,13 @@ public final class BridgeContext extends Activity { BridgeTypedArray ta = ((BridgeResources) mSystemResources).newTypeArray(attrs.length, isPlatformFile); // resolve the defStyleAttr value into a IStyleResourceValue StyleResourceValue defStyleValues = null; // look for a custom style. String customStyle = null; if (set != null) { customStyle = set.getAttributeValue(null /* namespace*/, "style"); } StyleResourceValue customStyleValues = null; if (customStyle != null) { ResourceValue item = mRenderResources.findResValue(customStyle, false /*forceFrameworkOnly*/); Loading @@ -525,11 +524,13 @@ public final class BridgeContext extends Activity { item = mRenderResources.resolveResValue(item); if (item instanceof StyleResourceValue) { defStyleValues = (StyleResourceValue)item; customStyleValues = (StyleResourceValue)item; } } if (defStyleValues == null) { // resolve the defStyleAttr value into a IStyleResourceValue StyleResourceValue defStyleValues = null; if (defStyleAttr != 0) { // get the name from the int. String defStyleName = searchAttr(defStyleAttr); Loading Loading @@ -595,7 +596,6 @@ public final class BridgeContext extends Activity { null /*data*/); } } } String namespace = BridgeConstants.NS_RESOURCES; if (frameworkAttributes[0] == false) { Loading @@ -618,8 +618,13 @@ public final class BridgeContext extends Activity { if (value == null) { ResourceValue resValue = null; // look for the value in the defStyle first (and its parent if needed) if (defStyleValues != null) { // look for the value in the custom style first (and its parent if needed) if (customStyleValues != null) { resValue = mRenderResources.findItemInStyle(customStyleValues, name); } // then look for the value in the default Style (and its parent if needed) if (resValue == null && defStyleValues != null) { resValue = mRenderResources.findItemInStyle(defStyleValues, name); } Loading Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +58 −53 Original line number Diff line number Diff line Loading @@ -509,14 +509,13 @@ public final class BridgeContext extends Activity { BridgeTypedArray ta = ((BridgeResources) mSystemResources).newTypeArray(attrs.length, isPlatformFile); // resolve the defStyleAttr value into a IStyleResourceValue StyleResourceValue defStyleValues = null; // look for a custom style. String customStyle = null; if (set != null) { customStyle = set.getAttributeValue(null /* namespace*/, "style"); } StyleResourceValue customStyleValues = null; if (customStyle != null) { ResourceValue item = mRenderResources.findResValue(customStyle, false /*forceFrameworkOnly*/); Loading @@ -525,11 +524,13 @@ public final class BridgeContext extends Activity { item = mRenderResources.resolveResValue(item); if (item instanceof StyleResourceValue) { defStyleValues = (StyleResourceValue)item; customStyleValues = (StyleResourceValue)item; } } if (defStyleValues == null) { // resolve the defStyleAttr value into a IStyleResourceValue StyleResourceValue defStyleValues = null; if (defStyleAttr != 0) { // get the name from the int. String defStyleName = searchAttr(defStyleAttr); Loading Loading @@ -595,7 +596,6 @@ public final class BridgeContext extends Activity { null /*data*/); } } } String namespace = BridgeConstants.NS_RESOURCES; if (frameworkAttributes[0] == false) { Loading @@ -618,8 +618,13 @@ public final class BridgeContext extends Activity { if (value == null) { ResourceValue resValue = null; // look for the value in the defStyle first (and its parent if needed) if (defStyleValues != null) { // look for the value in the custom style first (and its parent if needed) if (customStyleValues != null) { resValue = mRenderResources.findItemInStyle(customStyleValues, name); } // then look for the value in the default Style (and its parent if needed) if (resValue == null && defStyleValues != null) { resValue = mRenderResources.findItemInStyle(defStyleValues, name); } Loading