recyclerview - Android ViewPageIndicator inside a Recylerview is not showing -
i added viewpageindicator
inside recylcerview
item, recyclerview
item layout
.
<android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardbackgroundcolor="@color/background" card_view:cardcornerradius="0dp" card_view:cardelevation="0dp" android:fillviewport="true"> <linearlayout android:id="@+id/main_container" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_centerhorizontal="true" android:orientation="vertical"> <android.support.v4.view.viewpager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="100dp" /> <com.viewpagerindicator.circlepageindicator android:id="@+id/pager_indicator" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:paddingleft="10dp" android:paddingright="10dp" /> </linearlayout> </android.support.v7.widget.cardview>
viewpageindicator
not showing when scrolling down
, when i'm scrolling up
shows on items, please help.
issue on viewpager adapter, used both fragmentstatepageradapter
, fragmentpageradapter
no sucess. change adapter pageradapter
, fragment view implemnted in instantiateitem
in pageradapter
public class feedimageadapter extends pageradapter { private arraylist<feedcontentgroup> feedcontentgroups; private context mcontext; private layoutinflater layoutinflater; public feedimageadapter(context context, arraylist<feedcontentgroup> feedcontentgroups) { this.mcontext = context; this.feedcontentgroups = feedcontentgroups; layoutinflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); } @override public object instantiateitem(viewgroup collection, int position) { view v = layoutinflater.inflate(r.layout.feed_image_view, null); imageview image1 = (imageview) v.findviewbyid(r.id.image1); feedcontentgroup mfeedcontentgroup = feedcontentgroups.get(position); if (mfeedcontentgroup.getcontent1() != null && mfeedcontentgroup.getcontent1().getthumbnail_file_path() != null) { glide.with(mcontext).load(mfeedcontentgroup.getcontent1().getthumbnail_file_path()).into(image1); } else { image1.setvisibility(view.gone); } ((viewpager) collection).addview(v, 0); return v; } @override public void destroyitem(view collection, int position, object view) { ((viewpager) collection).removeview((view) view); } @override public boolean isviewfromobject(view view, object object) { return view == object; } @override public int getcount() { return feedcontentgroups.size(); } }
Comments
Post a Comment