@Override public AttributeResource getAttrValue(ResName attrName) { AttributeResource attribute = null; for (OverlayedStyle overlayedStyle : styles) { AttributeResource overlayedAttribute = overlayedStyle.style.getAttrValue(attrName); if (overlayedAttribute != null && (attribute == null || overlayedStyle.force)) { attribute = overlayedAttribute; } } return attribute; }
@Override public AttributeResource getAttrValue(ResName resName) { for (StyleData style : styles) { AttributeResource value = style.getAttrValue(resName); if (value != null) return value; } int initialSize = styles.size(); while (hasParent(styles.get(styles.size() - 1))) { StyleData parent = getParent(styles.get(styles.size() - 1)); if (parent != null) { styles.add(parent); } else { break; } } for (int i = initialSize; i < styles.size(); i++) { StyleData style = styles.get(i); AttributeResource value = style.getAttrValue(resName); if (value != null) return value; } // todo: is this tested? if (theme != null) { AttributeResource value = theme.getAttrValue(resName); if (value != null) return value; } return null; }
private ResName dereferenceResName(ResName res) { ResName styleRef = res; boolean dereferencing = true; while ("attr".equals(styleRef.type) && dereferencing) { dereferencing = false; for (StyleData parentStyle : styles) { AttributeResource value = parentStyle.getAttrValue(styleRef); if (value != null) { styleRef = dereferenceAttr(value); dereferencing = true; break; } } if (!dereferencing && theme != null) { AttributeResource value = theme.getAttrValue(styleRef); if (value != null) { styleRef = dereferenceAttr(value); dereferencing = true; } } } return styleRef; }
AttributeResource attribute = styleAttrStyle.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromAttr.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromRes.getAttrValue(attrName); if (attribute != null) { return attribute; return themeStyleSet.getAttrValue(attrName);
AttributeResource defStyleAttribute = themeStyleSet.getAttrValue(defStyleName); if (defStyleAttribute != null) { while (defStyleAttribute.isStyleReference()) { AttributeResource other = themeStyleSet.getAttrValue(defStyleAttribute.getStyleReference()); if (other == null) { throw new RuntimeException("couldn't dereference " + defStyleAttribute); ResName styleAttributeResName = getResName(set.getStyleAttribute()); while (styleAttributeResName.type.equals("attr")) { AttributeResource attrValue = themeStyleSet.getAttrValue(styleAttributeResName); if (attrValue == null) { throw new RuntimeException( AttributeResource otherAttr = themeStyleSet.getAttrValue(otherAttrName); if (otherAttr == null) { strictError("no such attr %s in %s while resolving value for %s", attribute.value, themeStyleSet, resName.getFullyQualifiedName());
public AttributeResource getAttrValue(ResName attrName) { AttributeResource attribute = null; for (OverlayedStyle overlayedStyle : styles) { AttributeResource overlayedAttribute = overlayedStyle.style.getAttrValue(attrName); if (overlayedAttribute != null && (attribute == null || overlayedStyle.force)) { attribute = overlayedAttribute; } } return attribute; }
@Override public AttributeResource getAttrValue(ResName attrName) { AttributeResource attribute = null; for (OverlayedStyle overlayedStyle : styles) { AttributeResource overlayedAttribute = overlayedStyle.style.getAttrValue(attrName); if (overlayedAttribute != null && (attribute == null || overlayedStyle.force)) { attribute = overlayedAttribute; } } return attribute; }
@Override public AttributeResource getAttrValue(ResName resName) { for (StyleData style : styles) { AttributeResource value = style.getAttrValue(resName); if (value != null) return value; } int initialSize = styles.size(); while (hasParent(styles.get(styles.size() - 1))) { StyleData parent = getParent(styles.get(styles.size() - 1)); if (parent != null) { styles.add(parent); } else { break; } } for (int i = initialSize; i < styles.size(); i++) { StyleData style = styles.get(i); AttributeResource value = style.getAttrValue(resName); if (value != null) return value; } // todo: is this tested? if (theme != null) { AttributeResource value = theme.getAttrValue(resName); if (value != null) return value; } return null; }
@Override public AttributeResource getAttrValue(ResName resName) { for (StyleData style : styles) { AttributeResource value = style.getAttrValue(resName); if (value != null) return value; } int initialSize = styles.size(); while (hasParent(styles.get(styles.size() - 1))) { StyleData parent = getParent(styles.get(styles.size() - 1)); if (parent != null) { styles.add(parent); } else { break; } } for (int i = initialSize; i < styles.size(); i++) { StyleData style = styles.get(i); AttributeResource value = style.getAttrValue(resName); if (value != null) return value; } // todo: is this tested? if (theme != null) { AttributeResource value = theme.getAttrValue(resName); if (value != null) return value; } return null; }
private ResName dereferenceResName(ResName res) { ResName styleRef = res; boolean dereferencing = true; while ("attr".equals(styleRef.type) && dereferencing) { dereferencing = false; for (StyleData parentStyle : styles) { AttributeResource value = parentStyle.getAttrValue(styleRef); if (value != null) { styleRef = dereferenceAttr(value); dereferencing = true; break; } } if (!dereferencing && theme != null) { AttributeResource value = theme.getAttrValue(styleRef); if (value != null) { styleRef = dereferenceAttr(value); dereferencing = true; } } } return styleRef; }
private ResName dereferenceResName(ResName res) { ResName styleRef = res; boolean dereferencing = true; while ("attr".equals(styleRef.type) && dereferencing) { dereferencing = false; for (StyleData parentStyle : styles) { AttributeResource value = parentStyle.getAttrValue(styleRef); if (value != null) { styleRef = dereferenceAttr(value); dereferencing = true; break; } } if (!dereferencing && theme != null) { AttributeResource value = theme.getAttrValue(styleRef); if (value != null) { styleRef = dereferenceAttr(value); dereferencing = true; } } } return styleRef; }
AttributeResource attribute = styleAttrStyle.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromAttr.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromRes.getAttrValue(attrName); if (attribute != null) { return attribute; return themeStyleSet.getAttrValue(attrName);
AttributeResource attribute = styleAttrStyle.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromAttr.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromRes.getAttrValue(attrName); if (attribute != null) { return attribute; return themeStyleSet.getAttrValue(attrName);
AttributeResource attribute = styleAttrStyle.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromAttr.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromRes.getAttrValue(attrName); if (attribute != null) { return attribute; return themeStyleSet.getAttrValue(attrName);
AttributeResource attribute = styleAttrStyle.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromAttr.getAttrValue(attrName); if (attribute != null) { return attribute; AttributeResource attribute = defStyleFromRes.getAttrValue(attrName); if (attribute != null) { return attribute; return themeStyleSet.getAttrValue(attrName);
AttributeResource defStyleAttribute = themeStyleSet.getAttrValue(defStyleName); if (defStyleAttribute != null) { while (defStyleAttribute.isStyleReference()) { AttributeResource other = themeStyleSet.getAttrValue(defStyleAttribute.getStyleReference()); if (other == null) { throw new RuntimeException("couldn't dereference " + defStyleAttribute); ResName styleAttributeResName = getResName(set.getStyleAttribute()); while (styleAttributeResName.type.equals("attr")) { AttributeResource attrValue = themeStyleSet.getAttrValue(styleAttributeResName); if (attrValue == null) { throw new RuntimeException( AttributeResource otherAttr = themeStyleSet.getAttrValue(otherAttrName); if (otherAttr == null) { strictError("no such attr %s in %s while resolving value for %s", attribute.value, themeStyleSet, resName.getFullyQualifiedName());
AttributeResource defStyleAttribute = themeStyleSet.getAttrValue(defStyleName); if (defStyleAttribute != null) { while (defStyleAttribute.isStyleReference()) { AttributeResource other = themeStyleSet.getAttrValue(defStyleAttribute.getStyleReference()); if (other == null) { throw new RuntimeException("couldn't dereference " + defStyleAttribute); ResName styleAttributeResName = getResName(set.getStyleAttribute()); while (styleAttributeResName.type.equals("attr")) { AttributeResource attrValue = themeStyleSet.getAttrValue(styleAttributeResName); if (attrValue == null) { throw new RuntimeException( if (attributeValue != null) { if (attributeValue.isStyleReference()) { resName = themeStyleSet.getAttrValue(attributeValue.getStyleReference()).getResourceReference(); } else if (attributeValue.isResourceReference()) { resName = attributeValue.getResourceReference(); AttributeResource otherAttr = themeStyleSet.getAttrValue(otherAttrName); if (otherAttr == null) { strictError("no such attr %s in %s while resolving value for %s", attribute.value, themeStyleSet, resName.getFullyQualifiedName());
AttributeResource defStyleAttribute = themeStyleSet.getAttrValue(defStyleName); if (defStyleAttribute != null) { while (defStyleAttribute.isStyleReference()) { AttributeResource other = themeStyleSet.getAttrValue(defStyleAttribute.getStyleReference()); if (other == null) { throw new RuntimeException("couldn't dereference " + defStyleAttribute); ResName styleAttributeResName = getResName(set.getStyleAttribute()); while (styleAttributeResName.type.equals("attr")) { AttributeResource attrValue = themeStyleSet.getAttrValue(styleAttributeResName); if (attrValue == null) { throw new RuntimeException( if (attributeValue != null) { if (attributeValue.isStyleReference()) { resName = themeStyleSet.getAttrValue(attributeValue.getStyleReference()).getResourceReference(); } else if (attributeValue.isResourceReference()) { resName = attributeValue.getResourceReference(); AttributeResource otherAttr = themeStyleSet.getAttrValue(otherAttrName); if (otherAttr == null) { strictError("no such attr %s in %s while resolving value for %s", attribute.value, themeStyleSet, resName.getFullyQualifiedName());
AttributeResource defStyleAttribute = themeStyleSet.getAttrValue(defStyleName); if (defStyleAttribute != null) { while (defStyleAttribute.isStyleReference()) { AttributeResource other = themeStyleSet.getAttrValue(defStyleAttribute.getStyleReference()); if (other == null) { throw new RuntimeException("couldn't dereference " + defStyleAttribute); ResName styleAttributeResName = getResName(set.getStyleAttribute()); while (styleAttributeResName.type.equals("attr")) { AttributeResource attrValue = themeStyleSet.getAttrValue(styleAttributeResName); if (attrValue == null) { throw new RuntimeException( if (attributeValue != null) { if (attributeValue.isStyleReference()) { resName = themeStyleSet.getAttrValue(attributeValue.getStyleReference()).getResourceReference(); } else if (attributeValue.isResourceReference()) { resName = attributeValue.getResourceReference(); AttributeResource otherAttr = themeStyleSet.getAttrValue(otherAttrName); if (otherAttr == null) { strictError("no such attr %s in %s while resolving value for %s", attribute.value, themeStyleSet, resName.getFullyQualifiedName());