Comments (8)
你好,在这里设置的
// y = x - (x/2)^2
float extraOS = nextOffsetTop - totalDragDistance;
float slingshotDist = totalDragDistance;
float tensionSlingshotPercent = Math.max(0, Math.min(extraOS, slingshotDist * 2) / slingshotDist);
float tensionPercent = (float) (tensionSlingshotPercent - Math.pow(tensionSlingshotPercent / 2, 2));
if (offset > 0) { // 下拉的时候才添加阻力
offset = (int) (offset * (1f - tensionPercent));
nextOffsetTop = Math.max(0, currentOffsetTop + offset);
}
希望能帮到你
from easyrefreshlayout.
能不能提供现有一个接口或者方法出来修改下拉的阻尼系数,因为我是直接用的gradle方式加载的库,不然只有把你的库手动导入进来修改。
from easyrefreshlayout.
可以的
from easyrefreshlayout.
已在1.1.4的版本中增加,感谢您的反馈
from easyrefreshlayout.
谢谢
from easyrefreshlayout.
打扰了,更新了1.1.4 发现有个setPUll_RESISTANCE(),但是设置任何double值都阻尼没变化,还有这个方法名能不能小写,public static void setPUll_RESISTANCE(double PUll_RESISTANCE) {
PUll_RESISTANCE = PUll_RESISTANCE;
}
是不是应该写成 this.PUll_RESISTANCE = PUll_RESISTANCE;
from easyrefreshlayout.
PUll_RESISTANCE 是属于static的,我改成对象的了,公式是y = x - (x/a)^2 a是PUll_RESISTANCE 这阻尼滑动效果我也是参考网上一位大神的,1.1.5已修改,希望对你有帮助
from easyrefreshlayout.
你看下,如果有需要的话,我暴露个返回最终y值的接口出来给你,里面的阻尼公示由你们来定义
from easyrefreshlayout.
Related Issues (20)
- loadView太难看了 HOT 1
- EasyRefreshLayout 与 CoordinatorLayout 滑动冲突 HOT 1
- 点击加载更多的view没有反应 HOT 4
- method 'setRefreshing' is invalid HOT 2
- 不支持包webview吗
- nestedscrollview嵌套recyclerview如何加载更多 HOT 3
- 能否暴露一个下拉偏移量的回调方法
- 列表数量不足一页,上拉加载也会被调用。 HOT 3
- 能否设置如果没有更多数据,下拉加载更多用自定义view显示已经加载完毕?
- 在切换时图是否应该取消refresh或者loadMore状态
- 双指快速向下滑动奔溃 HOT 2
- refreshComplete调用后,refreshing view不能消失 HOT 3
- 更多的RefreshHeaderView自定义选项
- 不能加载 Failed to resolve: com.github.anzaizai:EasyRefreshLayout:1.3.1 HOT 2
- 1.3.1 还没有滑到底部就开始加载更多
- 想问下怎么设置全局的,不能设置全局样式。
- 想问一下数据全部加载完毕调用哪个方法禁止加载呢? HOT 1
- java.lang.IllegalArgumentException: pointerIndex out of range HOT 1
- ConstraintLayout内,下拉刷新不能用
- 下拉刷新但是滑动完列表下拉刷新功能失效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyrefreshlayout.