@Override
  public void add(TiUIView child) {
    super.add(child);

    if (getNativeView() != null) {
      getLayout().requestLayout();
      if (child.getNativeView() != null) {
        child.getNativeView().requestLayout();
      }
    }
  }
  public void handleAdd(TiViewProxy child) {
    children.add(child);
    child.parent = new WeakReference<TiViewProxy>(this);
    if (view != null) {
      child.setActivity(getActivity());
      if (this instanceof DecorViewProxy) {
        child.isDecorView = true;
      }
      TiUIView cv = child.getOrCreateView();

      view.add(cv);
    }
  }
  public void realizeViews(TiUIView view) {
    setModelListener(view);

    // Use a copy so bundle can be modified as it passes up the inheritance
    // tree. Allows defaults to be added and keys removed.
    if (children != null) {
      try {
        for (TiViewProxy p : children) {
          TiUIView cv = p.getOrCreateView();
          view.add(cv);
        }
      } catch (ConcurrentModificationException e) {
        Log.e(LCAT, e.getMessage(), e);
      }
    }

    synchronized (pendingAnimationLock) {
      if (pendingAnimation != null) {
        handlePendingAnimation(true);
      }
    }
  }
  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);
      }
    }
  }
  public TiBubbleAndroidView(TiViewProxy proxy) {
    super(proxy);

    prop = proxy.getProperties();

    LayoutArrangement arrangement = LayoutArrangement.DEFAULT;

    if (proxy.hasProperty(TiC.PROPERTY_LAYOUT)) {
      String layoutProperty = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_LAYOUT));
      if (layoutProperty.equals(TiC.LAYOUT_HORIZONTAL)) {
        arrangement = LayoutArrangement.HORIZONTAL;
      } else if (layoutProperty.equals(TiC.LAYOUT_VERTICAL)) {
        arrangement = LayoutArrangement.VERTICAL;
      }
    }

    TiCompositeLayout nativeView = new TiCompositeLayout(proxy.getActivity(), arrangement);
    setNativeView(nativeView);

    if (nativeBubbleView == null) {
      Activity currentActivity = proxy.getActivity();
      if (currentActivity == null) {
        currentActivity = TiApplication.getAppCurrentActivity();
      }
      nativeBubbleView = new NativeBubbleView(currentActivity);

      LayoutParams params = new LayoutParams();
      params.height = android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
      params.width = android.widget.FrameLayout.LayoutParams.MATCH_PARENT;

      ViewGroup savedParent = null;
      int childIndex = -1;

      TiUIView parentView = proxy.getParent().getOrCreateView();
      View parentNativeView = (View) parentView.getNativeView();

      if (parentNativeView != null) {
        ViewParent nativeParent = (ViewParent) parentNativeView;

        if (nativeParent instanceof ViewGroup) {
          savedParent = (ViewGroup) nativeParent;
          childIndex = savedParent.indexOfChild(nativeView);
          savedParent.removeView(nativeView);
        }
      }

      nativeBubbleView.addView(nativeView, params);

      if (savedParent != null) {
        savedParent.addView(nativeBubbleView, childIndex, getLayoutParams());
      }

      if (prop.containsKey("bubbleRadius")) {
        float radius = 0;
        TiDimension radiusDim =
            TiConvert.toTiDimension(prop.get("bubbleRadius"), TiDimension.TYPE_WIDTH);
        if (radiusDim != null) {
          radius = (float) radiusDim.getPixels(getNativeView());
        }
        nativeBubbleView.setBubbleRadius(radius);
      }

      if (prop.containsKey("bubbleColor")) {
        nativeBubbleView.setBubbleColor(TiConvert.toColor(prop, "bubbleColor"));
      } else {
        Integer bgColor = TiConvert.toColor(prop, TiC.PROPERTY_BACKGROUND_COLOR);
        if (bgColor != null) {
          nativeBubbleView.setBubbleColor(bgColor);
        }
      }

      if (prop.containsKey("bubbleBeak")) {
        nativeBubbleView.setBubbleBeak(TiConvert.toInt(prop, "bubbleBeak"));
      }

      if (prop.containsKey("bubbleBeakVertical")) {
        nativeBubbleView.setBubbleBeakVertical(TiConvert.toInt(prop, "bubbleBeakVertical"));
      }

      parentView.remove(this);
      parentView.add(this);
    }
  }