public class AnimatedStateElement extends StateElement
Element object that can be changed based on the component state.
An ElementContainer can contain multiple Element objects, but only one of them is valid.
The validity is implemented by ComponentState.
Element.ConstantState, Element.OnBoundsChangeListener, Element.OnChangeListener, Element.OnLayoutDirectionChangeListener, Element.OnRankChangeListenerElementContainer.ElementStateALPHA_DEFAULT, ALPHA_MAX, ALPHA_MIN, DEFAULT_BOUNDS_RECT, MAX_RANK, MIN_RANK| 构造器 | 说明 |
|---|---|
AnimatedStateElement() |
Default constructor used to create a
AnimatedStateElement object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addStateTransition(int[] fromStateSet,
int[] toStateSet,
Element element) |
Adds a pair of state set and
Element object to a container. |
Element |
getCurrentElement() |
Obtains the
Element object in use. |
Element |
getStateElement(int index) |
Finds a
Element object based on a specified index. |
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, setVisibleaddChildElement, getChildElement, getChildElementCount, getElementState, getEnterFadeDuration, getExitFadeDuration, getFadeInEffectPeriod, getFadeOutEffectPeriod, isStateful, selectElement, setElementState, setEnterFadeDuration, setExitFadeDuration, skipAnimationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddState, findStateElementIndex, getStateCount, getStateSetpublic AnimatedStateElement()
AnimatedStateElement object.public Element getCurrentElement()
Element object in use.getCurrentElement 在类中 StateElementElement object in use in normal cases; returns the child Element object in
use if an ElementContainer is used.public void addStateTransition(int[] fromStateSet,
int[] toStateSet,
Element element)
Element object to a container.
The state set and Element object always appear in pairs.
fromStateSet - Indicates the state set that specifies the start of the transition. It is represented by
an array. A negative number in this array indicates a non-matching state.
An empty array or the value 0 indicates a matched state.In general, the values
of this array are obtained from ComponentState.toStateSet - Indicates the state set that specifies the end of the transition. It is represented by
an array. A negative number indicates a non-matching state. An empty array or the
value 0 indicates a matched state. In general, the values of this array are obtained
from ComponentState.element - Indicates the Element object to display in the specified state set.
Only an Element object that does not change with the state can be added.public Element getStateElement(int index)
Element object based on a specified index.getStateElement 在类中 StateElementindex - Indicates an index.Element object.