Share via


Transition.AddTarget Method

Definition

Overloads

AddTarget(View)

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

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.

[Android.Runtime.Register("addTarget", "(Landroid/view/View;)Landroid/transition/Transition;", "GetAddTarget_Landroid_view_View_Handler")]
public virtual Android.Transitions.Transition? AddTarget (Android.Views.View? target);
[<Android.Runtime.Register("addTarget", "(Landroid/view/View;)Landroid/transition/Transition;", "GetAddTarget_Landroid_view_View_Handler")>]
abstract member AddTarget : Android.Views.View -> Android.Transitions.Transition
override this.AddTarget : Android.Views.View -> Android.Transitions.Transition

Parameters

target
View

A View on which the Transition will act, must be non-null.

Returns

The Transition to which the target is added. Returning the same object makes it easier to chain calls during construction, such as transitionSet.addTransitions(new Fade()).addTarget(someView);

Attributes

Remarks

Sets the target view instances that this Transition is interested in animating. By default, there are no targets, and a Transition will listen for changes on every view in the hierarchy below the sceneRoot of the Scene being transitioned into. Setting targets constrains the Transition to only listen for, and act on, these views. All other views will be ignored.

The target list is like the #addTarget(int) targetId list except this list specifies the actual View instances, not the ids of the views. This is an important distinction when scene changes involve view hierarchies which have been inflated separately; different views may share the same id but not actually be the same instance. If the transition should treat those views as the same, then #addTarget(int) should be used instead of #addTarget(View). If, on the other hand, scene changes involve changes all within the same view hierarchy, among views which do not necessarily have ids set on them, then the target list of views may be more convenient.

Java documentation for android.transition.Transition.addTarget(android.view.View).

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.

See also

Applies to

AddTarget(Class)

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

[Android.Runtime.Register("addTarget", "(Ljava/lang/Class;)Landroid/transition/Transition;", "GetAddTarget_Ljava_lang_Class_Handler")]
public virtual Android.Transitions.Transition? AddTarget (Java.Lang.Class? targetType);
[<Android.Runtime.Register("addTarget", "(Ljava/lang/Class;)Landroid/transition/Transition;", "GetAddTarget_Ljava_lang_Class_Handler")>]
abstract member AddTarget : Java.Lang.Class -> Android.Transitions.Transition
override this.AddTarget : Java.Lang.Class -> Android.Transitions.Transition

Parameters

targetType
Class

The type to include when running this transition.

Returns

The Transition to which the target class was added. Returning the same object makes it easier to chain calls during construction, such as transitionSet.addTransitions(new Fade()).addTarget(ImageView.class);

Attributes

Remarks

Adds the Class of a target view that this Transition is interested in animating. By default, there are no targetTypes, and a Transition will listen for changes on every view in the hierarchy below the sceneRoot of the Scene being transitioned into. Setting targetTypes constrains the Transition to only listen for, and act on, views with these classes. Views with different classes will be ignored.

Note that any View that can be cast to targetType will be included, so if targetType is View.class, all Views will be included.

Java documentation for android.transition.Transition.addTarget(java.lang.Class).

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.

See also

  • AddTarget(Int32)
  • AddTarget(View)
  • <xref:Android.Transitions.Transition.ExcludeTarget(Java.Lang.Class%2c+System.Boolean)>
  • <xref:Android.Transitions.Transition.ExcludeChildren(Java.Lang.Class%2c+System.Boolean)>

Applies to

AddTarget(Int32)

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

[Android.Runtime.Register("addTarget", "(I)Landroid/transition/Transition;", "GetAddTarget_IHandler")]
public virtual Android.Transitions.Transition? AddTarget (int targetId);
[<Android.Runtime.Register("addTarget", "(I)Landroid/transition/Transition;", "GetAddTarget_IHandler")>]
abstract member AddTarget : int -> Android.Transitions.Transition
override this.AddTarget : int -> Android.Transitions.Transition

Parameters

targetId
Int32

The id of a target view, must be a positive number.

Returns

The Transition to which the targetId is added. Returning the same object makes it easier to chain calls during construction, such as transitionSet.addTransitions(new Fade()).addTarget(someId);

Attributes

Remarks

Adds the id of a target view that this Transition is interested in animating. By default, there are no targetIds, and a Transition will listen for changes on every view in the hierarchy below the sceneRoot of the Scene being transitioned into. Setting targetIds constrains the Transition to only listen for, and act on, views with these IDs. Views with different IDs, or no IDs whatsoever, will be ignored.

Note that using ids to specify targets implies that ids should be unique within the view hierarchy underneath the scene root.

Java documentation for android.transition.Transition.addTarget(int).

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.

See also

Applies to

AddTarget(String)

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

[Android.Runtime.Register("addTarget", "(Ljava/lang/String;)Landroid/transition/Transition;", "GetAddTarget_Ljava_lang_String_Handler")]
public virtual Android.Transitions.Transition? AddTarget (string? targetName);
[<Android.Runtime.Register("addTarget", "(Ljava/lang/String;)Landroid/transition/Transition;", "GetAddTarget_Ljava_lang_String_Handler")>]
abstract member AddTarget : string -> Android.Transitions.Transition
override this.AddTarget : string -> Android.Transitions.Transition

Parameters

targetName
String

The transitionName of a target view, must be non-null.

Returns

The Transition to which the target transitionName is added. Returning the same object makes it easier to chain calls during construction, such as transitionSet.addTransitions(new Fade()).addTarget(someName);

Attributes

Remarks

Adds the transitionName of a target view that this Transition is interested in animating. By default, there are no targetNames, and a Transition will listen for changes on every view in the hierarchy below the sceneRoot of the Scene being transitioned into. Setting targetNames constrains the Transition to only listen for, and act on, views with these transitionNames. Views with different transitionNames, or no transitionName whatsoever, will be ignored.

Note that transitionNames should be unique within the view hierarchy.

Java documentation for android.transition.Transition.addTarget(java.lang.String).

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.

See also

Applies to