swiperefreshlayout

SwipeRefreshLayout behind ActionBar

我是研究僧i 提交于 2019-11-27 11:07:41
问题 When using a SwipeRefreshLayout in combination with a overlay mode ActionBar, the loading animation will be displayed behind the actionbar, making it almost invisible. Is there anything I can do to show it on top of the actionbar? 回答1: In the Material Design version of the appcompat-v7 library (v21.0.0), SwipeRefreshLayout gets a method to set the Progress View offset. https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html#setProgressViewOffset(boolean,

Scroll up does not work with SwipeRefreshLayout in Listview

一个人想着一个人 提交于 2019-11-27 04:24:40
问题 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=

SwipeRefreshLayout + WebView when scroll position is at top

自作多情 提交于 2019-11-27 04:03:53
I'm trying to use SwipeRefreshLayout with WebView. I'm facing the problem where in the middle of page, when user scrolls down, unwanted refresh kicks in. How do I make the refresh event only happen when webview's scroll position is at the top. (ie, he's looking at the top portion of the page)? vizZ I've managed to solve it without having to extend anything. Have a look at this snippet (Fragment-specific): private ViewTreeObserver.OnScrollChangedListener mOnScrollChangedListener; @Override public void onStart() { super.onStart(); swipeLayout.getViewTreeObserver().addOnScrollChangedListener

Can't scroll in a ListView in a swipeRefreshLayout

蹲街弑〆低调 提交于 2019-11-27 02:46:20
问题 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? 回答1: 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

SwiperefreshLayout in Android

谁说我不能喝 提交于 2019-11-27 01:56:17
问题 i am using SwipeRefreshLayout in my below layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/homePageBackground" android:orientation="vertical" > <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeRefreshLayout_listView" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout

When switch fragment with SwipeRefreshLayout during refreshing, fragment freezes but actually still work

▼魔方 西西 提交于 2019-11-26 21:41:44
UPDATE: I thought it worked correctly. But after some test trouble still exists *sniff* Then I made a simpler version to see what exactly happen and I get to know that the refreshing fragment which should have been detached still left there. Or exactly, the view of the old fragment left there, on top of the newer fragment. Since RecyclerView's background of my original app is not transparent, so It turned out what I said before. END OF UPDATE I have a MainActivity with layout like this: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns

Disable click on RecyclerView inside a SwipeRefreshLayout

好久不见. 提交于 2019-11-26 20:44:42
问题 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); 回答1: 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

Android: CollapsingToolbarLayout and SwipeRefreshLayout get stuck

半腔热情 提交于 2019-11-26 19:31:17
I use CollapsingToolbarLayout, RecyclerView and SwipeRefreshLayout together: Xml: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget

HorizontalScrollView inside SwipeRefreshLayout

我们两清 提交于 2019-11-26 18:34:26
I implemented the new SwipeRefreshLayout component in my application and it works well with any vertical views, like ListView , GridView and ScrollView . It behaves very bad with horizontal views, like HorizontalScrollView . When scrolling to the right or left, the SwipeRefreshLayout view caches the touch, prevents the HorizontalScrollView from receiving it and starts scrolling vertically to perform the refresh. I tried solving this issue as I previously solved issues with vertical ScrollView with ViewPager inside, using requestDisallowInterceptTouchEvent but it didn't work. I also noticed

When switch fragment with SwipeRefreshLayout during refreshing, fragment freezes but actually still work

梦想与她 提交于 2019-11-26 08:02:32
问题 UPDATE: I thought it worked correctly. But after some test trouble still exists *sniff* Then I made a simpler version to see what exactly happen and I get to know that the refreshing fragment which should have been detached still left there. Or exactly, the view of the old fragment left there, on top of the newer fragment. Since RecyclerView\'s background of my original app is not transparent, so It turned out what I said before. END OF UPDATE I have a MainActivity with layout like this: