dinuscxj / RecyclerRefreshLayout

A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!
1.67k stars 253 forks source link

加载成功网络数据后刷新UI的处理不友好 #13

Closed loganguo closed 7 years ago

loganguo commented 7 years ago

感谢大神贡献如此强大易用的库。之所以说刷新UI处理的不友好,是因为当网络请求回调不是在ItemInteractionListener类中的时候无法正确地刷新UI。

demo中当网络请求成功返回时,是通过ItemInteractionListener.super.requestRefresh();来刷新UI的,但是如果当网络请求不是在ItemInteractionListener这个类中实现的时候刷新的操作就无法正常执行。 即便声明了一个全局变量,

private ItemInteractionListener itemInteractionListener = new ItemInteractionListener();

也不行。

相信很多人都不是把网络请求写在ItemInteractionListener这个类中的,@dinuscxj 能否给些修改的提示呢?

loganguo commented 7 years ago

感觉把RecyclerFragment.InteractionListener类中的requestRefresh等方法直接放到RecyclerFragment类中就可以了

dinuscxj commented 7 years ago

@loganguo 这个还是跟你们的需求有关系