├── ExpandedCircleProgressExample ├── .classpath ├── .project ├── AndroidManifest.xml ├── ic_launcher-web.png ├── libs │ └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── layout │ │ ├── activity_main.xml │ │ └── fragment_main.xml │ ├── values-w820dp │ │ └── dimens.xml │ └── values │ │ ├── dimens.xml │ │ └── strings.xml └── src │ └── com │ └── example │ └── expandedcircleprogressexample │ └── MainActivity.java ├── ExpandedCircleProgressView ├── .classpath ├── .project ├── AndroidManifest.xml ├── libs │ └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res │ └── values │ │ └── attrs.xml └── src │ └── com │ └── tigerlee │ └── widget │ └── ExpandedCircleProgressView.java ├── README.md └── screenshots ├── sample_01.png ├── sample_02.png └── sample_animation.gif /ExpandedCircleProgressExample/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExpandedCircleProgressExample 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressExample/ic_launcher-web.png -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressExample/libs/android-support-v4.jar -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library.reference.1=../ExpandedCircleProgressView 16 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressExample/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressExample/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressExample/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressExample/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 26 | 27 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ExpandedCircleProgressExample 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /ExpandedCircleProgressExample/src/com/example/expandedcircleprogressexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.expandedcircleprogressexample; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.app.FragmentActivity; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import com.tigerlee.widget.ExpandedCircleProgressView; 12 | 13 | public class MainActivity extends FragmentActivity { 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_main); 19 | if (savedInstanceState == null) { 20 | getSupportFragmentManager().beginTransaction().add(R.id.container, new ExtendedCircleFragment()).commit(); 21 | } 22 | } 23 | 24 | public class ExtendedCircleFragment extends Fragment { 25 | 26 | private ExpandedCircleProgressView mCircleProgressView; 27 | protected int mProgress = 0; 28 | private Handler mHandler = new Handler() { 29 | private boolean mIsDecresed = false; 30 | 31 | public void handleMessage(android.os.Message msg) { 32 | 33 | if (mProgress == 60 && !mIsDecresed) { 34 | mProgress = mProgress - 20; 35 | mIsDecresed = true; 36 | } else { 37 | mProgress = mProgress + 20; 38 | } 39 | mCircleProgressView.setProgress(mProgress); 40 | if(mProgress<100) sendEmptyMessageDelayed(0, 1000); 41 | }; 42 | }; 43 | 44 | public ExtendedCircleFragment() { 45 | } 46 | 47 | @Override 48 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 49 | Bundle savedInstanceState) { 50 | View rootView = inflater.inflate(R.layout.fragment_main, container, 51 | false); 52 | mCircleProgressView = (ExpandedCircleProgressView) rootView.findViewById(R.id.expanded_circle_progress); 53 | mHandler.sendEmptyMessageDelayed(0, 1000); 54 | return rootView; 55 | } 56 | 57 | @Override 58 | public void onDestroy() { 59 | super.onDestroy(); 60 | // you must call this method to avoid expanding forever 61 | if(mCircleProgressView!=null) mCircleProgressView.cancelUpdateTask(); 62 | } 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExpandedCircleProgressView 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/ExpandedCircleProgressView/libs/android-support-v4.jar -------------------------------------------------------------------------------- /ExpandedCircleProgressView/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library=true 16 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ExpandedCircleProgressView/src/com/tigerlee/widget/ExpandedCircleProgressView.java: -------------------------------------------------------------------------------- 1 | package com.tigerlee.widget; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.Paint; 7 | import android.os.AsyncTask; 8 | import android.util.AttributeSet; 9 | import android.view.View; 10 | 11 | public class ExpandedCircleProgressView extends View { 12 | 13 | private static final String TAG = "ExpandedCircleProgressView"; 14 | 15 | private class Circle { 16 | float radius; 17 | float centerX; 18 | float centerY; 19 | 20 | Circle(float x, float y, float innerCircleSize) { 21 | this.radius = innerCircleSize; 22 | this.centerX = x; 23 | this.centerY = y; 24 | } 25 | } 26 | 27 | private Paint mProgressCirclePaint; 28 | private Circle mProgressCircle; 29 | 30 | private Paint mInnerCirclePaint; 31 | private Circle mInnerCircle; 32 | 33 | private Paint mTextPaint; 34 | private String mCurrentProgress = "0%"; 35 | 36 | private Paint mOuterCirclePaint; 37 | private Circle mOuterCircle; 38 | 39 | private static int SLEEP_TIME = 8; 40 | private static float INCRESING_SIZE = 4; 41 | 42 | private ProgressUpdateTask mUpdateTask; 43 | 44 | private float mInnerCircleSize; 45 | private float mOuterCircleSize; 46 | 47 | private int mInnerCircleColor; 48 | private int mOuterCircleColor; 49 | private int mProgressCircleColor; 50 | private int mTextProgressColor; 51 | 52 | private float mOuterCircleLineWidth; 53 | 54 | private float mTextSize; 55 | 56 | private final static int MAX_PROGRESS = 100; 57 | 58 | public ExpandedCircleProgressView(final Context context) { 59 | super(context); 60 | init(context, null); 61 | } 62 | 63 | public ExpandedCircleProgressView(final Context context, 64 | final AttributeSet attrs) { 65 | super(context, attrs); 66 | init(context, attrs); 67 | } 68 | 69 | public ExpandedCircleProgressView(final Context context, 70 | final AttributeSet attrs, final int defStyle) { 71 | super(context, attrs, defStyle); 72 | init(context, attrs); 73 | } 74 | 75 | public void init(final Context context, AttributeSet attrs) { 76 | 77 | TypedArray a = context.getTheme().obtainStyledAttributes(attrs, 78 | R.styleable.ExpandedCircleProgressView, 0, 0); 79 | try { 80 | // Retrieve the values from the TypedArray and store into 81 | // fields of this class. 82 | mInnerCircleSize = a.getDimension( 83 | R.styleable.ExpandedCircleProgressView_innerCircleSize, 84 | 0.0f); 85 | 86 | mOuterCircleSize = a.getDimension( 87 | R.styleable.ExpandedCircleProgressView_outerCircleSize, 88 | 0.0f); 89 | 90 | mInnerCircleColor = a.getColor( 91 | R.styleable.ExpandedCircleProgressView_innerCircleColor, 92 | 0xff000000); 93 | mOuterCircleColor = a.getColor( 94 | R.styleable.ExpandedCircleProgressView_outerCircleColor, 95 | 0xff000000); 96 | mProgressCircleColor = a.getColor( 97 | R.styleable.ExpandedCircleProgressView_progressCircleColor, 98 | 0xff000000); 99 | 100 | mOuterCircleLineWidth = a 101 | .getDimension( 102 | R.styleable.ExpandedCircleProgressView_outerCircleLineWidth, 103 | 0.5f); 104 | 105 | mTextSize = a.getDimension( 106 | R.styleable.ExpandedCircleProgressView_textProgressSize, 107 | 0.0f); 108 | 109 | mTextProgressColor = a.getColor( 110 | R.styleable.ExpandedCircleProgressView_textProgressColor, 111 | 0xff000000); 112 | } finally { 113 | // release the TypedArray so that it can be reused. 114 | a.recycle(); 115 | } 116 | INCRESING_SIZE = (mOuterCircleSize - mInnerCircleSize) / 100; 117 | SLEEP_TIME = (int) (INCRESING_SIZE * 1500 / mOuterCircleSize); 118 | 119 | mProgressCirclePaint = new Paint(); 120 | mProgressCirclePaint.setColor(mProgressCircleColor); 121 | mProgressCirclePaint.setFlags(Paint.ANTI_ALIAS_FLAG); 122 | mProgressCirclePaint.setStyle(Paint.Style.FILL); 123 | 124 | mInnerCirclePaint = new Paint(); 125 | mInnerCirclePaint.setColor(mInnerCircleColor); 126 | mInnerCirclePaint.setFlags(Paint.ANTI_ALIAS_FLAG); 127 | mInnerCirclePaint.setStyle(Paint.Style.FILL); 128 | 129 | mOuterCirclePaint = new Paint(); 130 | mOuterCirclePaint.setColor(mOuterCircleColor); 131 | mOuterCirclePaint.setFlags(Paint.ANTI_ALIAS_FLAG); 132 | mOuterCirclePaint.setStrokeWidth(mOuterCircleLineWidth); 133 | mOuterCirclePaint.setStyle(Paint.Style.STROKE); 134 | 135 | mTextPaint = new Paint(); 136 | mTextPaint.setColor(mTextProgressColor); 137 | mTextPaint.setTextAlign(Paint.Align.CENTER); 138 | mTextPaint.setTextSize(mTextSize); 139 | 140 | cancelUpdateTask(); 141 | } 142 | 143 | /** 144 | * Set size of the inner circle 145 | * @param size size of the inner circle 146 | */ 147 | public void setInnerCircleSize(int size){ 148 | mInnerCircleSize = size; 149 | INCRESING_SIZE = (mOuterCircleSize - mInnerCircleSize) / 100; 150 | } 151 | /** 152 | * Set size of the outer circle 153 | * @param size size of the outer circle 154 | */ 155 | public void setOuterCircleSize(int size){ 156 | mOuterCircleSize = size; 157 | INCRESING_SIZE = (mOuterCircleSize - mInnerCircleSize) / 100; 158 | SLEEP_TIME = (int) (INCRESING_SIZE * 1500 / mOuterCircleSize); 159 | } 160 | 161 | /** 162 | * Set color of the inner circle 163 | * @param color color of the inner circle 164 | */ 165 | public void setInnerCircleColor(int color) { 166 | mInnerCircleColor = color; 167 | } 168 | 169 | /** 170 | * Set color of the outer circle 171 | * @param color color of the outer circle 172 | */ 173 | public void setOuterCircleColor(int color) { 174 | mOuterCircleColor = color; 175 | } 176 | 177 | /** 178 | * Set color of the progress text 179 | * @param color color of the progress text 180 | */ 181 | public void setProgressTextColor(int color) { 182 | mTextProgressColor = color; 183 | } 184 | 185 | /** 186 | * Set color of circle of expanding progress 187 | * @param color color of circle of expanding progress 188 | */ 189 | public void setProgresColor(int color) { 190 | mProgressCircleColor = color; 191 | } 192 | 193 | /** 194 | * Set width of the outer circle line 195 | * @param width width of the outer circle line 196 | */ 197 | public void setOuterCircleLineWidth(int width) { 198 | mOuterCircleLineWidth = width; 199 | } 200 | 201 | /** 202 | * Set size of the progress text 203 | * @param size size of the progress text 204 | */ 205 | public void setTextProgressSize(int size) { 206 | mTextSize = size; 207 | } 208 | 209 | /** 210 | * get maximum value of progress 211 | * @return maximum value of progress 212 | */ 213 | public int getMaxProgress() { 214 | return MAX_PROGRESS; 215 | } 216 | 217 | /** 218 | * set current progress 219 | * @param progress set progress from 0 to max progress(100) 220 | */ 221 | public void setProgress(int progress) { 222 | if (mUpdateTask != null) 223 | mUpdateTask.cancel(true); 224 | if (progress > MAX_PROGRESS) 225 | return; 226 | int size = (int) (progress * INCRESING_SIZE + mInnerCircleSize); 227 | 228 | mUpdateTask = new ProgressUpdateTask(); 229 | mUpdateTask.execute(progress, size); 230 | } 231 | 232 | @Override 233 | public void onDraw(final Canvas canvas) { 234 | canvas.drawCircle(mProgressCircle.centerX, mProgressCircle.centerY, 235 | mProgressCircle.radius, mProgressCirclePaint); 236 | canvas.drawCircle(mInnerCircle.centerX, mInnerCircle.centerY, 237 | mInnerCircle.radius, mInnerCirclePaint); 238 | canvas.drawCircle(mOuterCircle.centerX, mOuterCircle.centerY, 239 | mOuterCircle.radius, mOuterCirclePaint); 240 | canvas.drawText(mCurrentProgress, mInnerCircle.centerX, 241 | mInnerCircle.centerY, mTextPaint); 242 | } 243 | 244 | @Override 245 | protected void onMeasure(final int widthMeasureSpec, 246 | final int heightMeasureSpec) { 247 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 248 | } 249 | 250 | @Override 251 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 252 | super.onSizeChanged(w, h, oldw, oldh); 253 | int x = w / 2; 254 | int y = h / 2; 255 | 256 | mProgressCircle = new Circle(x, y, mInnerCircleSize); 257 | mInnerCircle = new Circle(x, y, mInnerCircleSize); 258 | mOuterCircle = new Circle(x, y, mOuterCircleSize); 259 | } 260 | 261 | public class ProgressUpdateTask extends 262 | AsyncTask { 263 | 264 | @Override 265 | protected void onPreExecute() { 266 | super.onPreExecute(); 267 | } 268 | 269 | @Override 270 | protected Integer doInBackground(Integer... params) { 271 | if (mProgressCircle == null) 272 | return null; 273 | int progress = params[0]; 274 | int size = params[1]; 275 | 276 | if (progress >= 100) 277 | progress = 100; 278 | 279 | boolean isIncresing = mProgressCircle.radius <= size; 280 | while (continueLoop(isIncresing, size)) { 281 | // exit loop if asynctask is cancelled 282 | if (isCancelled()) 283 | break; 284 | 285 | if (isIncresing) 286 | mProgressCircle.radius += INCRESING_SIZE; 287 | else 288 | mProgressCircle.radius -= INCRESING_SIZE; 289 | 290 | publishProgress(progress); 291 | try { 292 | Thread.sleep(SLEEP_TIME); 293 | } catch (InterruptedException e) { 294 | e.printStackTrace(); 295 | } 296 | } 297 | return progress; 298 | } 299 | 300 | private boolean continueLoop(boolean isIncresing, int size) { 301 | if (isIncresing) 302 | return mProgressCircle.radius <= size; 303 | else 304 | return mProgressCircle.radius >= size; 305 | } 306 | 307 | @Override 308 | protected void onProgressUpdate(Integer... values) { 309 | super.onProgressUpdate(values); 310 | int value = values[0]; 311 | mCurrentProgress = value + "%"; 312 | invalidate(); 313 | } 314 | 315 | @Override 316 | protected void onPostExecute(Integer result) { 317 | super.onPostExecute(result); 318 | if (result != null) 319 | mCurrentProgress = result + "%"; 320 | } 321 | } 322 | 323 | /** 324 | * Cancel updating progress task 325 | */ 326 | public void cancelUpdateTask() { 327 | if (mUpdateTask != null) 328 | mUpdateTask.cancel(true); 329 | } 330 | 331 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ExpandedCircleProgressView 2 | ========================== 3 | 4 | this is a android-custom view to show progressing with an expanded circle. 5 | 6 | ![Sample ExpandedCircleProgressView](https://raw.github.com/tigerjj/ExpandedCircleProgressView/master/screenshots/sample_animation.gif) 7 | ![ExpandedCircleProgressView](https://raw.github.com/tigerjj/ExpandedCircleProgressView/master/screenshots/sample_01.png) 8 | 9 | 10 | ## Overview 11 | **ExpandedCircleProgressView**, helps you to show progress with expading circle with smooth animation. 12 | 13 | ### Usage 14 | 15 | Add ExpandedCircleProgressView namespace on the top element : 16 | 17 | xmlns:tigerlee="http://schemas.android.com/apk/res-auto" 18 | 19 | Add namespace of ExpandedCircleProgressView : 20 | 21 | 25 | 26 | 27 | #### Supported Attributs 28 | 29 | declare-styleable : 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | Detail role of attributes : 43 | 44 | | XML Attribute | Java Attribute | Description | 45 | | ------------- |:-------------:| -----:| 46 | | tigerlee:innerCircleSize | setInnerCircleSize(int) | Set size of the inner circle | 47 | | tigerlee:outerCircleSize | setOuterCircleSize(int)| Set size of the inner circle | 48 | | tigerlee:innerCircleColor | setInnerCircleColor(int) | Set color of the inner circle | 49 | | tigerlee:outerCircleColor | setOuterCircleColor(int) | Set color of the outer circle | 50 | | tigerlee:textProgressColor | setProgressTextColor(int) | Set color of the progress text | 51 | | tigerlee:progressCircleColor | setProgresColor(int) | Set color of circle of expanding progress | 52 | | tigerlee:outerCircleLineWidth | setOuterCircleLineWidth(int) | Set width of the outer circle line | 53 | | tigerlee:textProgressSize | setTextProgressSize(int) | Set size of the progress text | 54 | 55 | #### Sample 56 | 57 | Please follow these steps 58 | 59 | ![SampleResult](https://raw.github.com/tigerjj/ExpandedCircleProgressView/master/screenshots/sample_02.png) 60 | 61 | Add expandedeCircleProgress view on layout : 62 | 63 | android:id="@+id/expanded_circle_progress" 64 | android:layout_centerInParent="true" 65 | android:layout_width="match_parent" 66 | android:layout_height="match_parent" 67 | tigerlee:innerCircleSize="40dp" 68 | tigerlee:outerCircleSize="100dp" 69 | tigerlee:innerCircleColor="@android:color/holo_orange_light" 70 | tigerlee:outerCircleColor="@android:color/black" 71 | tigerlee:outerCircleLineWidth="1dp" 72 | tigerlee:progressCircleColor="@android:color/holo_orange_light" 73 | tigerlee:textProgressColor="@android:color/white" 74 | tigerlee:textProgressSize="20sp" 75 | 76 | Get view from findbprogress with int value : 77 | 78 | ```java 79 | mCircleProgressView = (ExpandedCircleProgressView) rootView.findViewById(R.id.expanded_circle_progress); 80 | ``` 81 | Set progress : 82 | 83 | ```java 84 | mCircleProgressView.setProgress(mProgress); 85 | ``` 86 | 87 | ### Qustion? 88 | 89 | Horyun Lee 90 | 91 | Feel free to email at 92 | -------------------------------------------------------------------------------- /screenshots/sample_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/screenshots/sample_01.png -------------------------------------------------------------------------------- /screenshots/sample_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/screenshots/sample_02.png -------------------------------------------------------------------------------- /screenshots/sample_animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerjj/ExpandedCircleProgressView/3c48c3779a5f536e4b130611e6be5dfa6eabbd8a/screenshots/sample_animation.gif --------------------------------------------------------------------------------