public class FadeAndShortSlide extends Visibility
Transition.AnimationInfo, Transition.EpicenterCallback, Transition.TransitionListener, Transition.TransitionListenerAdapter
MODE_IN, MODE_OUT
MATCH_ID, MATCH_INSTANCE, MATCH_ITEM_ID, MATCH_NAME
Constructor and Description |
---|
FadeAndShortSlide() |
FadeAndShortSlide(Context context,
AttributeSet attrs) |
FadeAndShortSlide(int slideEdge) |
Modifier and Type | Method and Description |
---|---|
Transition |
addListener(Transition.TransitionListener listener)
Adds a listener to the set of listeners that are sent events through the
life of an animation, such as start, repeat, and end.
|
void |
captureEndValues(TransitionValues transitionValues)
Captures the values in the end scene for the properties that this
transition monitors.
|
void |
captureStartValues(TransitionValues transitionValues)
Captures the values in the start scene for the properties that this
transition monitors.
|
Transition |
clone()
Creates and returns a copy of this object.
|
float |
getDistance()
Returns distance to slide.
|
Animator |
onAppear(ViewGroup sceneRoot,
View view,
TransitionValues startValues,
TransitionValues endValues)
The default implementation of this method returns a null Animator.
|
Animator |
onDisappear(ViewGroup sceneRoot,
View view,
TransitionValues startValues,
TransitionValues endValues)
The default implementation of this method returns a null Animator.
|
Transition |
removeListener(Transition.TransitionListener listener)
Removes a listener from the set listening to this animation.
|
void |
setDistance(float distance)
Set distance to slide, default value is -1.
|
void |
setEpicenterCallback(Transition.EpicenterCallback epicenterCallback)
Sets the callback to use to find the epicenter of a Transition.
|
void |
setSlideEdge(int slideEdge) |
createAnimator, getMode, getTransitionProperties, isTransitionRequired, isVisible, onAppear, onDisappear, setMode, setSuppressLayout
addTarget, addTarget, addTarget, addTarget, animate, cancel, canRemoveViews, createAnimators, end, excludeChildren, excludeChildren, excludeChildren, excludeTarget, excludeTarget, excludeTarget, excludeTarget, getDuration, getEpicenter, getEpicenterCallback, getInterpolator, getName, getNameOverrides, getPathMotion, getPropagation, getStartDelay, getTargetIds, getTargetNames, getTargets, getTargetTypes, getTargetViewNames, getTransitionValues, pause, removeTarget, removeTarget, removeTarget, removeTarget, resume, runAnimators, setDuration, setInterpolator, setMatchOrder, setNameOverrides, setPathMotion, setPropagation, setStartDelay, start, toString
public FadeAndShortSlide()
public FadeAndShortSlide(int slideEdge)
public FadeAndShortSlide(Context context, AttributeSet attrs)
public void setEpicenterCallback(Transition.EpicenterCallback epicenterCallback)
Transition
Explode
use a point or Rect to orient
the direction of travel. This is called the epicenter of the Transition and is
typically centered on a touched View. The
Transition.EpicenterCallback
allows a Transition to
dynamically retrieve the epicenter during a Transition.setEpicenterCallback
in class Transition
epicenterCallback
- The callback to use to find the epicenter of the Transition.public void captureStartValues(TransitionValues transitionValues)
Transition
Transition.createAnimator(ViewGroup, TransitionValues, TransitionValues)
.
The main concern for an implementation is what the
properties are that the transition cares about and what the values are
for all of those properties. The start and end values will be compared
later during the
Transition.createAnimator(android.view.ViewGroup, TransitionValues, TransitionValues)
method to determine what, if any, animations, should be run.
Subclasses must implement this method. The method should only be called by the transition system; it is not intended to be called from external classes.
captureStartValues
in class Visibility
transitionValues
- The holder for any values that the Transition
wishes to store. Values are stored in the values
field
of this TransitionValues object and are keyed from
a String value. For example, to store a view's rotation value,
a transition might call
transitionValues.values.put("appname:transitionname:rotation",
view.getRotation())
. The target view will already be stored in
the transitionValues structure when this method is called.Transition.captureEndValues(TransitionValues)
,
Transition.createAnimator(ViewGroup, TransitionValues, TransitionValues)
public void captureEndValues(TransitionValues transitionValues)
Transition
Transition.createAnimator(ViewGroup, TransitionValues, TransitionValues)
.
The main concern for an implementation is what the
properties are that the transition cares about and what the values are
for all of those properties. The start and end values will be compared
later during the
Transition.createAnimator(android.view.ViewGroup, TransitionValues, TransitionValues)
method to determine what, if any, animations, should be run.
Subclasses must implement this method. The method should only be called by the transition system; it is not intended to be called from external classes.
captureEndValues
in class Visibility
transitionValues
- The holder for any values that the Transition
wishes to store. Values are stored in the values
field
of this TransitionValues object and are keyed from
a String value. For example, to store a view's rotation value,
a transition might call
transitionValues.values.put("appname:transitionname:rotation",
view.getRotation())
. The target view will already be stored in
the transitionValues structure when this method is called.Transition.captureStartValues(TransitionValues)
,
Transition.createAnimator(ViewGroup, TransitionValues, TransitionValues)
public void setSlideEdge(int slideEdge)
public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)
Visibility
Visibility.onAppear(ViewGroup, TransitionValues, int, TransitionValues, int)
.onAppear
in class Visibility
sceneRoot
- The root of the transition hierarchyview
- The View to make appear. This will be in the target scene's View hierarchy and
will be VISIBLE.startValues
- The target values in the start sceneendValues
- The target values in the end scenepublic Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)
Visibility
Visibility.onDisappear(ViewGroup, TransitionValues, int, TransitionValues, int)
.onDisappear
in class Visibility
sceneRoot
- The root of the transition hierarchyview
- The View to make disappear. This will be in the target scene's View
hierarchy or in an ViewGroupOverlay
and will be
VISIBLE.startValues
- The target values in the start sceneendValues
- The target values in the end scenepublic Transition addListener(Transition.TransitionListener listener)
Transition
addListener
in class Transition
listener
- the listener to be added to the current set of listeners
for this animation.public Transition removeListener(Transition.TransitionListener listener)
Transition
removeListener
in class Transition
listener
- the listener to be removed from the current set of
listeners for this transition.public float getDistance()
public void setDistance(float distance)
distance
- Pixels to slide.public Transition clone()
Object
x
, the expression:
will be true, and that the expression:x.clone() != x
will bex.clone().getClass() == x.getClass()
true
, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x)
true
, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
super.clone
. If a class and all of its superclasses (except
Object
) obey this convention, it will be the case that
x.clone().getClass() == x.getClass()
.
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by super.clone
before returning it. Typically, this means
copying any mutable objects that comprise the internal "deep structure"
of the object being cloned and replacing the references to these
objects with references to the copies. If a class contains only
primitive fields or references to immutable objects, then it is usually
the case that no fields in the object returned by super.clone
need to be modified.
The method clone
for class Object
performs a
specific cloning operation. First, if the class of this object does
not implement the interface Cloneable
, then a
CloneNotSupportedException
is thrown. Note that all arrays
are considered to implement the interface Cloneable
and that
the return type of the clone
method of an array type T[]
is T[]
where T is any reference or primitive type.
Otherwise, this method creates a new instance of the class of this
object and initializes all its fields with exactly the contents of
the corresponding fields of this object, as if by assignment; the
contents of the fields are not themselves cloned. Thus, this method
performs a "shallow copy" of this object, not a "deep copy" operation.
The class Object
does not itself implement the interface
Cloneable
, so calling the clone
method on an object
whose class is Object
will result in throwing an
exception at run time.
clone
in class Transition
Cloneable