How to implement this from fragment
amitsri20 opened this issue · 1 comments
First of all thanks for creating such a cool library.
Tried creating this from activity worked fine but I when am trying to implement this from inside my fragment but could not get it working.
In Fragment implementation I implemented changing few things like:
final ViewPager viewPager = (ViewPager) view.findViewById(R.id.vp_main); viewPager.setAdapter(new MainPagerAdapter(getChildFragmentManager())); viewPager.setOffscreenPageLimit(2);
In HorizontalPagerFragment changed like:
final HorizontalInfiniteCycleViewPager horizontalInfiniteCycleViewPager = (HorizontalInfiniteCycleViewPager) view.findViewById(R.id.hicvp); horizontalInfiniteCycleViewPager.setAdapter(new HorizontalPagerAdapter(getParentFragment().getContext() ,getParentFragment().getActivity()));
also tried without using
getParentFragment()
but Viewpager content is not showing up.
Please check whether you have added container.addView(view) in instantiateItem method from HorizontalPagerAdapter(inherited from PagerAdpater)