Loading tools/layoutlib/bridge/.classpath +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/layoutlib_api/layoutlib_api-prebuilt.jar"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/> <classpathentry kind="var" path="ANDROID_PLAT_OUT_FRAMEWORK/ninepatch.jar" sourcepath="/ANDROID_PLAT_SRC/development/tools/ninepatch/src"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/> <classpathentry kind="output" path="bin"/> </classpath> tools/layoutlib/bridge/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAVA_LIBRARIES := \ kxml2-2.3.0 \ layoutlib_api-prebuilt \ ninepatch ninepatch-prebuilt LOCAL_STATIC_JAVA_LIBRARIES := temp_layoutlib Loading tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java +1 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public class NinePatch_Delegate { try { chunkObject.draw(bitmap_delegate.getImage(), graphics, left, top, right - left, bottom - top); left, top, right - left, bottom - top, destDensity, srcDensity); } finally { if (paint_delegate != null) { graphics.dispose(); Loading tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java +8 −5 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Helper class to provide various convertion method used in handling android resources. * Helper class to provide various conversion method used in handling android resources. */ public final class ResourceHelper { Loading Loading @@ -133,7 +133,8 @@ public final class ResourceHelper { // if either chunk or bitmap is null, then we reload the 9-patch file. if (chunk == null || bitmap == null) { try { NinePatch ninePatch = NinePatch.load(file.toURL(), false /* convert */); NinePatch ninePatch = NinePatch.load(file.toURI().toURL(), false /* convert */); if (ninePatch != null) { if (chunk == null) { chunk = ninePatch.getChunk(); Loading Loading @@ -161,6 +162,7 @@ public final class ResourceHelper { // URL is wrong, we'll return null below } catch (IOException e) { // failed to read the file, we'll return null below. Bridge.getLog().error(null, e); } } Loading Loading @@ -220,7 +222,7 @@ public final class ResourceHelper { return new BitmapDrawable(context.getResources(), bitmap); } catch (IOException e) { // we'll return null below // TODO: log the error. Bridge.getLog().error(null, e); } } else { // attempt to get a color from the value Loading @@ -229,7 +231,8 @@ public final class ResourceHelper { return new ColorDrawable(color); } catch (NumberFormatException e) { // we'll return null below. // TODO: log the error Bridge.getLog().error(null, "failed to convert " + stringValue + " into a drawable"); } } } Loading Loading
tools/layoutlib/bridge/.classpath +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/layoutlib_api/layoutlib_api-prebuilt.jar"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/> <classpathentry kind="var" path="ANDROID_PLAT_OUT_FRAMEWORK/ninepatch.jar" sourcepath="/ANDROID_PLAT_SRC/development/tools/ninepatch/src"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/> <classpathentry kind="output" path="bin"/> </classpath>
tools/layoutlib/bridge/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAVA_LIBRARIES := \ kxml2-2.3.0 \ layoutlib_api-prebuilt \ ninepatch ninepatch-prebuilt LOCAL_STATIC_JAVA_LIBRARIES := temp_layoutlib Loading
tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java +1 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public class NinePatch_Delegate { try { chunkObject.draw(bitmap_delegate.getImage(), graphics, left, top, right - left, bottom - top); left, top, right - left, bottom - top, destDensity, srcDensity); } finally { if (paint_delegate != null) { graphics.dispose(); Loading
tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java +8 −5 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Helper class to provide various convertion method used in handling android resources. * Helper class to provide various conversion method used in handling android resources. */ public final class ResourceHelper { Loading Loading @@ -133,7 +133,8 @@ public final class ResourceHelper { // if either chunk or bitmap is null, then we reload the 9-patch file. if (chunk == null || bitmap == null) { try { NinePatch ninePatch = NinePatch.load(file.toURL(), false /* convert */); NinePatch ninePatch = NinePatch.load(file.toURI().toURL(), false /* convert */); if (ninePatch != null) { if (chunk == null) { chunk = ninePatch.getChunk(); Loading Loading @@ -161,6 +162,7 @@ public final class ResourceHelper { // URL is wrong, we'll return null below } catch (IOException e) { // failed to read the file, we'll return null below. Bridge.getLog().error(null, e); } } Loading Loading @@ -220,7 +222,7 @@ public final class ResourceHelper { return new BitmapDrawable(context.getResources(), bitmap); } catch (IOException e) { // we'll return null below // TODO: log the error. Bridge.getLog().error(null, e); } } else { // attempt to get a color from the value Loading @@ -229,7 +231,8 @@ public final class ResourceHelper { return new ColorDrawable(color); } catch (NumberFormatException e) { // we'll return null below. // TODO: log the error Bridge.getLog().error(null, "failed to convert " + stringValue + " into a drawable"); } } } Loading