mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Pretty-print Native AnimatedNode values
Summary: For debugging, add prettyPrint method to AnimatedNode classes. Changelog: [Internal] Reviewed By: shergin Differential Revision: D22752292 fbshipit-source-id: ce1f08fc4fd97f38629dd82151c6ea762026c7c9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8d613c6f32
commit
ab5e87fd95
@@ -57,4 +57,20 @@ import java.util.List;
|
||||
* it can be used to calculate node's value.
|
||||
*/
|
||||
public void update() {}
|
||||
|
||||
/**
|
||||
* Pretty-printer for the AnimatedNode. Only called in production pre-crash for debug diagnostics.
|
||||
*/
|
||||
public abstract String prettyPrint();
|
||||
|
||||
public String prettyPrintWithChildren() {
|
||||
String children = "";
|
||||
if (mChildren != null && mChildren.size() > 0) {
|
||||
for (AnimatedNode child : mChildren) {
|
||||
children += " " + child.mTag;
|
||||
}
|
||||
}
|
||||
|
||||
return prettyPrint() + (children.length() > 0 ? " children: " + children : "");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user