Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdfe2320 authored by Chet Haase's avatar Chet Haase Committed by android-build-merger
Browse files

Merge "Clarify docs around weak references to animator targets" into nyc-dev

am: 5084bd66

* commit '5084bd66':
  Clarify docs around weak references to animator targets
parents 931eca69 5084bd66
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.animation;

import android.annotation.Nullable;
import android.content.pm.ActivityInfo.Config;
import android.content.res.ConstantState;

@@ -436,10 +437,14 @@ public abstract class Animator implements Cloneable {
     * operate on target objects (for example, {@link ValueAnimator}, but this method
     * is on the superclass for the convenience of dealing generically with those subclasses
     * that do handle targets.
     * <p>
     * <strong>Note:</strong> The target is stored as a weak reference internally to avoid leaking
     * resources by having animators directly reference old targets. Therefore, you should
     * ensure that animator targets always have a hard reference elsewhere.
     *
     * @param target The object being animated
     */
    public void setTarget(Object target) {
    public void setTarget(@Nullable Object target) {
    }

    // Hide reverse() and canReverse() for now since reverse() only work for simple
+0 −6
Original line number Diff line number Diff line
@@ -898,12 +898,6 @@ public final class ObjectAnimator extends ValueAnimator {
        return mTarget == null ? null : mTarget.get();
    }

    /**
     * Sets the target object whose property will be animated by this animation. If the
     * animator has been started, it will be canceled.
     *
     * @param target The object being animated
     */
    @Override
    public void setTarget(@Nullable Object target) {
        final Object oldTarget = getTarget();