react-native-navigation的迁移库

LayoutNode.java 787B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package com.reactnativenavigation.parse;
  2. import org.json.JSONObject;
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. public class LayoutNode {
  6. public enum Type {
  7. Component,
  8. ExternalComponent,
  9. Stack,
  10. BottomTabs,
  11. SideMenuRoot,
  12. SideMenuCenter,
  13. SideMenuLeft,
  14. SideMenuRight,
  15. TopTabs
  16. }
  17. public final String id;
  18. public final Type type;
  19. public final JSONObject data;
  20. final List<LayoutNode> children;
  21. LayoutNode(String id, Type type) {
  22. this(id, type, new JSONObject(), new ArrayList<>());
  23. }
  24. public LayoutNode(String id, Type type, JSONObject data, List<LayoutNode> children) {
  25. this.id = id;
  26. this.type = type;
  27. this.data = data;
  28. this.children = children;
  29. }
  30. JSONObject getOptions() {
  31. return data.optJSONObject("options");
  32. }
  33. }