Comments (3)
我也遇到一样的问题,如果设置其他的渐变颜色,开始角度会从360度开始
from arcseekbar.
我修改成这样,能解决问题
/**
* 设置进度颜色(通过着色器实现渐变色)
* @param colors
*/
public void setProgressColor(int... colors){
if(isMeasureCircle){
Shader shader = new SweepGradient(mCircleCenterX,mCircleCenterX,colors,null);
Matrix matrix = new Matrix();
matrix.setRotate(-90, mCircleCenterX,mCircleCenterX);
shader.setLocalMatrix(matrix);
setShader(shader);
}else{
mShaderColors = colors;
isShader = true;
}
}
from arcseekbar.
我修改成这样,能解决问题
/** * 设置进度颜色(通过着色器实现渐变色) * @param colors */ public void setProgressColor(int... colors){ if(isMeasureCircle){ Shader shader = new SweepGradient(mCircleCenterX,mCircleCenterX,colors,null); Matrix matrix = new Matrix(); matrix.setRotate(-90, mCircleCenterX,mCircleCenterX); shader.setLocalMatrix(matrix); setShader(shader); }else{ mShaderColors = colors; isShader = true; } }
setProgressColor(int... colors)
只是一个传入多颜色的方式(内部实例化一个默认的着色器)来实现渐变;如果默认的着色器的渐变效果满足不了你的需求,你完全可以要自定义着色器(包括渐变色的角度区间)来实现你想要的渐变效果,直接使用setShader(Shader shader)
即可。
from arcseekbar.
Related Issues (9)
- 渐变效果怎么设置 HOT 1
- 有时候拖动0的拖不到 只能拖到1%或者2% HOT 2
- 设置渐变色无效 HOT 2
- 渐变色的设置 HOT 1
- 建议可以对arcEnabledSingle增加在代码中调用的方法 HOT 2
- 一个优化建议:onProgressChanged() 回调重复问题
- 进度色和背景色之间可以留一些间距吗
- thumb可以拓展一下Drawable吗? HOT 1
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 arcseekbar.