Skip to content

Commit

Permalink
Merge pull request #4728 from Akylas/TC-2494
Browse files Browse the repository at this point in the history
[TIMOB-14399] scrollableview should call setActivity on its children (second try)
  • Loading branch information
vishalduggal committed Sep 30, 2013
2 parents a68d1d1 + b395f4f commit a614d03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,14 @@ public void releaseViews()
getMainHandler().removeMessages(MSG_HIDE_PAGER);
super.releaseViews();
}

@Override
public void setActivity(Activity activity)
{
super.setActivity(activity);
ArrayList<TiViewProxy> list = getView().getViews();
for (TiViewProxy proxy : list) {
proxy.setActivity(activity);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue,
public void addView(TiViewProxy proxy)
{
if (!mViews.contains(proxy)) {
proxy.setActivity(this.proxy.getActivity());
mViews.add(proxy);
getProxy().setProperty(TiC.PROPERTY_VIEWS, mViews.toArray());
mAdapter.notifyDataSetChanged();
Expand Down Expand Up @@ -424,9 +425,11 @@ public void setViews(Object viewsObject)

if (viewsObject instanceof Object[]) {
Object[] views = (Object[])viewsObject;
Activity activity = this.proxy.getActivity();
for (int i = 0; i < views.length; i++) {
if (views[i] instanceof TiViewProxy) {
TiViewProxy tv = (TiViewProxy)views[i];
tv.setActivity(activity);
mViews.add(tv);
changed = true;
}
Expand Down

0 comments on commit a614d03

Please sign in to comment.