Skip to content

Commit dd9d5c8

Browse files
Initial commit
Huge refactor from MaterialCircularProgressView. Android Studio hates me so making a new project was just easier.
0 parents  commit dd9d5c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1501
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.gradle
2+
/local.properties
3+
/.idea/workspace.xml
4+
/.idea/libraries
5+
.DS_Store
6+
/build

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scopes/scope_settings.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CircularProgressView.iml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
</configuration>
8+
</facet>
9+
</component>
10+
<component name="NewModuleRootManager" inherit-compiler-output="true">
11+
<exclude-output />
12+
<content url="file://$MODULE_DIR$">
13+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
14+
</content>
15+
<orderEntry type="jdk" jdkName="JDK" jdkType="JavaSDK" />
16+
<orderEntry type="sourceFolder" forTests="false" />
17+
</component>
18+
</module>
19+

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) 2014 undefined
2+
3+
This software is released under the MIT license:
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Material CircularProgressView
2+
3+
| Indeterminate | Determinate |
4+
|:-------------:|:-----------:|
5+
| ![Sample Indeterminate GIF](https://raw.github.com/rahatarmanahmed/MaterialCircularProgressView/master/gif/sampleIndeterminate.gif) | ![Sample Determinate GIF](https://raw.github.com/rahatarmanahmed/MaterialCircularProgressView/master/gif/sampleDeterminate.gif) |
6+
7+
## Description
8+
9+
This CircularProgressView is a (surprisingly) circular progress bar Android View that is designed to imitate the Material versions of ProgressBar. These versions can be seen on [this page](http://www.google.com/design/spec/components/progress-activity.html#progress-activity-types-of-indicators) of the Material design spec under Circular indicators.
10+
11+
## Usage
12+
13+
To use CircularProgressView you must add it as a dependency in your Gradle build:
14+
15+
(The project is not yet set up in the maven central repo so wait until I do that)
16+
17+
```groovy
18+
dependencies {
19+
compile 'com.freek:materialcircularprogressview:1.0.0+'
20+
}
21+
```
22+
23+
Then add the view to your layout:
24+
25+
```xml
26+
<com.freek.materialcircularprogressview.CircularProgressView
27+
xmlns:app="http://schemas.android.com/apk/res-auto"
28+
android:id="@+id/progress_view"
29+
android:layout_width="40dp"
30+
android:layout_height="40dp"
31+
app:cpv_indeterminate="true"/>
32+
```
33+
34+
## XML attributes
35+
36+
| Name | Type | Default | Description |
37+
|:----:|:----:|:-------:|:-----------:|
38+
| cpv_progress | float | 0 | The current progress of the progress bar. |
39+
| cpv_maxProgress | float | 100 | The maximum progress of the progress bar; what's considered as 100% of the bar. |
40+
| cpv_thickness | dimension | 4px | The thickness of the progress bar. |
41+
| cpv_color | color | Material Blue 500 (#2196F3) | The color of the progress bar. |
42+
| cpv_indeterminate | boolean | false | Whether this progress bar is indeterminate or not. If indeterminate, the progress set on this view will not have any effect. |
43+
| cpv_animDuration | integer | 4000 | The duration of the progress bar animation in milliseconds. If the bar is determinate, it is the duration of the initial spin animation. If indeterminate, it is the duration of all "steps" of the indeterminate animation. |
44+
| cpv_animSteps | integer | 3 | The number of "steps" in the indeterminate animation (how many times it does the loopy thing before returning to its original position). It is recommended to use an odd number, as even numbers of steps look the same after half the number of steps. |
45+
| cpv_animAutostart | boolean | true | Whether this progress bar should automatically start animating once it is initialized. |
46+
47+
## Public Methods
48+
49+
| Name | Description |
50+
|:----:|:-----------:|
51+
| isIndeterminate() | Returns true if the progress bar is indeterminate, false if determinate. |
52+
| setIndeterminate(boolean) | Set whether this progress bar is indeterminate or not. Will reset the animation if the value changes |
53+
| getThickness() | Gets the thickness of the progress bar. |
54+
| setThickness(int) | Sets thickness of the progress bar. |
55+
| getColor() | Gets the color of the progress bar. |
56+
| setColor(int) | Sets the color of the progress bar. |
57+
| getMaxProgress() | Gets the maximum progress of the progress bar. |
58+
| setMaxProgress(float) | Sets the maximum progress of the progress bar. |
59+
| getProgress() | Gets the current progress of the progress bar. |
60+
| setProgress(float) | Sets the current progress of the progress bar. (Will linearly animate the update.) |
61+
| startAnimation() | Starts the animation of the progress bar. (Alias of resetAnimation().) |
62+
| resetAnimation() | Resets the animation of the progress bar. |

build.gradle

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:0.13.2'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}

circularprogressview/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

circularprogressview/build.gradle

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 21
5+
buildToolsVersion "21.1.1"
6+
7+
defaultConfig {
8+
applicationId "com.github.rahatarmanahmed.cpv"
9+
minSdkVersion 14
10+
targetSdkVersion 21
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
runProguard false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
}
25+
26+
apply from: './gradle-mvn-push.gradle'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="CircularProgressView" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":circularprogressview" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
13+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
14+
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
15+
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
16+
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
17+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
18+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
19+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
20+
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
21+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
22+
<option name="LIBRARY_PROJECT" value="true" />
23+
</configuration>
24+
</facet>
25+
</component>
26+
<component name="NewModuleRootManager" inherit-compiler-output="false">
27+
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
28+
<exclude-output />
29+
<content url="file://$MODULE_DIR$">
30+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
31+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
32+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
33+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
40+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
41+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
42+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
43+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
44+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
45+
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
46+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
61+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
62+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
63+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
64+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
65+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
66+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
67+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
68+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
69+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
70+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
71+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
72+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
73+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
74+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
76+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
77+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
78+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
80+
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
82+
</content>
83+
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
84+
<orderEntry type="sourceFolder" forTests="false" />
85+
</component>
86+
</module>
87+

0 commit comments

Comments
 (0)