public class InlaidElement extends ElementWrapper
element with another element based on a specific distance or proportion from the
content bounds.
This class can be used when Component requires a background that is smaller than the
Component's actual bounds.
Element.ConstantState, Element.OnBoundsChangeListener, Element.OnChangeListener, Element.OnLayoutDirectionChangeListener, Element.OnRankChangeListenerALPHA_DEFAULT, ALPHA_MAX, ALPHA_MIN, DEFAULT_BOUNDS_RECT, MAX_RANK, MIN_RANK| 构造器 | 说明 |
|---|---|
InlaidElement(Element element,
float inlayRatio) |
A constructor used to create an inlaid element with the specified inlay in proportion from
the content bounds for every side.
|
InlaidElement(Element element,
float inlayLeftRatio,
float inlayTopRatio,
float inlayRightRatio,
float inlayBottomRatio) |
A constructor used to create an inlaid element with the specified inlay in proportion from
the content bounds for every side.
|
InlaidElement(Element element,
int inlay) |
A constructor used to create an inlaid element with the specified inlay in pixels.
|
InlaidElement(Element element,
int inlayLeft,
int inlayTop,
int inlayRight,
int inlayBottom) |
A constructor used to create an inlaid element with the specified inlay in pixels for every
side.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
setInlay(float inlayRatio) |
Sets an inlay in proportion from the content bounds for this
InlaidElement instance. |
void |
setInlay(float inlayLeftRatio,
float inlayTopRatio,
float inlayRightRatio,
float inlayBottomRatio) |
Sets an inlay in proportion from the content bounds for every side of this
InlaidElement instance. |
void |
setInlay(int inlay) |
Sets an inlay for this
InlaidElement instance. |
void |
setInlay(int inlayLeft,
int inlayTop,
int inlayRight,
int inlayBottom) |
Sets an inlay in pixels for every side of this
InlaidElement instance. |
clearColorMatrix, drawToCanvas, getAlpha, getBounds, getCallback, getColorMatrix, getCurrentElement, getHeight, getLayoutDirection, getMinHeight, getMinWidth, getPadding, getRank, getStateColorMode, getVisible, getWidth, isInheritDirection, isStateful, isVisible, release, setAlpha, setBounds, setBounds, setCallback, setColorMatrix, setInheritDirection, setLayoutDirection, setOnBoundsChangeListener, setOnLayoutDirectionChangeListener, setOnRankChangeListener, setRank, setStateColor, setStateColorList, setStateColorMode, setVisible, skipAnimationgetElement, setElementpublic InlaidElement(Element element, int inlay)
element - Indicates the element with which the new element will be inlaid.inlay - Indicates the inlay around the element, in pixels. The value must be greater than or equal to
0.public InlaidElement(Element element, int inlayLeft, int inlayTop, int inlayRight, int inlayBottom)
element - Indicates the element with which the new element will be inlaid.inlayLeft - Indicates the left inlay in pixels. The value must be greater than or equal to 0.inlayTop - Indicates the top inlay in pixels. The value must be greater than or equal to 0.inlayRight - Indicates the right inlay in pixels. The value must be greater than or equal to 0.inlayBottom - Indicates the bottom inlay in pixels. The value must be greater than or equal to 0.public InlaidElement(Element element, float inlayRatio)
element - Indicates the element object to inlayinlayRatio - Indicates the inlay value in proportion from the content bounds. Valid range: [0, 1)public InlaidElement(Element element, float inlayLeftRatio, float inlayTopRatio, float inlayRightRatio, float inlayBottomRatio)
element - Indicates the element with which the new element will be inlaid.inlayLeftRatio - Indicates the left inlay value in proportion from the content width. Valid range: [0,1)inlayTopRatio - Indicates the top inlay value in proportion from the content width. Valid range: [0,1)inlayRightRatio - Indicates the right inlay value in proportion from the content width. Valid range: [0,1)inlayBottomRatio - Indicates the bottom inlay value in proportion from the content width. Valid range: [0,1)public void setInlay(int inlay)
InlaidElement instance.inlay - Indicates the inlay around the element, in pixels. The value must be greater than or equal to
0.public void setInlay(int inlayLeft,
int inlayTop,
int inlayRight,
int inlayBottom)
InlaidElement instance.inlayLeft - Indicates the left inlay in pixels. The value must be greater than or equal to 0.inlayTop - Indicates the top inlay in pixels. The value must be greater than or equal to 0.inlayRight - Indicates the right inlay in pixels. The value must be greater than or equal to 0.inlayBottom - Indicates the bottom inlay in pixels. The value must be greater than or equal to 0.public void setInlay(float inlayRatio)
InlaidElement instance.inlay - Indicates the inlay value in proportion from the content bounds. Valid range: [0, 1)public void setInlay(float inlayLeftRatio,
float inlayTopRatio,
float inlayRightRatio,
float inlayBottomRatio)
InlaidElement instance.inlayLeft - Indicates the left inlay value in proportion from the content width. Valid range: [0, 1)inlayTop - Indicates the top inlay value in proportion from the content width. Valid range: [0, 1)inlayRight - Indicates the right inlay value in proportion from the content width. Valid range: [0, 1)inlayBottom - Indicates the bottom inlay value in proportion from the content width. Valid range: [0, 1)