omadahealth / SwipyRefreshLayout

A SwipeRefreshLayout extension that allows to swipe in both direction
MIT License
963 stars 218 forks source link

Animation programmatically #62

Open alissonvargas opened 7 years ago

alissonvargas commented 7 years ago

How to start animation programmatically?

swipyrefreshlayout.setRefreshing(true); -> is not working for me. Bottom direction.

I found the problem... The first pass on getMeasuredHeight() on setDirection(), returning 0 from height. The second time is works fine.

bamma commented 7 years ago

You need to setDirection on the SwipyRefreshLayout to SwipyRefreshLayout.Both,

The reason why it works for you putting in the messured height is because any unknown value, will result int becoming Both, which has the integer value of 2.