Remove legacy AnimationManagerModule

Summary: This code was shipped as part of the initial open-source release but was never used.

Reviewed By: sahrens

Differential Revision: D14649389

fbshipit-source-id: 0c068ca69b91d275008f4a7af77a23a4f1470c18
This commit is contained in:
Pieter De Baets authored and Facebook Github Bot committed 2019-04-03 04:42:14 -07:00
1 parent d9711e2693
commit a333c2b202
23 files changed
+5 -786

No files matched your search

@@ -21,9 +21,6 @@ import android.widget.PopupMenu;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.R;
import com.facebook.react.animation.Animation;
import com.facebook.react.animation.AnimationListener;
import com.facebook.react.animation.AnimationRegistry;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.ReactContext;
@@ -68,7 +65,6 @@ public class NativeViewHierarchyManager {
private static final String TAG = NativeViewHierarchyManager.class.getSimpleName();
private final AnimationRegistry mAnimationRegistry;
private final SparseArray<View> mTagsToViews;
private final SparseArray<ViewManager> mTagsToViewManagers;
private final SparseBooleanArray mRootTags;
@@ -86,7 +82,6 @@ public class NativeViewHierarchyManager {
}
public NativeViewHierarchyManager(ViewManagerRegistry viewManagers, RootViewManager manager) {
mAnimationRegistry = new AnimationRegistry();
mViewManagers = viewManagers;
mTagsToViews = new SparseArray<>();
mTagsToViewManagers = new SparseArray<>();
@@ -111,10 +106,6 @@ public class NativeViewHierarchyManager {
return viewManager;
}
public AnimationRegistry getAnimationRegistry() {
return mAnimationRegistry;
}
public void setLayoutAnimationEnabled(boolean enabled) {
mLayoutAnimationEnabled = enabled;
}
@@ -746,45 +737,6 @@ public class NativeViewHierarchyManager {
mLayoutAnimator.reset();
}
/* package */ synchronized void startAnimationForNativeView(
int reactTag,
Animation animation,
@Nullable final Callback animationCallback) {
UiThreadUtil.assertOnUiThread();
View view = mTagsToViews.get(reactTag);
final int animationId = animation.getAnimationID();
if (view != null) {
animation.setAnimationListener(new AnimationListener() {
@Override
public void onFinished() {
Animation removedAnimation = mAnimationRegistry.removeAnimation(animationId);
// There's a chance that there was already a removeAnimation call enqueued on the main
// thread when this callback got enqueued on the main thread, but the Animation class
// should handle only calling one of onFinished and onCancel exactly once.
Assertions.assertNotNull(removedAnimation, "Animation was already removed somehow!");
if (animationCallback != null) {
animationCallback.invoke(true);
}
}
@Override
public void onCancel() {
Animation removedAnimation = mAnimationRegistry.removeAnimation(animationId);
Assertions.assertNotNull(removedAnimation, "Animation was already removed somehow!");
if (animationCallback != null) {
animationCallback.invoke(false);
}
}
});
animation.start(view);
} else {
// TODO(5712813): cleanup callback in JS callbacks table in case of an error
throw new IllegalViewOperationException("View with tag " + reactTag + " not found");
}
}
public synchronized void dispatchCommand(
int reactTag,
int commandId,