How to disable “pull to refresh” action and use only indicator?

前端 未结 2 1807
南笙
南笙 2021-02-04 23:21

I enabled \"pull to refresh\" to my project using the SwipeRefreshLayout.

When I move down, appear the loading indicator (material design style). I know, i

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 23:27

    From the documentation:

    If an activity wishes to show just the progress animation, it should call setRefreshing(true). To disable the gesture and progress animation, call setEnabled(false) on the view.

    So to show the animation:

    swiperefreshLayout.setEnabled(true);
    swiperefreshLayout.setRefreshing(true);
    

    And to hide the animation:

    swiperefreshLayout.setRefreshing(false);
    swiperefreshLayout.setEnabled(false);
    

提交回复
热议问题