Skip to content

Commit

Permalink
Fix wrapping pages with outlines.
Browse files Browse the repository at this point in the history
  • Loading branch information
makovkastar committed May 31, 2013
1 parent fdb4c01 commit c3f5e17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/com/jfeinstein/jazzyviewpager/JazzyViewPager.java
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public void setObjectForPosition(Object obj, int position) {
mObjs.put(Integer.valueOf(position), obj);
}

private View findViewFromObject(int position) {
public View findViewFromObject(int position) {
Object o = mObjs.get(Integer.valueOf(position));
if (o == null) {
return null;
Expand Down
11 changes: 7 additions & 4 deletions lib/src/com/jfeinstein/jazzyviewpager/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,19 @@ public Object instantiateItem(ViewGroup container, final int position) {
}
@Override
public void destroyItem(ViewGroup container, int position, Object obj) {
container.removeView((View) obj);
container.removeView(mJazzy.findViewFromObject(position));
}
@Override
public int getCount() {
return 10;
}
@Override
public boolean isViewFromObject(View arg0, Object arg1) {
return arg0 == arg1;
public boolean isViewFromObject(View view, Object obj) {
if (view instanceof OutlineContainer) {
return ((OutlineContainer) view).getChildAt(0) == obj;
} else {
return view == obj;
}
}
}

}

0 comments on commit c3f5e17

Please sign in to comment.