@Override public float getDimension(int id) throws NotFoundException { IResourceValue value = getResourceValue(id, mPlatformResourceFlag); if (value != null) { String v = value.getValue(); if (v != null) { if (v.equals(BridgeConstants.FILL_PARENT)) { return LayoutParams.FILL_PARENT; } else if (v.equals(BridgeConstants.WRAP_CONTENT)) { return LayoutParams.WRAP_CONTENT; } if (ResourceHelper.stringToFloat(v, mTmpValue) && mTmpValue.type == TypedValue.TYPE_DIMENSION) { return mTmpValue.getDimension(mMetrics); } } } // id was not found or not resolved. Throw a NotFoundException. throwException(id); // this is not used since the method above always throws return 0; }
@Override public void getValue(int id, TypedValue outValue, boolean resolveRefs) throws NotFoundException { IResourceValue value = getResourceValue(id, mPlatformResourceFlag); if (value != null) { String v = value.getValue(); if (v != null) { if (ResourceHelper.stringToFloat(v, outValue)) { return; } } } // id was not found or not resolved. Throw a NotFoundException. throwException(id); }
@Override public int getDimensionPixelSize(int id) throws NotFoundException { IResourceValue value = getResourceValue(id, mPlatformResourceFlag); if (value != null) { String v = value.getValue(); if (v != null) { if (ResourceHelper.stringToFloat(v, mTmpValue) && mTmpValue.type == TypedValue.TYPE_DIMENSION) { return TypedValue.complexToDimensionPixelSize(mTmpValue.data, mMetrics); } } } // id was not found or not resolved. Throw a NotFoundException. throwException(id); // this is not used since the method above always throws return 0; }