Merge "Merge 6f2fb570 from honeycomb. do not merge." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
48a2a5ad1b
@@ -412,9 +412,7 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
return LayoutParams.MATCH_PARENT;
|
return LayoutParams.MATCH_PARENT;
|
||||||
} else if (s.equals(BridgeConstants.WRAP_CONTENT)) {
|
} else if (s.equals(BridgeConstants.WRAP_CONTENT)) {
|
||||||
return LayoutParams.WRAP_CONTENT;
|
return LayoutParams.WRAP_CONTENT;
|
||||||
}
|
} else if (RenderResources.REFERENCE_NULL.equals(s)) {
|
||||||
|
|
||||||
if (RenderResources.REFERENCE_NULL.equals(s)) {
|
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,23 +484,21 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
return LayoutParams.MATCH_PARENT;
|
return LayoutParams.MATCH_PARENT;
|
||||||
} else if (s.equals(BridgeConstants.WRAP_CONTENT)) {
|
} else if (s.equals(BridgeConstants.WRAP_CONTENT)) {
|
||||||
return LayoutParams.WRAP_CONTENT;
|
return LayoutParams.WRAP_CONTENT;
|
||||||
}
|
} else if (RenderResources.REFERENCE_NULL.equals(s)) {
|
||||||
|
|
||||||
if (RenderResources.REFERENCE_NULL.equals(s)) {
|
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME huh?
|
|
||||||
|
|
||||||
float f = getDimension(index, defValue);
|
float f = getDimension(index, defValue);
|
||||||
final int res = (int)(f+0.5f);
|
final int res = (int)(f+0.5f);
|
||||||
if (res != 0) return res;
|
if (res != 0) return res;
|
||||||
if (f == 0) return 0;
|
if (f == 0) return 0;
|
||||||
if (f > 0) return 1;
|
if (f > 0) return 1; // this is to support ]0;1[ range (since >=1 is handled 2 lines above)
|
||||||
|
if (f < 0) {
|
||||||
Bridge.getLog().error(LayoutLog.TAG_RESOURCES_FORMAT,
|
// negative values are not allowed in pixel dimensions
|
||||||
"Can't convert to dimension: " + Integer.toString(index),
|
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
|
||||||
|
"Negative pixel dimension: " + s,
|
||||||
null, null /*data*/);
|
null, null /*data*/);
|
||||||
|
}
|
||||||
|
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ public final class ResourceHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check the first character
|
// check the first character
|
||||||
if (buf[0] < '0' && buf[0] > '9' && buf[0] != '.') {
|
if (buf[0] < '0' && buf[0] > '9' && buf[0] != '.' && buf[0] != '-') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user