Skip to content

Commit

Permalink
Merge pull request #5364 from salachi/TIMOB-8797
Browse files Browse the repository at this point in the history
[TIMOB-8797] set the scrollview as the parent to the child views
  • Loading branch information
hieupham007 committed Feb 28, 2014
2 parents 6c4fa6b + a5491f6 commit 8c619f3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.appcelerator.titanium.view.TiUIView;

import ti.modules.titanium.ui.ScrollableViewProxy;
import ti.modules.titanium.ui.widget.TiUIScrollView.TiScrollViewLayout;
import ti.modules.titanium.ui.widget.listview.ListItemProxy;
import android.annotation.SuppressLint;
import android.app.Activity;
Expand Down Expand Up @@ -326,6 +325,7 @@ public void addView(TiViewProxy proxy)
{
if (!mViews.contains(proxy)) {
proxy.setActivity(this.proxy.getActivity());
proxy.setParent(this.proxy);
mViews.add(proxy);
getProxy().setProperty(TiC.PROPERTY_VIEWS, mViews.toArray());
mAdapter.notifyDataSetChanged();
Expand All @@ -336,6 +336,7 @@ public void removeView(TiViewProxy proxy)
{
if (mViews.contains(proxy)) {
mViews.remove(proxy);
proxy.setParent(null);
getProxy().setProperty(TiC.PROPERTY_VIEWS, mViews.toArray());
mAdapter.notifyDataSetChanged();
}
Expand Down Expand Up @@ -419,6 +420,7 @@ private void clearViewsList()
}
for (TiViewProxy viewProxy : mViews) {
viewProxy.releaseViews();
viewProxy.setParent(null);
}
mViews.clear();
}
Expand All @@ -435,6 +437,7 @@ public void setViews(Object viewsObject)
if (views[i] instanceof TiViewProxy) {
TiViewProxy tv = (TiViewProxy)views[i];
tv.setActivity(activity);
tv.setParent(this.proxy);
mViews.add(tv);
changed = true;
}
Expand All @@ -461,6 +464,7 @@ public void release()
if (mViews != null) {
for (TiViewProxy viewProxy : mViews) {
viewProxy.releaseViews();
viewProxy.setParent(null);
}
mViews.clear();
}
Expand Down

0 comments on commit 8c619f3

Please sign in to comment.