Giter VIP home page Giter VIP logo

sweepgradientprogress's Introduction

SweepGradientProgress

SweepGradientProgress--圆形颜色渐变的进度条(学习使用SweepGradient) 圆形的渐变进度条

代码很烂,只是练习下如何写自定义控件

2015年12月6日19:29:38 如何设置进度:

myProgress = myProgress + 10;
progress.setProgress(myProgress);
handler.sendEmptyMessageDelayed(1, 1000);

增加填充颜色的方法setArcColors:

int[] arcColors = new int[]{
			Color.parseColor("#99cccc"),
			Color.parseColor("#ccffff"),
			Color.parseColor("#ffcccc"),
			Color.parseColor("#6699cc"),
			Color.parseColor("#99ccff"),
			Color.parseColor("#6699cc"),
			Color.parseColor("#cc6699"),
			Color.parseColor("#ffff00")
	};
	progress.setArcColors(arcColors );

效果如下:

填充颜色progress

其实最好把数组里面第一个颜色值 = 最后一个颜色值,过渡能自然点,否则就像上面你看到的那么丑: 如下设置:

int[] arcColors = new int[]{
			Color.parseColor("#99cccc"),
			Color.parseColor("#ccffff"),
			Color.parseColor("#ffcccc"),
			Color.parseColor("#6699cc"),
			Color.parseColor("#99ccff"),
			Color.parseColor("#6699cc"),
			Color.parseColor("#cc6699"),
			Color.parseColor("#99cccc")
	};

看下效果:

enter description here

卧槽,就像加了特效,duang! duang !duang,完美

博客地址: http://www.cnblogs.com/androidsuperman/p/5021872.html

sweepgradientprogress's People

Contributors

soyoungboy avatar

Watchers

James Cloos avatar  avatar

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.