public static Pair makeDisplayAndColor()

in litho-editor-flipper/src/main/java/com/facebook/litho/editor/flipper/DebugComponentDescriptor.java [261:291]


  public static Pair<String, String> makeDisplayAndColor(
      boolean isSelected,
      @LayoutState.CalculateLayoutSource int source,
      @Nullable String attribution) {
    final String attrib = attribution == null ? "" : ": " + attribution;
    final String selectedColor = "white";
    switch (source) {
      case LayoutState.CalculateLayoutSource.MEASURE_SET_SIZE_SPEC:
        return new Pair<>("Measure set size sync" + attrib, isSelected ? selectedColor : "orange");
      case LayoutState.CalculateLayoutSource.MEASURE_SET_SIZE_SPEC_ASYNC:
        return new Pair<>("Measure set size async" + attrib, isSelected ? selectedColor : "orange");
      case LayoutState.CalculateLayoutSource.SET_SIZE_SPEC_ASYNC:
        return new Pair<>("Set size async" + attrib, isSelected ? selectedColor : "blueDark");
      case LayoutState.CalculateLayoutSource.SET_SIZE_SPEC_SYNC:
        return new Pair<>("Set size sync" + attrib, isSelected ? selectedColor : "blueDark");
      case LayoutState.CalculateLayoutSource.UPDATE_STATE_ASYNC:
        return new Pair<>(attribution + " async", isSelected ? selectedColor : "lemon");
      case LayoutState.CalculateLayoutSource.UPDATE_STATE_SYNC:
        return new Pair<>(attribution + " sync", isSelected ? selectedColor : "lemon");
      case LayoutState.CalculateLayoutSource.NONE:
        return new Pair<>("None" + attrib, isSelected ? selectedColor : "black");
      case LayoutState.CalculateLayoutSource.TEST:
        return new Pair<>("Test" + attrib, isSelected ? selectedColor : "black");
      case LayoutState.CalculateLayoutSource.SET_ROOT_ASYNC:
        return new Pair<>("Set root async" + attrib, isSelected ? selectedColor : "slate");
      case LayoutState.CalculateLayoutSource.SET_ROOT_SYNC:
        return new Pair<>("Set root sync" + attrib, isSelected ? selectedColor : "slate");
      default:
        return new Pair<>("Unknown" + attrib, isSelected ? selectedColor : "red");
    }
  }