swiperefreshlayout

How disable swiperefreshlayout when Recyclerview is not on the first item?

和自甴很熟 提交于 2019-12-02 08:28:40
问题 My android project includes a recyclerView that contains a list of cardViews, and also there is a swipeRefreshLayout on the top of this recyclerView. When I scroll down the list and pull up those cardViews, I just want to disable swipeRefreshLayout. In other word, when RecyclerView is not on the first item, and if the user wants to scrolling back to first item, it must not show swipeRefreshLayout. I googled a lot about this issue and there are some solutions for this problem that overrides

How disable swiperefreshlayout when Recyclerview is not on the first item?

廉价感情. 提交于 2019-12-02 03:26:52
My android project includes a recyclerView that contains a list of cardViews, and also there is a swipeRefreshLayout on the top of this recyclerView. When I scroll down the list and pull up those cardViews, I just want to disable swipeRefreshLayout. In other word, when RecyclerView is not on the first item, and if the user wants to scrolling back to first item, it must not show swipeRefreshLayout. I googled a lot about this issue and there are some solutions for this problem that overrides onScrollStateChanged method, but they not behave very smooth and still swipeRefreshLayout remains enabled

Android - Crash when clicking on RecyclerView when SwipeRefreshLayout loading

大兔子大兔子 提交于 2019-12-01 11:37:23
I have a RecyclerView inside a SwipeRefreshLayout , when I reload my page , when SwipeRefreshLayout is loading, I click on the item on the RecyclerView and it crashes. 04-21 13:14:49.605 25586-25586/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.boxopen.funstack, PID: 25586 java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.boxopen.funstack.adapter.RecycleBookAdapter$BookViewHolder.onClickLike(RecycleBookAdapter.java:339) at com.boxopen.funstack

Android - Crash when clicking on RecyclerView when SwipeRefreshLayout loading

 ̄綄美尐妖づ 提交于 2019-12-01 08:11:04
问题 I have a RecyclerView inside a SwipeRefreshLayout , when I reload my page , when SwipeRefreshLayout is loading, I click on the item on the RecyclerView and it crashes. 04-21 13:14:49.605 25586-25586/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.boxopen.funstack, PID: 25586 java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.boxopen.funstack

Android SwipeRefreshLayout with empty TextView not working properly

ⅰ亾dé卋堺 提交于 2019-12-01 03:47:13
What i want to do is , allow user to swipe and refresh the list, it does not matter if the data is there or not. But when data is there in the listview only the listview should be visible, and when data is not there , Empty textview should be visible. In both the cases user must be able to refresh list by swipe. I tried some solution given here in this discussion but none of them sounds working, the idea of taking two SwipeToRefresh works fine as given Here , but it shows empty container even while fetching data from server. I tried it with my own logic wrapping Listview and Textview inside a

Android SwipeRefreshLayout with empty TextView not working properly

此生再无相见时 提交于 2019-12-01 01:44:29
问题 What i want to do is , allow user to swipe and refresh the list, it does not matter if the data is there or not. But when data is there in the listview only the listview should be visible, and when data is not there , Empty textview should be visible. In both the cases user must be able to refresh list by swipe. I tried some solution given here in this discussion but none of them sounds working, the idea of taking two SwipeToRefresh works fine as given Here, but it shows empty container even

滑动事件总结(刷新,加载更多,嵌套滑动)

我只是一个虾纸丫 提交于 2019-11-30 22:44:18
#下拉刷新 在Api21之前,ListView和GridView的使用相当普遍,包括下拉刷新我们也可以使用它,利用他的addHeaderView()和addFooterView()方法,或者使用父级中隐藏View的方式来实现; 在Api21之后,出现了RecyclerView和SwipeRefreshLayout,有人选择了用两者相结合的方式来实现下拉刷新,在看到SwipeRefreshLayout的效果后,我觉得这比之前看到的任何刷新Loading的效果都要简单直接,所有也提倡去替换现有的加载方式。 可是在使用过程中,SwipeRefreshLayout和RecyclerView相结合后,SwipeRefreshLayout下拉后的阻尼效果也好像消失了一样,拉动起来就没那么精神了,对于追求极致的我来说,是不能接受的。 总结: 1.下拉刷新最佳方式:SwipeRefreshLayout和ListView相结合; 2.RecyclerView适用于不需要添加任何刷新单纯展示list数据的情况;也可以和ScrollerView相配合来展示效果。 #上拉加载更多 加载更多相比下拉,其实简单多了。通过监听ListView的滑动距离即最后可见的position是否是最后一项来判断(getLastVisiblePosition())。 #嵌套滑动 在代码设计过程中,应当特别注意

SwipeRefreshLayout with scrollView and Layout above

心不动则不痛 提交于 2019-11-30 12:33:52
问题 I have the following layout <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > //some views here </LinearLayout> <ScrollView

Android: CoordinatorLayout and SwipeRefreshLayout

主宰稳场 提交于 2019-11-30 06:17:28
问题 I try to implement auto hiding toolbar feature from the new support library 22.2.0. Without SwipeRefreshLayout is working fine: But when I re add this layout, toolbar overlap the recyclerview: Code: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout xmlns

Recyclerviews and SwipeRefreshLayout using support library 23.2.0

浪子不回头ぞ 提交于 2019-11-30 04:54:02
问题 Has anyone figured out a way to get recyclerviews, AppbarLayouts and SwipeRefreshLayout to work together on 23.2 yet? I am using a pretty standard method I think, but the swiperefreshlayout keeps grabbing the scroll gesture when trying to move up the recyclerview. <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent"