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: applyStyle: handle "style" value being an attribute, append styles to global theme instead of replacing it
This commit is contained in:
@@ -767,11 +767,22 @@ public final class AssetManager {
|
||||
TypedValue value = new TypedValue();
|
||||
if (defStyleRes == 0 && theme != 0 && loadThemeAttributeValue(theme, defStyleAttr, value, true) >= 0)
|
||||
defStyleRes = value.data;
|
||||
if (defStyleRes == 0 && set != null)
|
||||
defStyleRes = set.getAttributeResourceValue(null, "style", 0);
|
||||
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;
|
||||
}
|
||||
}
|
||||
long defStyle = 0;
|
||||
if (defStyleRes != 0) {
|
||||
defStyle = newTheme();
|
||||
if(theme != 0)
|
||||
copyTheme(defStyle, theme);
|
||||
|
||||
applyThemeStyle(defStyle, defStyleRes, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user