├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mrzk │ │ │ └── example │ │ │ └── MainActivity.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── mrzk │ └── oading │ └── ExampleUnitTest.java ├── build.gradle ├── circleloadinglibrary ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── mrzk │ │ └── circleloadinglibrary │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mrzk │ │ │ └── circleloadinglibrary │ │ │ └── CircleLoadingView.java │ └── res │ │ └── values │ │ ├── attrs.xml │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── mrzk │ └── circleloadinglibrary │ └── ExampleUnitTest.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | CircleLoading -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![这里写图片描述](http://img.blog.csdn.net/20160728124114283) 2 | 3 | 进度的刻度、宽度、颜色可以随意设定: 4 | 5 | ![进度环](http://img.blog.csdn.net/20160730120609367) 6 | 7 | 8 | 9 | attrs.xml: 10 | ``` 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | ``` 25 | ###使用 26 | 27 | layout文件: 28 | ``` 29 | xmlns:app="http://schemas.android.com/apk/res-auto" 30 | 31 | 46 | ``` 47 | 48 | ``` 49 | int[] colors = {0xFFE5BD7D, 0xFFFAAA64, 50 | 0xFFFFFFFF, 0xFF6AE2FD, 51 | 0xFF8CD0E5, 0xFFA3CBCB, 52 | 0xFFBDC7B3, 0xFFD1C299, 0xFFE5BD7D}; 53 | lv_loading.setTextColor(Color.BLACK);//设置中心文字颜色 54 | lv_loading.setMax(500);//设置最大进度 55 | lv_loading.setShowGraduationBackgroundEnable(true);//是否显示刻度背景 56 | lv_loading.setGraduationBackgroundColor(Color.GRAY);//刻度的背景颜色 57 | lv_loading.setStartAngle(180);//设置开始旋转角度 58 | lv_loading.setGraduationCount(10);//设置刻度数 59 | lv_loading.setGraduationWidth(5);//设置刻度的宽度 60 | lv_loading.setOutColors(colors);//设置外部圆环颜色 61 | lv_loading.setInnerGraduationColors(colors);//设置内部刻度进度颜色 62 | lv_loading.setTextSize(35);//设置内部文字字体大小 63 | lv_loading.setShowOutRollEnable(false);//设置是否显示外部进度框 64 | lv_loading.setOnProgressListener(new OnProgressListener() { 65 | @Override 66 | public String OnProgress(int max, int progress) { 67 | 68 | return progress*100f/max+"%"; 69 | } 70 | }); 71 | ``` 72 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.mrzk.example" 9 | minSdkVersion 21 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.2.0' 26 | compile project(':circleloadinglibrary') 27 | } 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Users\win7\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/mrzk/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.mrzk.example; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.os.Message; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.View; 8 | 9 | import com.mrzk.circleloadinglibrary.CircleLoadingView; 10 | 11 | import java.lang.ref.SoftReference; 12 | 13 | 14 | /** 15 | * Created by win7 on 2016-8-22. 16 | */ 17 | public class MainActivity extends AppCompatActivity { 18 | 19 | private static final int PROGRESS = 1; 20 | CircleLoadingView lv_loading; 21 | int[] colors = {0xFFE5BD7D, 0xFFFAAA64, 22 | 0xFFFFFFFF, 0xFF6AE2FD, 23 | 0xFF8CD0E5, 0xFFA3CBCB, 24 | 0xFFBDC7B3, 0xFFD1C299, 0xFFE5BD7D}; 25 | int progress = 0; 26 | int max = 300; 27 | 28 | private MyHandler mHandler = new MyHandler(this); 29 | class MyHandler extends android.os.Handler{ 30 | SoftReference softReference ; 31 | public MyHandler(Activity activity){ 32 | softReference = new SoftReference(activity); 33 | } 34 | 35 | @Override 36 | public void handleMessage(Message msg) { 37 | if (softReference.get() !=null){ 38 | switch (msg.what){ 39 | case PROGRESS: 40 | progress+=5; 41 | if (progress<=max){ 42 | lv_loading.setProgress(progress); 43 | mHandler.sendEmptyMessageDelayed(PROGRESS,200); 44 | } 45 | break; 46 | } 47 | } 48 | } 49 | } 50 | 51 | @Override 52 | protected void onCreate(Bundle savedInstanceState) { 53 | super.onCreate(savedInstanceState); 54 | setContentView(R.layout.activity_main); 55 | 56 | lv_loading = (CircleLoadingView) findViewById(R.id.clv_loading); 57 | lv_loading.setOutColors(colors);//设置外部圆环颜色 58 | lv_loading.setMax(max); 59 | lv_loading.setOnProgressListener(new CircleLoadingView.OnProgressListener() { 60 | @Override 61 | public String OnProgress(int max, int progress) { 62 | 63 | return (int)(progress * 100f / max) + "%"; 64 | } 65 | }); 66 | } 67 | public void Start(View v){ 68 | progress = 0; 69 | mHandler.removeCallbacksAndMessages(null); 70 | mHandler.sendEmptyMessage(PROGRESS); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 |