/**
   * This method creates a new cell and fill it with content. getView() calls this method when a
   * view needs to be created.
   *
   * @param index Entry's index relative to its section
   * @return
   */
  public void generateCellContent(
      int sectionIndex,
      KrollDict data,
      TiListViewTemplate template,
      TiBaseListViewItem itemContent,
      int itemPosition,
      View item_layout) {
    // Here we create an item content and populate it with data
    // Get item proxy
    TiViewProxy itemProxy = template.getRootItem().getViewProxy();
    // Create corresponding TiUIView for item proxy
    TiListItem item =
        new TiListItem(
            itemProxy,
            (TiCompositeLayout.LayoutParams) itemContent.getLayoutParams(),
            itemContent,
            item_layout);
    // Connect native view with TiUIView so we can get it from recycled view.
    itemContent.setTag(item);

    if (data != null && template != null) {
      generateChildContentViews(template.getRootItem(), null, itemContent, true);
      populateViews(data, itemContent, template, itemPosition, sectionIndex, item_layout);
    }
  }
  public void generateChildContentViews(
      DataItem item, TiUIView parentContent, TiBaseListViewItem rootItem, boolean root) {

    ArrayList<DataItem> childrenItem = item.getChildren();
    for (int i = 0; i < childrenItem.size(); i++) {
      DataItem child = childrenItem.get(i);
      TiViewProxy proxy = child.getViewProxy();
      TiUIView view = proxy.createView(proxy.getActivity());
      view.registerForTouch();
      generateChildContentViews(child, view, rootItem, false);
      // Bind view to root.

      ViewItem viewItem = new ViewItem(view, new KrollDict());
      rootItem.bindView(child.getBindingId(), viewItem);
      // Add it to view hierarchy
      if (root) {
        rootItem.addView(view.getNativeView(), view.getLayoutParams());
      } else {
        parentContent.add(view);
      }
    }
  }