xyxyliu / swiperefreshlayout Goto Github PK
View Code? Open in Web Editor NEWCustom SwipeRefreshLayout: a Swipe/Pull Refresh Layout on Android
Home Page: https://github.com/xyxyLiu/SwipeRefreshLayout
License: Apache License 2.0
Custom SwipeRefreshLayout: a Swipe/Pull Refresh Layout on Android
Home Page: https://github.com/xyxyLiu/SwipeRefreshLayout
License: Apache License 2.0
Can I refresh it as programmatically? Like .setRefreshing(true);
How to add scroll down to load more?
In canViewScrollUp and canViewScrollHorizontally check every view of parent , including the invisible ones which is wrong. In my project, some views are invisible, they should not be considered in nested scrolling.
<dev.xesam.chelaile.app.widget.pulltorefresh.CustomSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swiperefresh="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/windowBackground"
swiperefresh:enable_top_progress_bar="true"
swiperefresh:keep_refresh_head="true"
swiperefresh:refresh_mode="pull_mode"
swiperefresh:time_out_refresh_complete="200"
swiperefresh:time_out_return_to_top="500">
<FrameLayout
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:touchscreenBlocksFocus="false">
<android.support.v7.widget.RecyclerView
android:id="@+id/cll_act_favorite_type_lines"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/V4.RefreshList" />
<View
android:id="@+id/none_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</FrameLayout>
</dev.xesam.chelaile.app.widget.pulltorefresh.CustomSwipeRefreshLayout>
This leads to sliding conflicts
Child touches works bad. I think, something wrong with touch slop.
How to reproduce: create customSwipeRefreshLayout with ExpandableListView in it.
Exception java.lang.StackOverflowError: stack size 8188KB
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.updateContentOffsetTop (CustomSwipeRefreshLayout.java:1002)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.setTargetOffsetTop (CustomSwipeRefreshLayout.java:1016)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.updateContentOffsetTop (CustomSwipeRefreshLayout.java:1002)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.setTargetOffsetTop (CustomSwipeRefreshLayout.java:1016)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.updateContentOffsetTop (CustomSwipeRefreshLayout.java:1002)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.setTargetOffsetTop (CustomSwipeRefreshLayout.java:1016)
Looks like recursion is causing this issue.
How do I remove the refreshing text and date and indeterminate progress bar. Showing just the top progress bar with multiple colors.
It does not handle nested scrolling.
when thestop refresh
In API:28(Android Pie) when I pull down to refresh app crashes. it works fine in other versions but the crash in Pie. The error is like this :
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.wotu.app.dev, PID: 8152 java.lang.IllegalArgumentException: Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed at android.graphics.Canvas.checkValidSaveFlags(Canvas.java:378) at android.graphics.Canvas.saveLayerAlpha(Canvas.java:555) at com.reginald.swiperefresh.CustomSwipeProgressBar.draw(CustomSwipeProgressBar.java:158) at com.reginald.swiperefresh.CustomSwipeRefreshLayout.draw(CustomSwipeRefreshLayout.java:618) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19073) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1254) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20210) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1366) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20210) at android.view.View.updateDisplayListIfDirty(View.java:19082) ...
Hi! I can't see the way for set a custom header view. How can I do this?
Thanks!
if i move down and then i move up, the all process i do not move up, then i pull down again, it will no action. but a little time pass , it will ok.
Hello,
I use your library to refresh RecyclerView
but I got crash. I am not sure if it related with your library. Android 6.0, Library version 1.1.1
Fatal Exception: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 1(offset:2).state:2
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5011)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4967)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2029)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1414)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3266)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3122)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3568)
at android.view.View.layout(View.java:17025)
at android.view.ViewGroup.layout(ViewGroup.java:5579)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1189)
at android.view.View.layout(View.java:17025)
at android.view.ViewGroup.layout(ViewGroup.java:5579)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.onLayout(CustomSwipeRefreshLayout.java:657)
Hi, any plan to migrate this library to androidX version ? by removing legacy support android we will able to disable jetifier and making some improvement on build speed.
I'm getting the following crash reported by quite a few users. Any idea on the cause/solution?
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.MotionEvent.getY()' on a null object reference
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.onInterceptTouchEvent(CustomSwipeRefreshLayout.java:774)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2366)
at com.reginald.swiperefresh.CustomSwipeRefreshLayout.dispatchTouchEvent(CustomSwipeRefreshLayout.java:741)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2831)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1863)
at android.app.Activity.dispatchTouchEvent(Activity.java:3046)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:63)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:63)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2792)
at android.view.View.dispatchPointerEvent(View.java:10228)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5350)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5186)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4787)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4844)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7312)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7190)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7151)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7422)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:7386)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:7449)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:695)
at android.view.Choreographer.doFrame(Choreographer.java:625)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
i had extend your library. many swiperefresh on my apps, and work. but i have problem with grid view swipe refresh. My grid view have padding top, when i swipe the grid, it's showing padding area, not my swipe layout. How i can solve?
Here my xml
<id.co.elevenia.view.SwipeRefresh
android:id="@+id/swipeRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<id.co.elevenia.mainpage.top100.GridViewTop100
android:paddingTop="@dimen/spacer_gridview_top100"
android:clipToPadding="false"
android:id="@+id/gridView"
android:scrollbars="none"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:horizontalSpacing="@dimen/spacer_home_item"
android:verticalSpacing="@dimen/spacer_home_item"
android:paddingLeft="@dimen/spacer_14px"
android:paddingBottom="@dimen/spacer_14px"
android:paddingRight="@dimen/spacer_14px"
android:listSelector="@null"
android:background="@color/colorBackgroundHome"/>
</id.co.elevenia.view.SwipeRefresh>
Your library could benefit a lot from an easier integration with android studio.
https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/
Great job.
I want when scroll RecycleView then so SwipeRefreshLayout is show ,I tried app:srl_direction="bottom"
but not working, help me !!
How can i use different language?
"Swipe to refresh"
"Release to refresh"
"Refreshing complete"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.