androidmsky / randomtextview Goto Github PK
View Code? Open in Web Editor NEW滚动显示TextView的数字,支持自定义每个字符速度。欢迎star,fork,Issues。v1.4
滚动显示TextView的数字,支持自定义每个字符速度。欢迎star,fork,Issues。v1.4
private ValueAnimator.AnimatorUpdateListener animatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if (animating) {
for (int j = 0; j < numLength; j++) {
speedSum[j] -= speedList[j];
}
invalidate();
} else {
stopAnimatorLoop();
}
}
};
这里 stopAnimatorLoop(); 为啥不改标记位置animating=false
怎么设置都是居左的,怎么居中呢?
我这边如果数字里面有1,最后一个数字又不是1,最后一个数字会显示不完整,比如123,3就显示不完整
if (autoOverLine == numLength * 2 - 1) {
stopAnimatorLoop();
//invalidate();
animating = false;
}
需要注释掉invalidate(); 不然一直递归调用
我用了一种方法,在drawNumber()里,
if (auto == numLength * 2 - 1){
this.auto = false;
handler.removeCallbacks(task);
//加上如下判断,在结束延时动画后,不在调用绘制功能,可以解决动画停止后还一直绘制问题,
你看一下是否可行,或你的处理方式
if(this.auto){
invalidate();
}
}
连续多运行几次之后速度变快是啥原因
第一次进来 默认一个数字 不滚动 直接显示的 之后又操作 有变化 此开始滚动变化 最开始的默认数字不显示
这个作为textview的背景图,我怎么样让每个数都居中?设置textscale的话,放大N倍 是可以达到居中的效果,但是文字样式就不好控制了,设置android:lineSpacingExtra和android:lineSpacingMultiplier 但是没有作用
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.