Loading tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +15 −8 Original line number Diff line number Diff line Loading @@ -52,9 +52,9 @@ public final class BridgeTypedArray extends TypedArray { private final BridgeContext mContext; private final boolean mPlatformFile; private ResourceValue[] mResourceData; private String[] mNames; private boolean[] mIsFramework; private final ResourceValue[] mResourceData; private final String[] mNames; private final boolean[] mIsFramework; public BridgeTypedArray(BridgeResources resources, BridgeContext context, int len, boolean platformFile) { Loading @@ -81,8 +81,8 @@ public final class BridgeTypedArray extends TypedArray { } /** * Seals the array after all calls to {@link #bridgeSetValue(int, String, ResourceValue)} have * been done. * Seals the array after all calls to * {@link #bridgeSetValue(int, String, boolean, ResourceValue)} have been done. * <p/>This allows to compute the list of non default values, permitting * {@link #getIndexCount()} to return the proper value. */ Loading Loading @@ -252,7 +252,7 @@ public final class BridgeTypedArray extends TypedArray { for (String keyword : keywords) { Integer i = map.get(keyword.trim()); if (i != null) { result |= i.intValue(); result |= i; } else { Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT, String.format( Loading Loading @@ -731,7 +731,7 @@ public final class BridgeTypedArray extends TypedArray { } // not a direct id valid reference? resolve it Integer idValue = null; Integer idValue; if (resValue.isFramework()) { idValue = Bridge.getResourceId(resValue.getResourceType(), Loading @@ -742,7 +742,7 @@ public final class BridgeTypedArray extends TypedArray { } if (idValue != null) { return idValue.intValue(); return idValue; } Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_RESOLVE, Loading @@ -753,6 +753,12 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } @Override public int getThemeAttributeId(int index, int defValue) { // TODO: Get the right Theme Attribute ID to enable caching of the drawables. return defValue; } /** * Retrieve the Drawable for the attribute at <var>index</var>. This * gets the resource ID of the selected attribute, and uses Loading Loading @@ -854,6 +860,7 @@ public final class BridgeTypedArray extends TypedArray { */ @Override public boolean hasValue(int index) { //noinspection SimplifiableIfStatement if (index < 0 || index >= mResourceData.length) { return false; } Loading Loading
tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +15 −8 Original line number Diff line number Diff line Loading @@ -52,9 +52,9 @@ public final class BridgeTypedArray extends TypedArray { private final BridgeContext mContext; private final boolean mPlatformFile; private ResourceValue[] mResourceData; private String[] mNames; private boolean[] mIsFramework; private final ResourceValue[] mResourceData; private final String[] mNames; private final boolean[] mIsFramework; public BridgeTypedArray(BridgeResources resources, BridgeContext context, int len, boolean platformFile) { Loading @@ -81,8 +81,8 @@ public final class BridgeTypedArray extends TypedArray { } /** * Seals the array after all calls to {@link #bridgeSetValue(int, String, ResourceValue)} have * been done. * Seals the array after all calls to * {@link #bridgeSetValue(int, String, boolean, ResourceValue)} have been done. * <p/>This allows to compute the list of non default values, permitting * {@link #getIndexCount()} to return the proper value. */ Loading Loading @@ -252,7 +252,7 @@ public final class BridgeTypedArray extends TypedArray { for (String keyword : keywords) { Integer i = map.get(keyword.trim()); if (i != null) { result |= i.intValue(); result |= i; } else { Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT, String.format( Loading Loading @@ -731,7 +731,7 @@ public final class BridgeTypedArray extends TypedArray { } // not a direct id valid reference? resolve it Integer idValue = null; Integer idValue; if (resValue.isFramework()) { idValue = Bridge.getResourceId(resValue.getResourceType(), Loading @@ -742,7 +742,7 @@ public final class BridgeTypedArray extends TypedArray { } if (idValue != null) { return idValue.intValue(); return idValue; } Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_RESOLVE, Loading @@ -753,6 +753,12 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } @Override public int getThemeAttributeId(int index, int defValue) { // TODO: Get the right Theme Attribute ID to enable caching of the drawables. return defValue; } /** * Retrieve the Drawable for the attribute at <var>index</var>. This * gets the resource ID of the selected attribute, and uses Loading Loading @@ -854,6 +860,7 @@ public final class BridgeTypedArray extends TypedArray { */ @Override public boolean hasValue(int index) { //noinspection SimplifiableIfStatement if (index < 0 || index >= mResourceData.length) { return false; } Loading