Android下拉涮新第三方通用控件https://github.com/chrisbanes/Android-PullToRefresh
This project aims to provide a reusable Pull to Refresh widget for Android. It was originally based on Johan Nilsson's library (mainly for graphics, strings and animations), but these have been replaced since.
Repository at https://github.com/chrisbanes/Android-PullToRefresh.
The sample application (the source is in the repository) has been published onto Google Play for easy access:
To begin using the library, please see the Quick Start Guide page.
Please see the Customisation page for more information on how to change the behaviour and look of the View.
By default this library is set to Pull Down to Refresh, but if you want to allow Pulling Up to Refresh then you can do so. You can even set the View to enable both Pulling Up and Pulling Down using the 'both' setting. See the Customisation page for more information on how to set this.
Want to see which Apps are already using Android-PullToRefresh? Have a look here. If you have an App which is not on the list, let me know.
Please see the new Changelog page to see what's recently changed.
I will gladly accept pull requests for fixes and feature enhancements but please do them in the dev branch. The master branch is for the latest stable code, dev is where I try things out before releasing them as stable. Any pull requests that are against master from now on will be closed asking for you to do another pull against dev.
下拉刷新上拉加载我们一般都是用pullrefreshview第三方开元的框架,但是有心的人会发现android6.0 PullToRefreshWebView中的FloatMath.floor()不能用了怎么替换
protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
解决思路:
Android6.0使用 Math.floor 代替 FloatMath.floor 即可
转载于:https://www.cnblogs.com/it-tsz/p/11504138.html
相关资源:JAVA上百实例源码以及开源项目