I have a SwipeRefreshLayout and a ListView in it. So when I scroll down and at the very beginning the update icon appears, that is, it is updated normally ... I do this like this:

swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout); @Override public void onRefresh() { swipeRefreshLayout.postDelayed(new Runnable() { @Override public void run() { swipeRefreshLayout.setRefreshing(false); ToastUtils.ToastLong(ctx, "список заказов обновлен"); } }, 500); } 

So I still need to update when you scroll down and at the end of the list, too, so that the icon appears and is updated, and when the activity is created, that is, onCreate, too, the update was how to implement all this, could not be found in bourgeois, because it is not easy to formulate it in English. ..

    1 answer 1

    It is very easy to formulate:

    android swiperefreshlayout top bottom

    For this query , a question on SO was found in the first link, in which a second answer was found with a link to the library .
    Connect as follows:

     compile 'com.github.orangegangsters:swipy:1.2.3@aar' 

    Add to markup like this:

     <com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout android:id="@+id/swipyrefreshlayout" android:layout_width="wrap_content" android:layout_height="wrap_content" app:srl_direction="both"> <ListView android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout> 

    P. S. It took 28 seconds to find a solution. 28 seconds, Karl! (with)