mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Format Java code in xplat/js/react-native-github
Summary: This diff formats the Java class files inside xplat/js/react-native-github. Since google-java-format was enabled in D16071401 we want to codemode the existing code so that users don't have to deal with formatter lint noise at diff-time. ```arc f --paths-cmd 'hg files -I "**/*.java"'``` drop-conflicts Reviewed By: cpojer Differential Revision: D16071725 fbshipit-source-id: fc6e3852e45742c109f0c5ac4065d64201c74204
This commit is contained in:
1 parent
61e95e5cbf
commit
6c0f73b322
681 files changed
+14082
-16365
No files matched your search
@@ -1,27 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
||||
* directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.animated;
|
||||
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
import com.facebook.react.bridge.JavaOnlyMap;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
||||
|
||||
import com.facebook.react.bridge.UIManager;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Animated node that represents view properties. There is a special handling logic implemented for
|
||||
* the nodes of this type in {@link NativeAnimatedNodesManager} that is responsible for extracting
|
||||
* a map of updated properties, which can be then passed down to the view.
|
||||
* the nodes of this type in {@link NativeAnimatedNodesManager} that is responsible for extracting a
|
||||
* map of updated properties, which can be then passed down to the view.
|
||||
*/
|
||||
/*package*/ class PropsAnimatedNode extends AnimatedNode {
|
||||
|
||||
@@ -31,7 +28,10 @@ import javax.annotation.Nullable;
|
||||
private final Map<String, Integer> mPropNodeMapping;
|
||||
private final JavaOnlyMap mPropMap;
|
||||
|
||||
PropsAnimatedNode(ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager, UIManager uiManager) {
|
||||
PropsAnimatedNode(
|
||||
ReadableMap config,
|
||||
NativeAnimatedNodesManager nativeAnimatedNodesManager,
|
||||
UIManager uiManager) {
|
||||
ReadableMap props = config.getMap("props");
|
||||
ReadableMapKeySetIterator iter = props.keySetIterator();
|
||||
mPropNodeMapping = new HashMap<>();
|
||||
@@ -47,16 +47,17 @@ import javax.annotation.Nullable;
|
||||
|
||||
public void connectToView(int viewTag) {
|
||||
if (mConnectedViewTag != -1) {
|
||||
throw new JSApplicationIllegalArgumentException("Animated node " + mTag + " is " +
|
||||
"already attached to a view");
|
||||
throw new JSApplicationIllegalArgumentException(
|
||||
"Animated node " + mTag + " is " + "already attached to a view");
|
||||
}
|
||||
mConnectedViewTag = viewTag;
|
||||
}
|
||||
|
||||
public void disconnectFromView(int viewTag) {
|
||||
if (mConnectedViewTag != viewTag) {
|
||||
throw new JSApplicationIllegalArgumentException("Attempting to disconnect view that has " +
|
||||
"not been connected with the given animated node");
|
||||
throw new JSApplicationIllegalArgumentException(
|
||||
"Attempting to disconnect view that has "
|
||||
+ "not been connected with the given animated node");
|
||||
}
|
||||
|
||||
mConnectedViewTag = -1;
|
||||
@@ -64,13 +65,11 @@ import javax.annotation.Nullable;
|
||||
|
||||
public void restoreDefaultValues() {
|
||||
ReadableMapKeySetIterator it = mPropMap.keySetIterator();
|
||||
while(it.hasNextKey()) {
|
||||
while (it.hasNextKey()) {
|
||||
mPropMap.putNull(it.nextKey());
|
||||
}
|
||||
|
||||
mUIManager.synchronouslyUpdateViewOnUIThread(
|
||||
mConnectedViewTag,
|
||||
mPropMap);
|
||||
mUIManager.synchronouslyUpdateViewOnUIThread(mConnectedViewTag, mPropMap);
|
||||
}
|
||||
|
||||
public final void updateView() {
|
||||
@@ -86,18 +85,16 @@ import javax.annotation.Nullable;
|
||||
} else if (node instanceof ValueAnimatedNode) {
|
||||
Object animatedObject = ((ValueAnimatedNode) node).getAnimatedObject();
|
||||
if (animatedObject instanceof String) {
|
||||
mPropMap.putString(entry.getKey(), (String)animatedObject);
|
||||
mPropMap.putString(entry.getKey(), (String) animatedObject);
|
||||
} else {
|
||||
mPropMap.putDouble(entry.getKey(), ((ValueAnimatedNode) node).getValue());
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported type of node used in property node " +
|
||||
node.getClass());
|
||||
throw new IllegalArgumentException(
|
||||
"Unsupported type of node used in property node " + node.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
mUIManager.synchronouslyUpdateViewOnUIThread(
|
||||
mConnectedViewTag,
|
||||
mPropMap);
|
||||
mUIManager.synchronouslyUpdateViewOnUIThread(mConnectedViewTag, mPropMap);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user