Comments (16)
什么场景下会需要多次调用start?
是同个时间还是不同时间
from countdownview.
不同的时间。场景如下:商品销售倒计时页面会有下拉刷新功能,用户多次刷新的话得到的时间是不一样的,逻辑上刷新结束之后应该先停止当前倒计时然后开始新的倒计时
from countdownview.
试下先stop再start
from countdownview.
已经尝试过,是无效的。
from countdownview.
呃,我测试没有重现出来,可以提供一下对应代码及重现步骤吗?
from countdownview.
在RecyclerView的item中,重绘后也会出现停止倒计时,adpater用的是BaseRecyclerViewAdapterHelper。
demo里设置太繁琐了。
from countdownview.
@Calamus-Cajan rv和lv不可以调用start喔,要自己控制所有时间的倒计时,然后调用updateShow方法来更新显示
from countdownview.
@iwgang CountdownView控件要和item一一对应存起来吗?
from countdownview.
@Calamus-Cajan 具体参照Demo吧,没多复杂,只是把倒计时任务和和CountdownView分离,然后不间隔去刷新CountdownView显示而已
否则如果使用start,创建的倒计时任务在滚动后会被回收,加上重复创建同一个item的倒计时任务,性能受很大影响
from countdownview.
@iwgang 我参照demo试试
from countdownview.
这个会不会造成内存泄漏啊,比如我一个页面有不少这种倒计时控件,类似那种抢购。感觉非常占内存吧,页面多的话!
from countdownview.
@xiaokun19931126
不会,不同场景下都有提供Demo,如果实在怕泄露,可以自己去做计时器逻辑,把CountdownView只作UI显示组件来使用
from countdownview.
@Calamus-Cajan 你在BaseRecyclerViewAdapterHelper这里面用的时候有BIG吗?我用的新版分页的时候有bug
from countdownview.
@mrchenmo BIG?没什么问题,不过逻辑是自己写的,跟作者的不一样。总的来说,包括BaseRecyclerViewAdapterHelper都有坑
from countdownview.
@Calamus-Cajan 哦哦,我参照作者的逻辑写的然后分页的时候有点BUG还没解决,你的倒计时的逻辑代码可以贴出来参考一下吗?我用的也是BaseRecyclerViewAdapterHelper。
from countdownview.
@mrchenmo _(:з」∠)_现在才发现。就像作者所说的,重要的是倒计时的逻辑,要么后台帮你计算好了时间,要么自己更新时间,item里CountdownView要一一对应。
from countdownview.
Related Issues (20)
- 请问为什么切换fragment后没有进入倒计时结束事件 HOT 1
- Is there any method to manually check remaining milliSec after custom time? HOT 1
- RecyclerView列表,倒计时结束问题 HOT 5
- 希望可以支持自定义字体
- 博主救急 HOT 2
- setConvertDaysToHours(true) HOT 2
- 能否将suffix和timeText对齐 HOT 1
- isConvertDaysToHours设置为true后 再次DynamicConfig未设置会置false
- time background not showing HOT 1
- How to show suffix and time in same background?
- 怎么获取具体的天 小时 分钟 这些参数呢
- request: Flip animation
- 功能是否包含计时器功能,Chronometer只能精确到秒,不太理想
- 如果后台返回的是一个时间戳,该怎么转呢?
- 为什么设置了isShowDay="true",天数小于0的时候,不隐藏"00天"呢? HOT 2
- 秒这个文字,最右边有一点点没有显示完全,咋解决?
- isShowTimeBgBorder无效,边框没显示
- 急急急! isHideTimeBackground 不支持动态改变??
- 请问只显示秒的情况下,怎么设置显示三位数
- 手机锁屏之后,倒计时会暂停吗?
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 countdownview.