I am using swiperefreshlayout for pulltorefresh. when user pulls down it shows loading animation without calling setRefreshing(true)
.
I want to show loading animation only when setRefreshing(true)
is called.
Is there any way to disable auto showing animation on pull of screen.
Thanks.
In your onCreate()
method : Try doing these
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mSwipeRefreshLayout.setRefreshing(false);
mSwipeRefreshLayout.setEnabled(false);
}
});
When you want to re do refresh than use vice-versa.
hope this helps.
Try this:
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mSwipeRefreshLayout.setRefreshing(false);
}
});
来源:https://stackoverflow.com/questions/35789013/disable-default-swiperefreshlayout-animation-on-refresh