Cloneablepublic static class MagicLayout.LayoutConfig extends ComponentContainer.LayoutConfig
MagicLayout.| 限定符和类型 | 字段 | 说明 |
|---|---|---|
int |
referenceSize |
Indicates the line wrapping reference size.
|
static int |
UNSPECIFIED_HIDE_PRIORITY |
Indicates the default hide priority.
|
static int |
UNSPECIFIED_REFERENCE_SIZE |
Indicate the default value for the line wrapping reference size, which equals the width of a component and
its margins.
|
height, MATCH_CONTENT, MATCH_PARENT, width| 构造器 | 说明 |
|---|---|
LayoutConfig() |
Default constructor used to create a
LayoutConfig instance, with the default width and height being
ComponentContainer.LayoutConfig#MATCH_CONTENT. |
LayoutConfig(int width,
int height) |
A constructor used to create a
LayoutConfig instance with the specified width and height. |
LayoutConfig(ComponentContainer.LayoutConfig source) |
A constructor used to create a
LayoutConfig instance, using the parameters of the parent layout. |
LayoutConfig(MagicLayout.LayoutConfig source) |
A constructor used to create a
LayoutConfig instance, using the parameters (including the width,
height, paddings, margins, alignment mode, and line wrapping reference size) of the current
MagicLayout. |
LayoutConfig(Context context,
AttrSet attrSet) |
A constructor used to create a
LayoutConfig instance with the specified application context and
attribute set. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
applyToComponent(Component component) |
|
int |
getHidePriority() |
Obtains the hide priority of a component in the
MagicLayout. |
float |
getLayoutWeight() |
Obtains the weight of a component in the
MagicLayout. |
int |
getMaxScaleHeight() |
Obtains the maximum height of a scaled component in the
MagicLayout. |
int |
getMaxScaleWidth() |
Obtains the maximum width of a scaled component in the
MagicLayout. |
int |
getMinScaleHeight() |
Obtains the minimum height of a scaled component in the
MagicLayout. |
int |
getMinScaleWidth() |
Obtains the minimum width of a scaled component in the
MagicLayout. |
float |
getScaleRatioOfParentHeight() |
Obtains the ratio of the height of a scaled component to the height of its parent
MagicLayout. |
float |
getScaleRatioOfParentWidth() |
Obtains the ratio of the width of a scaled component to the width of its parent
MagicLayout. |
void |
setHidePriority(int hidePriority) |
Sets the hide priority of a component in the
MagicLayout. |
void |
setLayoutWeight(float layoutWeight) |
Sets the weight of a component in the
MagicLayout. |
void |
setMaxScaleHeight(int maxScaleHeight) |
Sets the maximum height of a scaled component in the
MagicLayout. |
void |
setMaxScaleWidth(int maxScaleWidth) |
Sets the maximum width of a scaled component in the
MagicLayout. |
void |
setMinScaleHeight(int minScaleHeight) |
Sets the minimum height of a scaled component in the
MagicLayout. |
void |
setMinScaleWidth(int minScaleWidth) |
Sets the minimum width of a scaled component in the
MagicLayout. |
void |
setScaleRatioOfParentHeight(float heightRatio) |
Sets the ratio of the height of a scaled component to the height of its parent
MagicLayout. |
void |
setScaleRatioOfParentWidth(float widthRatio) |
Sets the ratio of the width of a scaled component to the width of its parent
MagicLayout. |
clone, getHorizontalEndMargin, getHorizontalStartMargin, getLayoutDirection, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, isMarginsRelative, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginsLeftAndRight, setMarginsRelative, setMarginsTopAndBottom, setMarginToppublic static final int UNSPECIFIED_HIDE_PRIORITY
public static final int UNSPECIFIED_REFERENCE_SIZE
public int referenceSize
public LayoutConfig()
LayoutConfig instance, with the default width and height being
ComponentContainer.LayoutConfig#MATCH_CONTENT.public LayoutConfig(Context context, AttrSet attrSet)
LayoutConfig instance with the specified application context and
attribute set.context - Indicates the application context.attrSet - Indicates the attribute set to use.public LayoutConfig(int width,
int height)
LayoutConfig instance with the specified width and height.width - Indicates the width to set.height - Indicates the height to set.public LayoutConfig(ComponentContainer.LayoutConfig source)
LayoutConfig instance, using the parameters of the parent layout.
Default values for the paddings, margins, alignment mode, and line wrapping reference size (represented
by referenceSize) are used.
source - Indicates the parameters of the parent layout.public LayoutConfig(MagicLayout.LayoutConfig source)
LayoutConfig instance, using the parameters (including the width,
height, paddings, margins, alignment mode, and line wrapping reference size) of the current
MagicLayout.source - Indicates the parameters of the current MagicLayout.public float getScaleRatioOfParentWidth()
MagicLayout.public void setScaleRatioOfParentWidth(float widthRatio)
MagicLayout.widthRatio - Indicates the width ratio, within the range [0.0, 1.0].public float getScaleRatioOfParentHeight()
MagicLayout.public void setScaleRatioOfParentHeight(float heightRatio)
MagicLayout.heightRatio - Indicates the height ratio, within the range [0.0, 1.0].public int getMaxScaleWidth()
MagicLayout.public void setMaxScaleWidth(int maxScaleWidth)
MagicLayout.maxScaleWidth - Indicates the maximum width of a scaled component.public int getMinScaleWidth()
MagicLayout.public void setMinScaleWidth(int minScaleWidth)
MagicLayout.minScaleWidth - Indicates the minimum width of a scaled component.public int getMaxScaleHeight()
MagicLayout.public void setMaxScaleHeight(int maxScaleHeight)
MagicLayout.maxScaleHeight - Indicates the maximum height of a scaled component.public int getMinScaleHeight()
MagicLayout.public void setMinScaleHeight(int minScaleHeight)
MagicLayout.minScaleHeight - Indicates the minimum height of a scaled component.public void setLayoutWeight(float layoutWeight)
MagicLayout.layoutWeight - Indicates the weight of the component.public float getLayoutWeight()
MagicLayout.public void setHidePriority(int hidePriority)
MagicLayout. A smaller value indicates a higher
priority.hidePriority - Indicates the hide priority of the component.public int getHidePriority()
MagicLayout.public void applyToComponent(Component component)