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

瘦欲@ 提交于 2019-12-03 04:09:26
nhasan

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);

You don't have to always enable and disable. Just disable once when the view is created and than use setRefreshing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!