ongakuer / CircleIndicator

A lightweight indicator like in nexus 5 launcher
Apache License 2.0
4.27k stars 714 forks source link

CircleIndicator2 is not working with recyclerview snaphelper #137

Open nivanrajmohan opened 4 years ago

nivanrajmohan commented 4 years ago

I'm using support version which is implementation 'me.relex:circleindicator:1.3.2' . After i attach this to recyclerview and snaphelper, the indicator is not showing. The CircleIndicator for viewpager working but CircleIndicator2 is not showing at all with recyclerview. I tried added adapter observable which is stated optional but still same.

Slavvkko commented 4 years ago

Hi. show your code, please.

nivanrajmohan commented 4 years ago
   `<me.relex.circleindicator.CircleIndicator2
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:id="@+id/dotindicator"
        android:visibility="visible"
        app:ci_drawable="@drawable/active_dots"
        app:ci_drawable_unselected="@drawable/deactive_dots"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/select_title"
        android:layout_marginRight="10dp">

    </me.relex.circleindicator.CircleIndicator2>`

   `private void SetUpRecycle(){
        rda = new RecyclerDefectAdapter(this,defectLists);
        rv.setAdapter(rda);
        rv.setLayoutManager(new GridLayoutManager(this,2,GridLayoutManager.HORIZONTAL,false));
        rda.notifyDataSetChanged();

        PagerSnapHelper snapHelper = new PagerSnapHelper();
        snapHelper.attachToRecyclerView(rv);
        ci.attachToRecyclerView(rv,snapHelper);
     }`
nivanrajmohan commented 4 years ago

Hi. show your code, please.

Above is my code, xml and java code, please let me know what is the problem..

Slavvkko commented 4 years ago

Recently you said that you tried adding adapter observable. It is missed in SetUpRecycle.

nivanrajmohan commented 4 years ago

I tried that before, still no changes so i removed that line.

Slavvkko commented 4 years ago

We can't run this piece of example to try to reproduce this error. Show your working code, with an adapter and data that you insert to an adapter.