FrameAnimationElement, StateElementpublic class ElementContainer extends Element
Element that contains multiple Element objects.
Only one Element object in the ElementContainer is valid.
You can subclass this class to create an ElementContainer or directly use one of its child classes.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
ElementContainer.ElementState |
已过时。
Please use
ElementContainer.addChildElement, ElementContainer.getChildElement,
ElementContainer.getChildElementCount |
Element.ConstantState, Element.OnBoundsChangeListener, Element.OnChangeListener, Element.OnLayoutDirectionChangeListener, Element.OnRankChangeListenerALPHA_DEFAULT, ALPHA_MAX, ALPHA_MIN, DEFAULT_BOUNDS_RECT, MAX_RANK, MIN_RANK| 构造器 | 说明 |
|---|---|
ElementContainer() |
Default constructor used to create an
ElementContainer instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
addChildElement(Element element) |
Adds an element object to the end of the list of element objects in an element container.
|
Element |
getChildElement(int index) |
Obtains an element object from a container based on the element object index.
|
int |
getChildElementCount() |
Obtains the number of element objects in a container.
|
Element |
getCurrentElement() |
Obtains the
Element object in use. |
ElementContainer.ElementState |
getElementState() |
已过时。
ElementState is not used anymore.
|
int |
getEnterFadeDuration() |
Gets the fade-in duration.
|
int |
getExitFadeDuration() |
Gets the fade-out duration.
|
int |
getFadeInEffectPeriod() |
已过时。
This change is effective since API version 7.
Please use
getEnterFadeDuration() |
int |
getFadeOutEffectPeriod() |
已过时。
This change is effective since API version 7.
Please use
getExitFadeDuration() |
boolean |
isStateful() |
Checks whether the state of an
Element object is changed based on the component state. |
boolean |
selectElement(int index) |
Selects an
Element object to display according to a specified index. |
void |
setElementState(ElementContainer.ElementState state) |
已过时。
ElementState is not used anymore.
|
void |
setEnterFadeDuration(int ms) |
Sets the fade-in duration for an
Element object. |
void |
setExitFadeDuration(int ms) |
Sets the fade-out duration for an
Element object. |
void |
skipAnimation() |
Skips the animation of this
Element object. |
clearColorMatrix, drawToCanvas, getAlpha, getBounds, getCallback, getColorMatrix, getHeight, getLayoutDirection, getMinHeight, getMinWidth, getPadding, getRank, getStateColorMode, getVisible, getWidth, isInheritDirection, isVisible, release, setAlpha, setBounds, setBounds, setCallback, setColorMatrix, setInheritDirection, setLayoutDirection, setOnBoundsChangeListener, setOnLayoutDirectionChangeListener, setOnRankChangeListener, setRank, setStateColor, setStateColorList, setStateColorMode, setVisiblepublic ElementContainer()
ElementContainer instance.public void setEnterFadeDuration(int ms)
Element object.ms - Indicates the fade-in duration, in milliseconds.public void setExitFadeDuration(int ms)
Element object.ms - Indicates the fade-out duration, in milliseconds.@Deprecated public int getFadeInEffectPeriod()
getEnterFadeDuration()public int getEnterFadeDuration()
@Deprecated public int getFadeOutEffectPeriod()
getExitFadeDuration()public int getExitFadeDuration()
public boolean isStateful()
Element object is changed based on the component state.isStateful 在类中 Elementtrue if the Element object state is changed; returns false otherwise.public boolean selectElement(int index)
Element object to display according to a specified index.
If the index does not have a matching Element object, the index is changed to -1,
and Element is set to null.
index - Indicates the index of the selected element object to display.true if another element object is selected; returns false if the same
element object is selected.public Element getCurrentElement()
Element object in use.getCurrentElement 在类中 ElementElement object in use in normal cases; returns the child Element object in
use if an ElementContainer is used.public void skipAnimation()
ElementElement object.skipAnimation 在类中 Element@Deprecated public ElementContainer.ElementState getElementState()
ElementContainer.ElementState instance, which holds
shared states of an Element object.ElementContainerState instance associated with the Element object.@Deprecated public void setElementState(ElementContainer.ElementState state)
ElementContainer.ElementState for an ElementContainer.state - Indicates the ElementContainerState to set.public final int addChildElement(Element element)
element - Indicates the element object to add.public final Element getChildElement(int index)
index - Indicates the index of the element object to obtain. Should be in range from 0 till
value returned by getChildElementCount().public final int getChildElementCount()