Udostępnij za pośrednictwem


Transition Class

Definition

A Transition holds information about animations that will be run on its targets during a scene change.

[Android.Runtime.Register("android/transition/Transition", DoNotGenerateAcw=true)]
public abstract class Transition : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.ICloneable
[<Android.Runtime.Register("android/transition/Transition", DoNotGenerateAcw=true)>]
type Transition = class
    inherit Object
    interface ICloneable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Transition
Derived
Attributes
Implements

Remarks

A Transition holds information about animations that will be run on its targets during a scene change. Subclasses of this abstract class may choreograph several child transitions (TransitionSet or they may perform custom animations themselves. Any Transition has two main jobs: (1) capture property values, and (2) play animations based on changes to captured property values. A custom transition knows what property values on View objects are of interest to it, and also knows how to animate changes to those values. For example, the Fade transition tracks changes to visibility-related properties and is able to construct and run animations that fade items in or out based on changes to those properties.

Note: Transitions may not work correctly with either SurfaceView or TextureView, due to the way that these views are displayed on the screen. For SurfaceView, the problem is that the view is updated from a non-UI thread, so changes to the view due to transitions (such as moving and resizing the view) may be out of sync with the display inside those bounds. TextureView is more compatible with transitions in general, but some specific transitions (such as Fade) may not be compatible with TextureView because they rely on ViewOverlay functionality, which does not currently work with TextureView.

Transitions can be declared in XML resource files inside the res/transition directory. Transition resources consist of a tag name for one of the Transition subclasses along with attributes to define some of the attributes of that transition. For example, here is a minimal resource file that declares a ChangeBounds transition:

{

Java documentation for android.transition.Transition.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Transition()

Constructs a Transition object with no target objects.

Transition(Context, IAttributeSet)

Perform inflation from XML and apply a class-specific base style from a theme attribute or style resource.

Transition(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

MatchId
Obsolete.

With #setMatchOrder(int...), chooses to match by android.view.View#getId().

MatchInstance
Obsolete.

With #setMatchOrder(int...), chooses to match by View instance.

MatchItemId
Obsolete.

With #setMatchOrder(int...), chooses to match by the android.widget.Adapter item id.

MatchName
Obsolete.

With #setMatchOrder(int...), chooses to match by android.view.View#getTransitionName().

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Duration

Returns the duration set on this transition.

Epicenter

Returns the epicenter as specified by the android.transition.Transition.EpicenterCallback or null if no callback exists.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Interpolator

Returns the interpolator set on this transition.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Name

Returns the name of this Transition.

PathMotion

Returns the algorithm object used to interpolate along two dimensions. -or- Sets the algorithm used to calculate two-dimensional interpolation.

PeerReference (Inherited from Object)
Propagation

Returns the android.transition.TransitionPropagation used to calculate Animator start delays. -or- Sets the method for determining Animator start delays.

StartDelay

Returns the startDelay set on this transition.

TargetIds

Returns the list of target IDs that this transition limits itself to tracking and animating.

TargetNames

Returns the list of target transitionNames that this transition limits itself to tracking and animating.

Targets

Returns the list of target views that this transition limits itself to tracking and animating.

TargetTypes

Returns the list of target transitionNames that this transition limits itself to tracking and animating.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AddListener(Transition+ITransitionListener)

Adds a listener to the set of listeners that are sent events through the life of an animation, such as start, repeat, and end.

AddTarget(Class)

Adds the Class of a target view that this Transition is interested in animating.

AddTarget(Int32)

Adds the id of a target view that this Transition is interested in animating.

AddTarget(String)

Adds the transitionName of a target view that this Transition is interested in animating.

AddTarget(View)

Sets the target view instances that this Transition is interested in animating.

CanRemoveViews()
CaptureEndValues(TransitionValues)

Captures the values in the end scene for the properties that this transition monitors.

CaptureStartValues(TransitionValues)

Captures the values in the start scene for the properties that this transition monitors.

Clone()

Creates and returns a copy of this Object.

CreateAnimator(ViewGroup, TransitionValues, TransitionValues)

This method creates an animation that will be run for this transition given the information in the startValues and endValues structures captured earlier for the start and end scenes.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
ExcludeChildren(Class, Boolean)

Whether to add the given type to the list of types whose children should be excluded from this transition.

ExcludeChildren(Int32, Boolean)

Whether to add the children of the given id to the list of targets to exclude from this transition.

ExcludeChildren(View, Boolean)

Whether to add the children of given target to the list of target children to exclude from this transition.

ExcludeTarget(Class, Boolean)

Whether to add the given type to the list of types to exclude from this transition.

ExcludeTarget(Int32, Boolean)

Whether to add the given id to the list of target ids to exclude from this transition.

ExcludeTarget(String, Boolean)

Whether to add the given transitionName to the list of target transitionNames to exclude from this transition.

ExcludeTarget(View, Boolean)

Whether to add the given target to the list of targets to exclude from this transition.

GetEpicenterCallback()

Returns the callback used to find the epicenter of the Transition.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetTransitionProperties()

Returns the set of property names used stored in the TransitionValues object passed into #captureStartValues(TransitionValues) that this transition cares about for the purposes of canceling overlapping animations.

GetTransitionValues(View, Boolean)

This method can be called by transitions to get the TransitionValues for any particular view during the transition-playing process.

IsTransitionRequired(TransitionValues, TransitionValues)

Returns whether or not the transition should create an Animator, based on the values captured during #captureStartValues(TransitionValues) and #captureEndValues(TransitionValues).

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
RemoveListener(Transition+ITransitionListener)

Removes a listener from the set listening to this animation.

RemoveTarget(Class)

Removes the given target from the list of targets that this Transition is interested in animating.

RemoveTarget(Int32)

Removes the given targetId from the list of ids that this Transition is interested in animating.

RemoveTarget(String)

Removes the given targetName from the list of transitionNames that this Transition is interested in animating.

RemoveTarget(View)

Removes the given target from the list of targets that this Transition is interested in animating.

SetDuration(Int64)

Sets the duration of this transition.

SetEpicenterCallback(Transition+EpicenterCallback)

Sets the callback to use to find the epicenter of a Transition.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetInterpolator(ITimeInterpolator)

Sets the interpolator of this transition.

SetMatchOrder(Int32[])

Sets the order in which Transition matches View start and end values.

SetStartDelay(Int64)

Sets the startDelay of this transition.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to