diff options
author | Xavier Ducrohet <xav@android.com> | 2011-03-15 11:41:10 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-15 11:41:10 -0700 |
commit | a82a219a7aaee82d790810f6660924604b7a7e81 (patch) | |
tree | bdb1ac8ccea9973ed0bfc6f63141af4d700371a7 /tools | |
parent | 403da3a79af78920b33448bbc8d91c4b8aebf4a4 (diff) | |
parent | b243aabdaf1ba6fdfc0579c9f949e00d562456ed (diff) | |
download | frameworks_base-a82a219a7aaee82d790810f6660924604b7a7e81.zip frameworks_base-a82a219a7aaee82d790810f6660924604b7a7e81.tar.gz frameworks_base-a82a219a7aaee82d790810f6660924604b7a7e81.tar.bz2 |
am b243aabd: Merge adaa12cd from honeycomb. do not merge.
* commit 'b243aabdaf1ba6fdfc0579c9f949e00d562456ed':
Merge adaa12cd from honeycomb. do not merge.
Diffstat (limited to 'tools')
3 files changed, 23 insertions, 12 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java index 85bc785..db14e53 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Path_Delegate.java @@ -393,7 +393,7 @@ public final class Path_Delegate { for (int i = 0 ; i < 3 ; i++) { if (radii[i * 2] != radii[(i + 1) * 2] || radii[i * 2 + 1] != radii[(i + 1) * 2 + 1]) { Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED, - "Different corner size is not support in Path.addRoundRect.", + "Different corner sizes are not supported in Path.addRoundRect.", null, null /*data*/); break; } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java index 2792100..b1a7824 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java @@ -192,7 +192,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { Capability.UNBOUND_RENDERING, Capability.CUSTOM_BACKGROUND_COLOR, Capability.RENDER, - Capability.LAYOUT_ONLY, + //Capability.LAYOUT_ONLY, // disable to run on ADT 10.0 which doesn't include this. Capability.EMBEDDED_LAYOUT, Capability.VIEW_MANIPULATION); diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java index 77c1789..138a455 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java @@ -488,18 +488,29 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } - float f = getDimension(index, defValue); - final int res = (int)(f+0.5f); - if (res != 0) return res; - if (f == 0) return 0; - if (f > 0) return 1; // this is to support ]0;1[ range (since >=1 is handled 2 lines above) - if (f < 0) { - // negative values are not allowed in pixel dimensions - Bridge.getLog().error(LayoutLog.TAG_BROKEN, - "Negative pixel dimension: " + s, - null, null /*data*/); + if (ResourceHelper.stringToFloat(s, mValue)) { + float f = mValue.getDimension(mBridgeResources.mMetrics); + + if (f < 0) { + // negative values are not allowed in pixel dimensions + Bridge.getLog().error(LayoutLog.TAG_BROKEN, + "Negative pixel dimension: " + s, + null, null /*data*/); + return defValue; + } + + if (f == 0) return 0; + if (f < 1) return 1; + + return (int)(f+0.5f); } + // looks like we were unable to resolve the dimension value + Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT, + String.format( + "\"%1$s\" in attribute \"%2$s\" is not a valid format.", + s, mNames[index]), null /*data*/); + return defValue; } |