public static class Component.EstimateSpec extends Object
A EstimateSpec encapsulates the arrangement requirements that a child component inherits from the
parent. Each EstimateSpec indicates the requirement for either the width or height as well as a mode.
There are three possible modes for EstimateSpec: UNCONSTRAINT, PRECISE, and
NOT_EXCEED.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
ESTIMATED_STATE_BIT_MASK |
Bits of state for estimated size
|
static int |
NOT_EXCEED |
In this mode, the maximum size has been specified for the child.
|
static int |
PRECISE |
In this mode, the parent has determined the exact size of the child.
|
static int |
UNCONSTRAINT |
In this mode, the parent has no constraint on the child, meaning that the child can be whatever size it
wants.
|
| 构造器 | 说明 |
|---|---|
EstimateSpec() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static int |
getChildSizeWithMode(int size,
int estimatedConfig,
int childEstimatedConfig) |
Creates a measure specification for the child component based on the specified size and mode.
|
static int |
getMode(int estimateSpec) |
Obtains the showing mode of this component.
|
static int |
getSize(int estimateSpec) |
Extracts the size from the provided estimate specification.
|
static int |
getSizeWithMode(int size,
int mode) |
Creates a measure specification based on the specified size and mode.
|
public static final int ESTIMATED_STATE_BIT_MASK
public static final int NOT_EXCEED
public static final int PRECISE
public static final int UNCONSTRAINT
public static int getSizeWithMode(int size,
int mode)
size - Indicates the width or height contained in the measure specification.mode - Indicates the mode contained in the measure specification. The value must be
UNCONSTRAINT, PRECISE, or NOT_EXCEED.public static int getMode(int estimateSpec)
estimateSpec - Indicates the estimate specification.public static int getSize(int estimateSpec)
estimateSpec - Indicates the measure specification.public static int getChildSizeWithMode(int size,
int estimatedConfig,
int childEstimatedConfig)
size - Indicates how big the child component wants to be.estimatedConfig - Indicates the mode of the parent.childEstimatedConfig - Indicates the mode of the child component.