swiperefreshlayout

SwipeRefreshLayout interfere with GridView inside ViewPager

倖福魔咒の 提交于 2019-12-09 22:00:55
问题 i have a ViewPager for the main layout, with 3 fragment as pages, 2 of them has a GrideView inside them. the main page code: <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainRefreshLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.view.ViewPager android:id="@+id/main_pager" android:layout_width="match_parent" android:layout_height="match_parent"> </android.support

How to pass int array of color resource ids from array.xml to SwipeRefreshLayout.setColorSchemeResources

五迷三道 提交于 2019-12-09 15:53:40
问题 I've got Android's SwipeRefreshLayout working and am trying to customize the colors across all the pull to refreshes throughout the app. In order to follow the DRY principle, I've tried moving the desired colors to array.xml as follows: <resources> <array name="swipeRefreshColors"> <item>@color/pink</item> <item>@color/green</item> </array> </resources> However, when I try and import them into the swipe to refresh: swipeRefreshLayout.setColorSchemeResources(R.array.swipeRefreshColors); I get

set location for progressbar in swipe refresh layout android

邮差的信 提交于 2019-12-08 17:11:42
问题 I used Swipe refresh layout in my app. It worked but I want set location for progress bar in swipe layout margin top 100 px. I don't want use default location of it. How I do? thank you 回答1: You could set the offset from top using this setProgressViewOffset (boolean scale, int start, int end) You can read about it here. 回答2: In folder res/values create an xml file if you have not already called dimens.xml Then you can have in it: <resources> <dimen name="refresher_offset">your_preferred

SwipeRefreshLayout interfering with setOnScrollListener

烂漫一生 提交于 2019-12-08 16:29:32
问题 Everytime I scroll the list up or down I hide (or unhide) some views with OnScrollListener . Here is the code attached to my ListView . lv.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; private boolean mIsScrollingUp = true; private LinearLayout ll = (LinearLayout) getActivity() .findViewById(R.id.llSearchPlaces); @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int

Frozen snapshot of list rendered with SwipeRefreshLayout in ViewPager

百般思念 提交于 2019-12-08 09:23:31
问题 Consider an Android activity that is subclass of android.support.v4.app.FragmentActivity . It contains several apges managed by FragmentStatePagerAdapter . Each page contains a ListView wrapped by android.support.v4.widget.SwipeRefreshLayout . The following screenshot shows the initial state of this activity. Now, I swipe down to refresh the list on page 0. The refresh animation appears. Now, let's swipe to the right on page 2 and then back to page 0. The refresh animation is still visible.

SwipeRefreshLayout doesn't show any indicator of refreshing

笑着哭i 提交于 2019-12-07 14:58:58
问题 I have a SwipeRefreshLayout being used inside of Fragments that are being displayed in activities. Swiping does perform the refresh, but after I pull down it goes right back up and there's no indicator of indeterminate progress (the animated progress bars). It just disappears but still calls onRefresh() when it's done. Here's my layouts… Activity layout: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"

Adding text hint to Android SwipeRefreshLayout

﹥>﹥吖頭↗ 提交于 2019-12-07 11:48:16
问题 How do I add a hint on the top of a listView like "Pull down to refresh" which is contained in a swipeRefreshLayout from android.support.v4. The pull down to refresh works but I want to add a text whenever the user pulls the listview slightly down. 回答1: EDIT 10/21/2014 If you update the support-v4 to the latest version (at least 21.0.0) you can use the built-in loading indicator! I just came up with a simple, yet effective, solution. The idea is to add a custom ViewGroup that grows its height

SwipeRefreshLayout Got Action_Move freezes view

会有一股神秘感。 提交于 2019-12-07 09:57:05
问题 I have a normal NavigationDrawer with different fragments : News other Stuff 1 other Stuff 2 Setting The problem : The NewsFragment contains a SwipeRefreshLayout. It works great the first time I refresh. I can change fragment to other Stuff 1 and 2 and Setting. So I come back to NewsFragment. And now when I refresh, the fragment freezes. The drawerLayout works correctly (open/close, even the ActionBar Title change) but the main fragment stay at NewsFragment and I can't scroll. But the

SwipeRefreshLayout prevents AppBarLayout scrolling down with showing refresh circle after updating support libs to 23.2.0

删除回忆录丶 提交于 2019-12-07 07:51:14
问题 After updating google libs to 23.2.0 faced issue, that was in previous support libs version (as I remember it was 22+ or 23.1.0 ). I have RecyclerView in SwipeRefreshLayout , which is in CoordinatorLayout that have AppBarLayout with CollapsingToolbarLayout . So when I now have CollapsingToolbarLayout not fully expanded and try to expand it the swipeRefresh indicator appears, instead of expanding CollapsingToolbarLayout . What can I do? 回答1: So seems to be that it's an old-new bug in 23.2.0

Disable default SwipeRefreshLayout animation on refresh

不羁岁月 提交于 2019-12-06 07:43:04
I am using swiperefreshlayout for pulltorefresh. when user pulls down it shows loading animation without calling setRefreshing(true) . I want to show loading animation only when setRefreshing(true) is called. Is there any way to disable auto showing animation on pull of screen. Thanks. In your onCreate() method : Try doing these mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { mSwipeRefreshLayout.setRefreshing(false); mSwipeRefreshLayout.setEnabled(false); } }); When you want to re do refresh than use vice-versa. hope