Coder Social home page Coder Social logo

Comments (16)

imknown avatar imknown commented on May 30, 2024 1

... 确实 我这里的需求也是 把天数 全部转换为 小时, 比如说 1000小时15分钟02秒, 目前 我也是只是 自己clone 修改源码 加了新的 attr 逻辑了... 有时间 发 pull request

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

@Reagon 是最新的 v2.1.2 吗?

from countdownview.

Reagon avatar Reagon commented on May 30, 2024

是的,因为你是这样写的
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.

iwgang avatar iwgang commented on May 30, 2024

天数3位数有处理,小时不会有3位数阿

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

小时满24,天数+1

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

方便提供一下你的测试代码么

from countdownview.

Reagon avatar Reagon commented on May 30, 2024

不是这个意思,我是指 不显示天数的时候,小时数=天数*24 + 小时数,这样小时数就可能是3位数以上了

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

我上面说了,小时数不会超过24,也不会出现3位数

你现在是出现了小时3位数了吗?

from countdownview.

Reagon avatar Reagon commented on May 30, 2024

我的倒计时比如有6天4小时20分钟30秒, 显示成 00小时:00分钟:00 秒 这种形式, 不能不计算天数啊 6*24 + 4 :20 :30 这样小时数就出现3位以上的数字了

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

你还没明白我的意思,这个库小时设了上限为24,满就天数加1,不支持如 48 : 55 : 00 的显示

建议先调试运行看库的支持程度

from countdownview.

Reagon avatar Reagon commented on May 30, 2024

恩,我明白,你的库写的非常强大了

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

很多需求东西没办法集成进去,因为判断太多了,前期构建时没有考虑太完善

像现在如果集成小时数累加,就得支持分钟数累加,甚至秒钟, 这一系列判断改下来估计还不如从新写个定制需求的版本

当然也很感谢提 is ,有好的建议可以帮提 is 甚至 pr.

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

@imknown 期待你的 PR

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

@imknown 感谢你的 PR,等下我就合上去,更新一个版本

我之前想太复杂了,主要是想兼容背景模式下的显示,现在看来其实背景模式下的场景应该不多,纯文本的场景会多点。

from countdownview.

imknown avatar imknown commented on May 30, 2024

@iwgang 谢谢你 这个库 已经可以满足 绝大部分 产品狗的需求了 :D
我刚才 才看到 居然有 中文文档, 忘记更新了...

from countdownview.

iwgang avatar iwgang commented on May 30, 2024

@imknown
没事,那个我晚上会更新,还针对你的pr增加了一些动态的配置

from countdownview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.