-
Notifications
You must be signed in to change notification settings - Fork 240
Henry Tao edited this page Feb 15, 2016
·
2 revisions
In case you want to use another PullDownToRefresh layout, consider to use below code. Remember that AppBarLayout only supports RecyclerView and NestedScrollView. The return target view has to be either those supported views.
smoothAppBarLayout.setScrollTargetCallback(new ScrollTargetCallback() {
@Override
public View callback(View target) {
if (target instanceof SwipeRefreshLayout && ((SwipeRefreshLayout) target).getChildCount() > 0) {
return ((SwipeRefreshLayout) target).getChildAt(0);
}
return target;
}
});Implement ViewPager with FragmentPagerAdapter is kind of tricky in orientation changed. You have to double check if those child fragments are initiated or not. The simplest solution is to use tag. Please refer to my sample code for more details.