Comments (16)
... 确实 我这里的需求也是 把天数 全部转换为 小时, 比如说 1000小时15分钟02秒, 目前 我也是只是 自己clone 修改源码 加了新的 attr 逻辑了... 有时间 发 pull request
from countdownview.
@Reagon 是最新的 v2.1.2 吗?
from countdownview.
是的,因为你是这样写的
protected void initTimeTextBaseInfo() {
// initialize time text width and height
Rect rect = new Rect();
mTimeTextPaint.getTextBounds("00", 0, 2, rect);
mTimeTextWidth = rect.width();
mTimeTextHeight = rect.height();
mTimeTextBottom = rect.bottom;
}
mTimeTextPaint.getTextBounds("00", 0, 2, rect); "00"这个就决定了宽度 ,三位以上的时候就超出范围了
from countdownview.
天数3位数有处理,小时不会有3位数阿
from countdownview.
小时满24,天数+1
from countdownview.
方便提供一下你的测试代码么
from countdownview.
不是这个意思,我是指 不显示天数的时候,小时数=天数*24 + 小时数,这样小时数就可能是3位数以上了
from countdownview.
我上面说了,小时数不会超过24,也不会出现3位数
你现在是出现了小时3位数了吗?
from countdownview.
我的倒计时比如有6天4小时20分钟30秒, 显示成 00小时:00分钟:00 秒 这种形式, 不能不计算天数啊 6*24 + 4 :20 :30 这样小时数就出现3位以上的数字了
from countdownview.
你还没明白我的意思,这个库小时设了上限为24,满就天数加1,不支持如 48 : 55 : 00 的显示
建议先调试运行看库的支持程度
from countdownview.
恩,我明白,你的库写的非常强大了
from countdownview.
很多需求东西没办法集成进去,因为判断太多了,前期构建时没有考虑太完善
像现在如果集成小时数累加,就得支持分钟数累加,甚至秒钟, 这一系列判断改下来估计还不如从新写个定制需求的版本
当然也很感谢提 is ,有好的建议可以帮提 is 甚至 pr.
from countdownview.
@imknown 期待你的 PR
from countdownview.
@imknown 感谢你的 PR,等下我就合上去,更新一个版本
我之前想太复杂了,主要是想兼容背景模式下的显示,现在看来其实背景模式下的场景应该不多,纯文本的场景会多点。
from countdownview.
@iwgang 谢谢你 这个库 已经可以满足 绝大部分 产品狗的需求了 :D
我刚才 才看到 居然有 中文文档, 忘记更新了...
from countdownview.
@imknown
没事,那个我晚上会更新,还针对你的pr增加了一些动态的配置
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.