Git Product home page Git Product logo

progress-block-progress-bar-qq's Introduction

progressblock 安卓自定义进度条 progressbar 高仿仿QQ下载进度条.

same to qq download,block,form top to buttom,form left to right,进度块,从左边到右边从上边到下边半透明的效果

主要代码

   progressBlock = (ProgressBlock) findViewById(R.id.progressblock);
		progressBlock.setMaxProgress(count);//最大值可以超过100的,进度只要传递对了进行,会进行换算的
	
			case R.id.btn_switch_orientation:
			progressBlock.setDirection(progressBlock.getDirection()==LinearLayout.HORIZONTAL?LinearLayout.VERTICAL:LinearLayout.HORIZONTAL);
			break;
		case R.id.btn_switch_reverse://反转就是 比如方向是垂直方向那么是从上到下,反正开启则是从下到上,而是水平方向反转为真则是从右到左
			progressBlock.setReverse(!progressBlock.isReverse());
			break;
		case R.id.btn_switch_text_color://设置百分比字体颜色
			progressBlock.setProgressTextColor(v.getTag()==null?Color.GREEN:Color.RED);
			v.setTag(v.getTag()==null?"":null);
			break;
		case R.id.btn_switch_text_orientation:
		TextView tv= progressBlock.getProgressTextView();
		tv.setGravity(tv.getGravity()==Gravity.CENTER?Gravity.TOP:(tv.getGravity()==Gravity.TOP?Gravity.BOTTOM:Gravity.CENTER));
			break;
		case R.id.btn_switch_block_color://设置进度块颜色,要半透明哦 所以这里是rgba的填写
			if(blockflag==0){
				progressBlock.setProgressBlockColor(Color.parseColor("#50ff0000"));
				blockflag=1;
			}else if(blockflag==1){
				progressBlock.setProgressBlockColor(Color.parseColor("#5000ff00"));
				blockflag=2;
			}else {
				blockflag=0;
				progressBlock.setProgressBlockColor(Color.parseColor("#500000ff"));
			}
			break;
		case R.id.btn_switch_text_size://设置进度文本百分比的文本字体大小
			 tv= progressBlock.getProgressTextView();
			if(block_text_size==0){
				tv.setTextSize(10);
				block_text_size=1;
			}else if(block_text_size==1){
				tv.setTextSize(30);
				block_text_size=2;
			}else {
				block_text_size=0;
				tv.setTextSize(50);
			}
   
//具体看截图 截图在最下面
   

联系我共同交流共同进步,图片在下面啦,比较大会截图的可以教教我怎么弄gif,又不影响质量 又速度快哈.

1.imageQQ694886526

2.网站http://qssq.space

image image image image

progress-block-progress-bar-qq's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.