Loading tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public abstract class Gradient_Delegate extends Shader_Delegate { * Pre-computes the colors for the gradient. This must be called once before any call * to {@link #getGradientColor(float)} */ protected synchronized void precomputeGradientColors() { protected void precomputeGradientColors() { if (mGradient == null) { // actually create an array with an extra size, so that we can really go // from 0 to SIZE (100%), or currentPos in the loop below will never equal 1.0 Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java +4 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.layoutlib.bridge.android.BridgeAssetManager; import com.android.layoutlib.bridge.impl.FontLoader; import com.android.layoutlib.bridge.impl.RenderSessionImpl; import com.android.ninepatch.NinePatchChunk; import com.android.resources.ResourceType; import com.android.tools.layoutlib.create.MethodAdapter; import com.android.tools.layoutlib.create.OverrideMethod; Loading Loading @@ -410,8 +411,9 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { * @param name the name of the resource. * @return an {@link Integer} containing the resource id, or null if no resource were found. */ public static Integer getResourceValue(String type, String name) { Map<String, Integer> map = sRFullMap.get(type); public static Integer getResourceValue(ResourceType type, String name) { String typeString = type.getName(); Map<String, Integer> map = sRFullMap.get(typeString); if (map != null) { return map.get(name); } Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +3 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.ide.common.rendering.api.StyleResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.Stack; import com.android.resources.ResourceType; import android.app.Activity; import android.app.Fragment; Loading Loading @@ -614,7 +615,7 @@ public final class BridgeContext extends Activity { return null; } int getFrameworkResourceValue(String resType, String resName, int defValue) { int getFrameworkResourceValue(ResourceType resType, String resName, int defValue) { Integer value = Bridge.getResourceValue(resType, resName); if (value != null) { return value.intValue(); Loading @@ -623,7 +624,7 @@ public final class BridgeContext extends Activity { return defValue; } int getProjectResourceValue(String resType, String resName, int defValue) { int getProjectResourceValue(ResourceType resType, String resName, int defValue) { if (mProjectCallback != null) { Integer value = mProjectCallback.getResourceValue(resType, resName); if (value != null) { Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java +3 −3 Original line number Diff line number Diff line Loading @@ -19,9 +19,9 @@ package com.android.layoutlib.bridge.android; import com.android.ide.common.rendering.api.IProjectCallback; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.MergeCookie; import com.android.ide.common.rendering.api.RenderResources; import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.resources.ResourceType; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; Loading Loading @@ -158,13 +158,13 @@ public final class BridgeInflater extends LayoutInflater { String[] layoutInfo = Bridge.resolveResourceValue(resource); if (layoutInfo != null) { value = bridgeContext.getRenderResources().getFrameworkResource( RenderResources.RES_LAYOUT, layoutInfo[0]); ResourceType.LAYOUT, layoutInfo[0]); } else { layoutInfo = mProjectCallback.resolveResourceValue(resource); if (layoutInfo != null) { value = bridgeContext.getRenderResources().getProjectResource( RenderResources.RES_LAYOUT, layoutInfo[0]); ResourceType.LAYOUT, layoutInfo[0]); } } Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java +13 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.ResourceHelper; import com.android.resources.ResourceType; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; Loading Loading @@ -103,9 +104,14 @@ public final class BridgeResources extends Resources { String[] resourceInfo = Bridge.resolveResourceValue(id); if (resourceInfo != null) { ResourceType resType = ResourceType.getEnum(resourceInfo[1]); if (resType == null) { return null; } platformResFlag_out[0] = true; return mContext.getRenderResources().getFrameworkResource( resourceInfo[1], resourceInfo[0]); resType, resourceInfo[0]); } // didn't find a match in the framework? look in the project. Loading @@ -113,9 +119,14 @@ public final class BridgeResources extends Resources { resourceInfo = mProjectCallback.resolveResourceValue(id); if (resourceInfo != null) { ResourceType resType = ResourceType.getEnum(resourceInfo[1]); if (resType == null) { return null; } platformResFlag_out[0] = false; return mContext.getRenderResources().getProjectResource( resourceInfo[1], resourceInfo[0]); resType, resourceInfo[0]); } } Loading Loading
tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public abstract class Gradient_Delegate extends Shader_Delegate { * Pre-computes the colors for the gradient. This must be called once before any call * to {@link #getGradientColor(float)} */ protected synchronized void precomputeGradientColors() { protected void precomputeGradientColors() { if (mGradient == null) { // actually create an array with an extra size, so that we can really go // from 0 to SIZE (100%), or currentPos in the loop below will never equal 1.0 Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java +4 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.layoutlib.bridge.android.BridgeAssetManager; import com.android.layoutlib.bridge.impl.FontLoader; import com.android.layoutlib.bridge.impl.RenderSessionImpl; import com.android.ninepatch.NinePatchChunk; import com.android.resources.ResourceType; import com.android.tools.layoutlib.create.MethodAdapter; import com.android.tools.layoutlib.create.OverrideMethod; Loading Loading @@ -410,8 +411,9 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { * @param name the name of the resource. * @return an {@link Integer} containing the resource id, or null if no resource were found. */ public static Integer getResourceValue(String type, String name) { Map<String, Integer> map = sRFullMap.get(type); public static Integer getResourceValue(ResourceType type, String name) { String typeString = type.getName(); Map<String, Integer> map = sRFullMap.get(typeString); if (map != null) { return map.get(name); } Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +3 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.ide.common.rendering.api.StyleResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.Stack; import com.android.resources.ResourceType; import android.app.Activity; import android.app.Fragment; Loading Loading @@ -614,7 +615,7 @@ public final class BridgeContext extends Activity { return null; } int getFrameworkResourceValue(String resType, String resName, int defValue) { int getFrameworkResourceValue(ResourceType resType, String resName, int defValue) { Integer value = Bridge.getResourceValue(resType, resName); if (value != null) { return value.intValue(); Loading @@ -623,7 +624,7 @@ public final class BridgeContext extends Activity { return defValue; } int getProjectResourceValue(String resType, String resName, int defValue) { int getProjectResourceValue(ResourceType resType, String resName, int defValue) { if (mProjectCallback != null) { Integer value = mProjectCallback.getResourceValue(resType, resName); if (value != null) { Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java +3 −3 Original line number Diff line number Diff line Loading @@ -19,9 +19,9 @@ package com.android.layoutlib.bridge.android; import com.android.ide.common.rendering.api.IProjectCallback; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.MergeCookie; import com.android.ide.common.rendering.api.RenderResources; import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.resources.ResourceType; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; Loading Loading @@ -158,13 +158,13 @@ public final class BridgeInflater extends LayoutInflater { String[] layoutInfo = Bridge.resolveResourceValue(resource); if (layoutInfo != null) { value = bridgeContext.getRenderResources().getFrameworkResource( RenderResources.RES_LAYOUT, layoutInfo[0]); ResourceType.LAYOUT, layoutInfo[0]); } else { layoutInfo = mProjectCallback.resolveResourceValue(resource); if (layoutInfo != null) { value = bridgeContext.getRenderResources().getProjectResource( RenderResources.RES_LAYOUT, layoutInfo[0]); ResourceType.LAYOUT, layoutInfo[0]); } } Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java +13 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.ResourceHelper; import com.android.resources.ResourceType; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; Loading Loading @@ -103,9 +104,14 @@ public final class BridgeResources extends Resources { String[] resourceInfo = Bridge.resolveResourceValue(id); if (resourceInfo != null) { ResourceType resType = ResourceType.getEnum(resourceInfo[1]); if (resType == null) { return null; } platformResFlag_out[0] = true; return mContext.getRenderResources().getFrameworkResource( resourceInfo[1], resourceInfo[0]); resType, resourceInfo[0]); } // didn't find a match in the framework? look in the project. Loading @@ -113,9 +119,14 @@ public final class BridgeResources extends Resources { resourceInfo = mProjectCallback.resolveResourceValue(id); if (resourceInfo != null) { ResourceType resType = ResourceType.getEnum(resourceInfo[1]); if (resType == null) { return null; } platformResFlag_out[0] = false; return mContext.getRenderResources().getProjectResource( resourceInfo[1], resourceInfo[0]); resType, resourceInfo[0]); } } Loading