mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-01 14:25:08 +08:00
Implement {min,max}{Width,Height} in ReactAndroid
Reviewed By: astreet Differential Revision: D3424294 fbshipit-source-id: 03ae663927600bff025cd953a9b6b221c8dd9f23
This commit is contained in:
committed by
Facebook Github Bot 1
parent
78b892906b
commit
1579a72ca6
@@ -26,11 +26,31 @@ public class LayoutShadowNode extends ReactShadowNode {
|
||||
setStyleWidth(CSSConstants.isUndefined(width) ? width : PixelUtil.toPixelFromDIP(width));
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.MIN_WIDTH, defaultFloat = CSSConstants.UNDEFINED)
|
||||
public void setMinWidth(float minWidth) {
|
||||
setStyleMinWidth(CSSConstants.isUndefined(minWidth) ? minWidth : PixelUtil.toPixelFromDIP(minWidth));
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.MAX_WIDTH, defaultFloat = CSSConstants.UNDEFINED)
|
||||
public void setMaxWidth(float maxWidth) {
|
||||
setStyleMaxWidth(CSSConstants.isUndefined(maxWidth) ? maxWidth : PixelUtil.toPixelFromDIP(maxWidth));
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.HEIGHT, defaultFloat = CSSConstants.UNDEFINED)
|
||||
public void setHeight(float height) {
|
||||
setStyleHeight(CSSConstants.isUndefined(height) ? height : PixelUtil.toPixelFromDIP(height));
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.MIN_HEIGHT, defaultFloat = CSSConstants.UNDEFINED)
|
||||
public void setMinHeight(float minHeight) {
|
||||
setStyleMinHeight(CSSConstants.isUndefined(minHeight) ? minHeight : PixelUtil.toPixelFromDIP(minHeight));
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.MAX_HEIGHT, defaultFloat = CSSConstants.UNDEFINED)
|
||||
public void setMaxHeight(float maxHeight) {
|
||||
setStyleMaxHeight(CSSConstants.isUndefined(maxHeight) ? maxHeight : PixelUtil.toPixelFromDIP(maxHeight));
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.LEFT, defaultFloat = CSSConstants.UNDEFINED)
|
||||
public void setLeft(float left) {
|
||||
setPositionLeft(CSSConstants.isUndefined(left) ? left : PixelUtil.toPixelFromDIP(left));
|
||||
|
||||
Reference in New Issue
Block a user