//    boolean isSys = (viewMap == sysId2View);
private void resolveIncludes(String resRoot, HashMap<Integer, String> nameMap,
                               HashMap<Integer, AndroidView> viewMap, boolean isSys) {
    HashMap<String, AndroidView> name2View = Maps.newHashMap();
    for (Map.Entry<Integer, String> entry : nameMap.entrySet()) {
      String name = entry.getValue();
      AndroidView view = viewMap.get(entry.getKey());
      name2View.put(name, view);
    }
//    boolean isSys = (viewMap == sysId2View);
    LinkedList<AndroidView> work = Lists.newLinkedList();
    work.addAll(viewMap.values());
    while (!work.isEmpty()) {
      AndroidView view = work.remove();
      for (int i = 0; i < view.getNumberOfChildren(); i++) {
        IAndroidView child = view.getChildInternal(i);
        if (child instanceof AndroidView) {
          work.add((AndroidView) child);
          continue;
        }
        IncludeAndroidView iav = (IncludeAndroidView) child;
        String layoutId = iav.layoutId;
        AndroidView tgt = name2View.get(layoutId);
        if (tgt != null) {
          tgt = (AndroidView) tgt.deepCopy();
          tgt.setParent(view, i);
        } else if (getLayoutFilePath(resRoot, layoutId, isSys) != null) {
          // not exist, let's get it on-demand
          String file = getLayoutFilePath(resRoot, layoutId, isSys);
          tgt = new AndroidView();
          tgt.setParent(view, i);
          tgt.setOrigin(file);
          readLayout(file, tgt, isSys);
          int newId = nonRId--;
          viewMap.put(newId, tgt);
          nameMap.put(newId, layoutId);
        } else if (sysRGeneralIdMap.get("layout").containsKey(layoutId) && sysId2View.containsKey
                (sysRGeneralIdMap.get("layout").get(layoutId)
                )) {
          // <include> is used with an in built android layout id
          tgt = (AndroidView) sysId2View.get(sysRGeneralIdMap.get("layout").get(layoutId)).deepCopy();
          tgt.setParent(view, i);
        } else {
          Logger.warn(this.getClass().getSimpleName(), "Unknown layout " + layoutId
                  + " included by " + view.getOrigin());
          continue;
        }
        Integer includeeId = iav.includeeId;
        if (includeeId != null) {
          tgt.setId(includeeId.intValue());
        }
        work.add(tgt);
      }
    }
  }
name2View.put(name, view);
}
// boolean isSys = (viewMap == sysId2View);
LinkedList<AndroidView> work = Lists.newLinkedList();
work.addAll(viewMap.values());
private void resolveIncludes(String resRoot, HashMap<Integer, String> nameMap,
HashMap<Integer, AndroidView> viewMap, boolean isSys) {
HashMap<String, AndroidView> name2View = Maps.newHashMap();
for (Map.Entry<Integer, String> entry : nameMap.entrySet()) {
String name = entry.getValue();
AndroidView view = viewMap.get(entry.getKey());
name2View.put(name, view);
}
// boolean isSys = (viewMap == sysId2View);
LinkedList<AndroidView> work = Lists.newLinkedList();
work.addAll(viewMap.values());
while (!work.isEmpty()) {
AndroidView view = work.remove();
for (int i = 0; i < view.getNumberOfChildren(); i++) {
IAndroidView child = view.getChildInternal(i);
if (child instanceof AndroidView) {
work.add((AndroidView) child);
continue;
}
private void resolveIncludes(String resRoot, HashMap<Integer, String> nameMap,
HashMap<Integer, AndroidView> viewMap, boolean isSys) {
HashMap<String, AndroidView> name2View = Maps.newHashMap();
for (Map.Entry<Integer, String> entry : nameMap.entrySet()) {
String name = entry.getValue();
AndroidView view = viewMap.get(entry.getKey());
name2View.put(name, view);
}
// boolean isSys = (viewMap == sysId2View);
LinkedList<AndroidView> work = Lists.newLinkedList();
work.addAll(viewMap.values());
while (!work.isEmpty()) {
AndroidView view = work.remove();
for (int i = 0; i < view.getNumberOfChildren(); i++) {
IAndroidView child = view.getChildInternal(i);
if (child instanceof AndroidView) {
work.add((AndroidView) child);
continue;
}
IncludeAndroidView iav = (IncludeAndroidView) child;
String layoutId = iav.layoutId;
AndroidView tgt = name2View.get(layoutId);
if (tgt != null) {
tgt = (AndroidView) tgt.deepCopy();
tgt.setParent(view, i);
} else if (getLayoutFilePath(resRoot, layoutId, isSys) != null) {
// not exist, let's get it on-demand
String file = getLayoutFilePath(resRoot, layoutId, isSys);
tgt = new AndroidView();