public class ComponentTransition extends Object
ComponentContainer object.
To perform layout transition on a layout container, create a ComponentTransition object, and then set
a ComponentContainer object using ComponentContainer#setComponentTransition.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
CHANGING |
Indicates the animation running on components changed by layout modification, instead of by adding or removing
a component to or from the layout container.
|
static int |
OTHERS_GONE |
Indicates the animation running on components that are changed because one of their associated components
disappears from the
ComponentContainer. |
static int |
OTHERS_SHOW |
Indicates the animation running on components that are changed because one of their associated components
appears in the
ComponentContainer. |
static int |
SELF_GONE |
Indicates the animation running on a component when it disappears from the
ComponentContainer. |
static int |
SELF_SHOW |
Indicates the animation running on a component when it appears in the
ComponentContainer. |
| 构造器 | 说明 |
|---|---|
ComponentTransition() |
Default constructor used to create a
ComponentTransition instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addTransitionType(int type) |
Enables a transition type for a
ComponentTransition object. |
AnimatorProperty |
getAnimatorProperty(int type) |
Obtains the component property animator of the specified transition type.
|
boolean |
hasTransitionType(int type) |
Checks whether a specified transition type is enabled for a
ComponentTransition object. |
void |
release() |
Releases a
ComponentTransition object. |
void |
removeTransitionType(int type) |
Removes a transition type from a
ComponentTransition object. |
void |
setAnimatorProperty(int type,
AnimatorProperty animator) |
Sets a customizable component property animator of the specified transition type.
|
void |
setTransitionTypeDuration(int type,
int duration) |
Sets the duration for the animation of a specified transition type.
|
public static final int CHANGING
By default, this transition type is disabled. You can invoke addTransitionType(int) to enable it.
public static final int OTHERS_GONE
ComponentContainer.public static final int OTHERS_SHOW
ComponentContainer.public static final int SELF_GONE
ComponentContainer.public static final int SELF_SHOW
ComponentContainer.public ComponentTransition()
ComponentTransition instance.public void release()
ComponentTransition object.public void addTransitionType(int type)
ComponentTransition object.
Transition types include SELF_SHOW, OTHERS_SHOW, OTHERS_GONE,
SELF_GONE, and CHANGING.
type - Indicates the transition type to enable.public void removeTransitionType(int type)
ComponentTransition object.
By default, all transition types except CHANGING are enabled.
type - Indicates the transition type to remove.public boolean hasTransitionType(int type)
ComponentTransition object.type - Indicates the specified transition type.true if the specified transition type is added; returns false otherwise.public void setTransitionTypeDuration(int type,
int duration)
type - Indicates the specified transition type, which can be SELF_SHOW,
OTHERS_SHOW, OTHERS_GONE, SELF_GONE, or CHANGING.duration - Indicates the duration of the transition animation, in milliseconds.public void setAnimatorProperty(int type,
AnimatorProperty animator)
type - Indicates the specified transition type, which can be SELF_SHOW,
OTHERS_SHOW, OTHERS_GONE, SELF_GONE, or CHANGING.animator - Indicates the component property animator.public AnimatorProperty getAnimatorProperty(int type)
type - Indicates the specified transition type, which can be SELF_SHOW,
OTHERS_SHOW, OTHERS_GONE, SELF_GONE, or CHANGING.AnimatorProperty object of the specified transition type;
returns null otherwise.