Cleanup old Fabric methods from ReactShadowNodeImpl

Summary: These methods and variables were used by Android implementation of Fabric, these are not used anymore.

Reviewed By: shergin

Differential Revision: D13108547

fbshipit-source-id: d169eb58ba20f3bfe117a124f0494ff3a4fb5dce
This commit is contained in:
David Vacca 2018-11-17 01:52:48 -08:00 committed by Facebook Github Bot
parent 560652cfe8
commit 74f6575f35
2 changed files with 1 additions and 71 deletions

View File

@ -94,8 +94,6 @@ public interface ReactShadowNode<T extends ReactShadowNode> {
void removeAndDisposeAllChildren();
@Nullable ReactStylesDiffMap getNewProps();
/**
* This method will be called by {@link UIManagerModule} once per batch, before calculating
* layout. Will be only called for nodes that are marked as updated with {@link #markUpdated()} or
@ -348,12 +346,4 @@ public interface ReactShadowNode<T extends ReactShadowNode> {
boolean isMeasureDefined();
void dispose();
/**
* @return an immutable {@link List<ReactShadowNode>} containing the children of this
* {@link ReactShadowNode}.
*/
List<ReactShadowNode> getChildrenList();
void updateScreenLayout(ReactShadowNode prevNode);
}

View File

@ -6,12 +6,7 @@
*/
package com.facebook.react.uimanager;
import static java.lang.System.arraycopy;
import com.facebook.debug.holder.PrinterHolder;
import com.facebook.debug.tags.ReactDebugOverlayTags;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
import com.facebook.yoga.YogaAlign;
import com.facebook.yoga.YogaBaselineFunction;
@ -30,8 +25,6 @@ import com.facebook.yoga.YogaValue;
import com.facebook.yoga.YogaWrap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
/**
@ -60,8 +53,6 @@ import javax.annotation.Nullable;
@ReactPropertyHolder
public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl> {
private static final boolean DEBUG = ReactBuildConfig.DEBUG || PrinterHolder.getPrinter().shouldDisplayLogMessage(ReactDebugOverlayTags.FABRIC_UI_MANAGER);
private static final String TAG = ReactShadowNodeImpl.class.getSimpleName();
private static final YogaConfig sYogaConfig;
static {
@ -90,12 +81,6 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
private final float[] mPadding = new float[Spacing.ALL + 1];
private final boolean[] mPaddingIsPercent = new boolean[Spacing.ALL + 1];
private YogaNode mYogaNode;
private int mGenerationDebugInformation = 1;
private ReactShadowNode mOriginalReactShadowNode = null;
private @Nullable ReactStylesDiffMap mNewProps;
private long mInstanceHandle;
private boolean mIsSealed = false;
public ReactShadowNodeImpl() {
mDefaultPadding = new Spacing(0);
@ -109,32 +94,6 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
}
}
protected ReactShadowNodeImpl(ReactShadowNodeImpl original) {
mReactTag = original.mReactTag;
mRootTag = original.mRootTag;
mViewClassName = original.mViewClassName;
mThemedContext = original.mThemedContext;
mShouldNotifyOnLayout = original.mShouldNotifyOnLayout;
mIsLayoutOnly = original.mIsLayoutOnly;
mNativeParent = original.mNativeParent;
mDefaultPadding = new Spacing(original.mDefaultPadding);
// Cloned nodes should be always updated.
mNodeUpdated = true;
// "cached" screen coordinates are not cloned because FabricJS not always clone the last
// ReactShadowNode that was rendered in the screen.
mScreenX = 0;
mScreenY = 0;
mScreenWidth = 0;
mScreenHeight = 0;
mGenerationDebugInformation = original.mGenerationDebugInformation + 1;
arraycopy(original.mPadding, 0, mPadding, 0, original.mPadding.length);
arraycopy(original.mPaddingIsPercent, 0, mPaddingIsPercent, 0, original.mPaddingIsPercent.length);
mNewProps = null;
mParent = null;
mOriginalReactShadowNode = original;
mIsSealed = false;
}
/**
* Nodes that return {@code true} will be treated as "virtual" nodes. That is, nodes that are not
* mapped into native views (e.g. nested text node). By default this method returns {@code false}.
@ -339,12 +298,6 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
// no-op
}
@Override
@Nullable
public ReactStylesDiffMap getNewProps() {
return mNewProps;
}
/**
* Called after layout step at the end of the UI batch from {@link UIManagerModule}. May be used
* to enqueue additional ui operations for the native view. Will only be called on nodes marked as
@ -976,7 +929,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
}
result.append("<").append(getClass().getSimpleName()).append(" view='").append(getViewClass())
.append("' tag=").append(getReactTag()).append(" gen=").append(mGenerationDebugInformation);
.append("' tag=").append(getReactTag());
if (mYogaNode != null) {
result.append(" layout='x:").append(getScreenX())
.append(" y:").append(getScreenY()).append(" w:").append(getLayoutWidth()).append(" h:")
@ -1003,17 +956,4 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
}
}
@Nullable
@Override
public List<ReactShadowNode> getChildrenList() {
return mChildren == null ? null : Collections.<ReactShadowNode>unmodifiableList(mChildren);
}
@Override
public void updateScreenLayout(ReactShadowNode prevNode) {
mScreenHeight = prevNode.getScreenHeight();
mScreenWidth = prevNode.getScreenWidth();
mScreenX = prevNode.getScreenX();
mScreenY = prevNode.getScreenY();
}
}