You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
AssetManager: load style with parser.getAttribute(null, "style")
This way, we get the type as well and can check for it being an attribute properly.
This commit is contained in:
@@ -765,20 +765,20 @@ public final class AssetManager {
|
||||
int defStyleAttr, int defStyleRes, AttributeSet set,
|
||||
int[] inAttrs, int[] outValues, int[] outIndices) {
|
||||
TypedValue value = new TypedValue();
|
||||
ResXmlPullParser parser = (ResXmlPullParser)set;
|
||||
if (defStyleRes == 0 && theme != 0 && loadThemeAttributeValue(theme, defStyleAttr, value, true) >= 0)
|
||||
defStyleRes = value.data;
|
||||
if (defStyleRes == 0 && set != null) {
|
||||
int styleVal = set.getAttributeResourceValue(null, "style", 0);
|
||||
if(((styleVal >> 16) & 0xff) == 0x3) { // attribute
|
||||
if (theme != 0 && loadThemeAttributeValue(theme, styleVal, value, true) >= 0)
|
||||
defStyleRes = value.data;
|
||||
}
|
||||
else {
|
||||
defStyleRes = styleVal;
|
||||
ValueItem valueItem = parser.getAttribute(null, "style");
|
||||
if (valueItem != null) {
|
||||
value.type = valueItem.getType();
|
||||
value.data = valueItem.getData();
|
||||
if (theme != 0 && (value.type == TypedValue.TYPE_ATTRIBUTE))
|
||||
loadThemeAttributeValue(theme, value.data, value, true);
|
||||
defStyleRes = value.data;
|
||||
}
|
||||
}
|
||||
|
||||
ResXmlPullParser parser = (ResXmlPullParser)set;
|
||||
outIndices[0] = 0;
|
||||
|
||||
Map<Integer,Integer> xmlCache = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user