ToDou / nestrefresh

Android refresh kit by nest scroll. Pull-to-refresh and pull-to-load-more by behaviors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OnRefreshListener getting triggered only once

Parag2385 opened this issue · comments

Hello,

Thank you for this awesome library, it works just fine. but when I'm using RefreshbarLayout and RefreshHeaderView, the onRefreshListener is getting triggered only once, for the first time. After that on pulling it down, the loading view just stays there and does not get a callback.

Following is how I'm using it:

Layout:

    <com.todou.nestrefresh.RefreshBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorWhite"
        android:fitsSystemWindows="true">

        <com.todou.nestrefresh.RefreshHeaderView
            android:id="@+id/refresh_header_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:nr_layout_scrollFlags="flag_refresh_header" />

        <com.todou.nestrefresh.NRCollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:nr_layout_scrollFlags="flag_collapse">

           

        </com.todou.nestrefresh.NRCollapsingToolbarLayout>

    </com.todou.nestrefresh.RefreshBarLayout>

In code:

    mRefreshListener = object : OnRefreshListener {
        override fun onRefresh() {
            mBinding.refreshHeaderView.stopRefresh()
            Log.e("CustomerWalletFragment", "onRefresh: ")
        }

    }

    mBinding.refreshHeaderView.setOnRefreshListener(mRefreshListener!!)

Is this bug? or am I doing something wrong?

Thanks again.

commented
commented
commented

Fix in 0.0.8

Yeah It's working fine now, thank you very much @ToDou