swiperefreshlayout

RecyclerView and SwipeRefreshLayout

不打扰是莪最后的温柔 提交于 2019-11-28 13:30:12
问题 I'm using the new RecyclerView-Layout in a SwipeRefreshLayout and experienced a strange behaviour. When scrolling the list back to the top sometimes the view on the top gets cut in. If i try to scroll to the top now - the Pull-To-Refresh triggers. If i try and remove the Swipe-Refresh-Layout around the Recycler-View the Problem is gone. And its reproducable on any Phone (not only L-Preview devices). <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/contentView" android:layout

SwipeRefreshLayout + ViewPager, limit horizontal scroll only?

这一生的挚爱 提交于 2019-11-28 13:23:16
问题 I've implemented SwipeRefreshLayout and ViewPager in my app but there is a big trouble: whenever I'm going to swipe left / right to switch between pages the scrolling is too sensitive. A little swipe down will trigger the SwipeRefreshLayout refresh too. I want to set a limit to when horizontal swipe starts, then force horizontal only until swiping is over. In other words, I want to cancel vertical swipping when finger is moving horizontally. This problem only occurs on ViewPager , if I swipe

Can't scroll in a ListView in a swipeRefreshLayout

醉酒当歌 提交于 2019-11-28 09:10:19
I'm having an issue with the SwipeRefreshLayout. I have a list view within the layout and every time I scroll upward in the list view the swipe to refresh layout is tiggered and you can never scroll back to the top of the layout. Anyone have any ideas? I found an answer to my question. I am manually enabling the swipeRefreshLayout when the first child in the listview is at the top of the list. listView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView listView,

SwipeRefreshLayout - Pull From Bottom

给你一囗甜甜゛ 提交于 2019-11-28 08:57:10
Is there a way to use SwipeRefreshLayout to refresh ListView when it's pulled from bottom? I created pull from top, but I would also need pull from bottom. There are many tutorials on how to create pull from top, but I couldn't find any tutorials for pull from bottom? AndreyICE SwipeRefreshLayout from Android Support Library version 21 does not support pull from bottom. I have made modification SwipeRefreshLayoutBottom with is based on original SwipeRefreshLayout code. It is fully based on original Google code with just inversion of coordinates and overridden implementation of

SwipeRefreshLayout - swipe down to refresh but not move the view pull down

非 Y 不嫁゛ 提交于 2019-11-28 06:03:21
Is it possible ?? as a Title said swipe down to refresh Layout but stick the Layout not move it down along swipe gusture Thank you - I'm using SwipeRefreshLayout You try this way listView.setOnScrollListener(new OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { boolean enable = false; if(listView != null && listView.getChildCount() > 0){ // check if the first item of the list is visible boolean firstItemVisible = listView

Disable click on RecyclerView inside a SwipeRefreshLayout

风流意气都作罢 提交于 2019-11-27 21:37:36
I implemented a SwipeRefreshLayout using a RecyclerView and I need that my adapter items are disabled during the OnRefreshListener . I tried the following approach, but the click occurs normally: mRecyclerView.setEnabled(false); mRecyclerView.setClickable(false); Use logic we had with ListAdapter . This will disable adapter items, instead their parent. public interface RecyclerViewItemEnabler{ public boolean isAllItemsEnabled(); public boolean getItemEnabled(int position); } And implementation should look like this: public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerView

Scroll up does not work with SwipeRefreshLayout in Listview

一个人想着一个人 提交于 2019-11-27 20:02:24
I want to implement scroll to refresh functionality with a listView. Also there are other view elements in the same layout file which are displayed if the list is empty. Here is my layout file. The problem is that when I scroll down and then try to scroll up, instead of scrolling all the way to the top and then refreshing it just refreshes there and scroll up is not working. <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/swipe_container" android:layout_width="match_parent"

SwipeRefreshLayout trigger programmatically

坚强是说给别人听的谎言 提交于 2019-11-27 18:05:39
Is there any way to trigger the SwipeRefreshLayout programmatically? The animation should start and the onRefresh method from the OnRefreshListener interface should get called. Ramz if you are using the new swipeRefreshLayout intoduced in 5.0 As the image shown above you just need to add the following line to trigger the swipe refresh layout programmatically mSwipeRefreshLayout.post(new Runnable() { @Override public void run() { mSwipeRefreshLayout.setRefreshing(true); } }); if you simply call mSwipeRefreshLayout.setRefreshing(true); it won't trigger the circle to animate, so by adding the

android.support.v4.widget.SwipeRefreshLayout working but it is not visible

倖福魔咒の 提交于 2019-11-27 15:53:22
I am using a SwipeRefreshLayout to refresh the content. The problem is that it is working, but is not visible while swiping down. Here's how I have SwipeRefreshLayout in xml file: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="com.abc.xyz.MainActivity"> <android.support.design

SwipeRefreshLayout 下拉刷新

岁酱吖の 提交于 2019-11-27 15:38:26
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.realm.RealmDemo"> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:layout_width="0dp" android:layout_height="0dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf=