protected void onGetStyles()

in stetho/src/main/java/com/facebook/stetho/inspector/elements/android/ViewDescriptor.java [190:268]


  protected void onGetStyles(View element, String ruleName, StyleAccumulator accumulator) {
    if (VIEW_STYLE_RULE_NAME.equals(ruleName)) {
      List<ViewCSSProperty> properties = getViewProperties();
      for (int i = 0, size = properties.size(); i < size; i++) {
        ViewCSSProperty property = properties.get(i);
        try {
          getStyleFromValue(
              element,
              property.getCSSName(),
              property.getValue(element),
              property.getAnnotation(),
              accumulator);
        } catch (Exception e) {
          if (e instanceof IllegalAccessException || e instanceof InvocationTargetException) {
            LogUtil.e(e, "failed to get style property " + property.getCSSName() +
                    " of element= " + element.toString());
          } else {
            throw ExceptionUtil.propagate(e);
          }
        }
      }
    } else if (ACCESSIBILITY_STYLE_RULE_NAME.equals(ruleName)) {
      if (sHasSupportNodeInfo) {
        boolean ignored = AccessibilityNodeInfoWrapper.getIgnored(element);
        getStyleFromValue(
            element,
            "ignored",
            ignored,
            null,
            accumulator);

        if (ignored) {
          getStyleFromValue(
              element,
              "ignored-reasons",
              AccessibilityNodeInfoWrapper.getIgnoredReasons(element),
              null,
              accumulator);
        }

        getStyleFromValue(
            element,
            "focusable",
            !ignored,
            null,
            accumulator);

        if (!ignored) {
          getStyleFromValue(
              element,
              "focusable-reasons",
              AccessibilityNodeInfoWrapper.getFocusableReasons(element),
              null,
              accumulator);

          getStyleFromValue(
              element,
              "focused",
              AccessibilityNodeInfoWrapper.getIsAccessibilityFocused(element),
              null,
              accumulator);

          getStyleFromValue(
              element,
              "description",
              AccessibilityNodeInfoWrapper.getDescription(element),
              null,
              accumulator);

          getStyleFromValue(
              element,
              "actions",
              AccessibilityNodeInfoWrapper.getActions(element),
              null,
              accumulator);
        }
      }
    }
  }