baoyongzhang / android-pullrefreshlayout Goto Github PK
View Code? Open in Web Editor NEWThis component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout.
License: MIT License
This component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout.
License: MIT License
It would be extreamly good if we can use custom animation with your layout. Do you have possibility to use animation drawable? For instance
<animation-list android:id="@+id/selected" android:oneshot="false">
<item android:drawable="@drawable/wheel0" android:duration="50" />
...
</animation-list>
你好,
当我把CoordinatorLayout、AppBarLayout、PullRefreshLayout{RecyclerView}联合使用时,
下拉刷新的优先级是高于CoordinatorLayout里的beHavior的,所以滑上去再滑下来后,会出现上面的AppBarLayout中的内容还没有显示完全,就出现下来刷新了。
如果有需要的画我可以提供gif哈
正在刷新时, 滑动recycleview, 报出这个异常 。
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 3(offset:3).state:8 at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4659) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1390) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353) at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1180) at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1031) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1529) at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2486) at android.view.View.dispatchTouchEvent(View.java:9306) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2548) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2241) at com.baoyz.widget.PullRefreshLayout.onTouchEvent(PullRefreshLayout.java:250) at android.view.View.dispatchTouchEvent(View.java:9306)
Hi, I got wrapped ViewPager by your pull refresh which inside generate RecyclerView
<pl.rlesniak.ptr.widget.PullRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager
android:id="@+id/content_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</pl.rlesniak.ptr.widget.PullRefreshLayout>
and I have a problem, when I scroll down everthing is fine, but when I want to get back the pull refresh is appearing. Do you have any solution? Except method mRecyclerView.setOnScrollListener()
Fatal Exception: java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(MotionEvent.java)
at android.view.MotionEvent.getY(MotionEvent.java:2431)
at android.support.v4.view.MotionEventCompat.getY(MotionEventCompat.java:521)
at com.baoyz.widget.PullRefreshLayout.onTouchEvent(PullRefreshLayout.java:324)
at android.view.View.dispatchTouchEvent(View.java:10920)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2810)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2512)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.cancelAndClearTouchTargets(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2368)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2842)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2469)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:623)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1906)
at android.app.Activity.dispatchTouchEvent(Activity.java:3247)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:585)
at android.view.View.dispatchPointerEvent(View.java:11149)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5227)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5076)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4599)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4736)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4607)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4793)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4599)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4607)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7210)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7142)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7103)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7321)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
as title
how can i add last updated time of refresh in pullRefreshLayout just below the circle animatio ?
<com.baoyz.widget.PullRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</com.baoyz.widget.PullRefreshLayout>
Hi,
More details:
<com.baoyz.widget.PullRefreshLayout
android:id="@+id/swipe_refresh_layout_plans"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/plan_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" />
...
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/keyline_left_medium_mini"
android:layout_marginRight="@dimen/keyline_left_medium_mini"
android:layout_marginTop="@dimen/keyline_left_medium_mini"
android:elevation="@dimen/cardview_default_elevation"
app:cardCornerRadius="@dimen/cardview_default_radius">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
...
Once I move RecyclerView outside of PullRefreshLayout, it works as expected.
Hi i like and use your libraries but I noticed that in the Material style the animation and the behavior is a little different than Google's one. If you can improve the animation it will be perfect! The differences are:
Thanks 😃
I have included the library into my project however build fails with this error Attribute "type" has already been defined
. The error log references values.xml
specifically <declare-styleable>
. Am using android studio with gradle version 2.2.1 and gradle tools version 1.1.0. Any quick solutions is appreciated.
recycleview瀑布流下拉刷新后页面看不到,往上推一下才出来
这样下拉刷新上拉加载更多就很方便了。
when I scroll up to the bottom, and the scroll down, the refreshing icon shows up at wrong position, Why?
how can we get notified when pull is released without delay
since Onrefresh method in setonrefreshlister has Slight delay or how can we eliminate this delay
I have a recycler view having cardviews, now I want to have this drawable to come down from 3rd card and get the dragging effect from 3rd card onward..
Is it possible or can I have a snippet to make the modifications..??
Hi,
I'm encountering a problem when I have a ScrollView inside your PullRefreshLayout.
When I scroll to the end of the ScrollView and I want to scroll back to the top,
the scroll is on PullRefreshLayout and not on the ScrollView.
So I can't scroll back when I go to the end of the ScrollView !
I'm not sure if it's very clear :/
I import the project but not run this project .
my step:
step 1:
start android studio ---> import project--->select android-PullRefreshLayout-master folder
step 2:
android studio build
错误:FAILURE: Build failed with an exception.
Add an option to have only the refresh image be pulled down, and not the view inside. Like in Google's apps. only the circle is pulled down.
I would be more then happy to contribute this feature.
Currently wrapping a recycler view and the canChildScrollUp is always returning false so the list can no longer be scrolled upwards
Hi, i want to change the color of the area that is behind the loading. But i have to do this without changing background of the list. Because, app has a unique background image which shown all pages and listview on it. How can i change only opened area color?
Thanks.
Please add namespace prefix to the attribute.
There is so many many logs about "setBuffersDimensions" when already set refreshing(false).
//PullRefreshLayout.java
private Animation.AnimationListener mToStartListener = new Animation.AnimationListener() {
@OverRide
public void onAnimationStart(Animation animation) {
mRefreshDrawable.stop();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
// mRefreshDrawable.stop();
mRefreshView.setVisibility(View.GONE);
mCurrentOffsetTop = mTarget.getTop();
}
};
After stop the mRefreshDrawable in onAnimationEnd(), the problem has been solved.
After adding the new design support library from google throws that error when building
It's awesome, you can make it perfect.
I'm wondering how to pull up from bottom to refresh?
Is there any possible solution about this issue?
When i have an empty list view and i pull down on the screen nothing shows up
Error:(14, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
refresh_layout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
// TODO Auto-generated method stub
refresh_layout.post(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
refresh_layout.setRefreshing(true);
// requesting to webservice
}
});
}
});
can this please get updated? it uses appcompat v21 and the latest version right now is v27. this library is incompatible and can not be used
int[] colors = {#FFFFFF, #AFAFAF, #838383, #000000}; I use my Color resource not HEXs
swipeRefreshLayout.setColorSchemeColors(colors);
But whenever I use that, I get a purplish color, but what I want is a white, light grey, dark_grey and a black. Why?
如果我要在圈圈的上方显示一个textview,我该如果写代码实现?
textview跟随圈圈移动
Hi, I think you should add this couple of lines to your code as if you try to call setRefreshing(true) programmatically the drawable animation won't show.
public void setRefreshing(boolean refreshing) {
if (refreshing)
mRefreshDrawable.setPercent(1f);
if (mRefreshing != refreshing) {
setRefreshing(refreshing, false /* notify */);
}
}
Regards and thanks for your contribution.
Danny
When the surface is refreshing, scroll the listView up, we can see the MaterialDrawable is on the top of the listView, why?
android.view.InflateException: Binary XML file line #28: Error inflating class com.cuneytayyildiz.widget.PullRefreshLayout
Thank you for your amazing lib! I'd like to use it but it has to be downloaded as a module. Can you host it on gradle please?
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.