Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dbede1c authored by Deepanshu Gupta's avatar Deepanshu Gupta Committed by Android (Google) Code Review
Browse files

Merge "Add stub getThemeAttributeId() to BridgeTypedArray"

parents 5c2f2039 831f3ce9
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -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) {
@@ -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.
     */
@@ -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(
@@ -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(),
@@ -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,
@@ -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
@@ -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;
        }