├── .gitignore
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── pnikosis
│ │ └── materialishprogress
│ │ └── sample
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── pnikosis
│ │ └── materialishprogress
│ │ └── sample
│ │ └── MainActivity.java
│ └── 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
│ ├── menu
│ └── menu_main.xml
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── pnikosis
│ │ └── materialishprogress
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── pnikosis
│ │ └── materialishprogress
│ │ └── ProgressWheel.java
│ └── res
│ └── values
│ ├── attrs.xml
│ └── strings.xml
├── settings.gradle
├── spinningwheel.gif
└── spinningwheel_progress.gif
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 | gradle.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | # IntelliJ IDEA modules
30 | *.iml
31 |
32 | # IntelliJ IDEA folder
33 | .idea
34 |
35 | # Maven output folder
36 | target
37 |
38 | # Misc
39 | .DS_Store
40 | Thumbs.db
41 | *.swp
42 | *.bak
43 |
44 | maven_push.gradle
45 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | *Unmantained*
2 | Keeping for the record, there's no need today to support such old versions of Android, I think.
3 |
4 | # Material-ish Progress
5 |
6 | A material style progress wheel compatible with 2.3
7 |
8 | Try the demo app on Google Play:
9 |
10 | [](https://play.google.com/store/apps/details?id=com.pnikosis.materialishprogress.sample)
11 |
12 | I needed to keep a consistent (or as close as possible) look in an app across all Android Versions. The progress wheel is quite cool in Lollipop, and pretty horrible on Gingerbread.
13 |
14 | So I created this. This view uses [Progress Wheel](https://github.com/Todd-Davies/ProgressWheel) as a base, but has been almost completely rewritten (the original view uses handlers for updating the wheel).
15 |
16 | This implementation tries to follow as close as possible the guidelines for the circular progress as [described here](http://www.google.com/design/spec/components/progress-activity.html#progress-activity-types-of-indicators).
17 |
18 | This is how it looks in indeterminate mode (the spinSpeed here is 0.64 which is the default, look below how to change it):
19 |
20 | 
21 |
22 | And in determinate mode (here the spinSpeed is set to 0.333):
23 |
24 | 
25 |
26 | You can also have a linear determinate progress mode if you don't like the animation.
27 |
28 | ## Download
29 |
30 | You can copy the ProgressWheel.java (in the library module) and the attrs.xml content into your project. Or you can get the binaries from Maven central by adding in your build.gradle dependencies:
31 |
32 | ```compile 'com.pnikosis:materialish-progress:1.7'```
33 |
34 | ## Usage
35 |
36 | You can create your own progress wheel in xml like this (remeber to add ```xmlns:wheel="http://schemas.android.com/apk/res-auto"```):
37 |
38 | ```xml
39 |
47 | ```
48 |
49 | Or in code:
50 |
51 | ```Java
52 | ProgressWheel wheel = new ProgressWheel(context);
53 | wheel.setBarColor(Color.BLUE);
54 | ...
55 |
56 | ```
57 |
58 | ### Callback
59 |
60 | Use ```setCallback(ProgressCallback)``` to assign a callback that will be called each time the progress changes. This way you can update a value on the progress alongside with the progress animation, or execute an action once the progress reaches a certain value. in the indeterminatge wheel, the callback is called with a value of -1.0f every time the animation cycle finishes (when the wheel shrinks back to its smaller size).
61 |
62 | ### Indeterminate wheel
63 |
64 | For making the wheel indeterminate, just call the ```spin()``` method. If you set a progress value, the wheel will stop spinning.
65 |
66 | You have two methods for setting the progress:
67 |
68 | ```progressWheel.setProgress(float value)```
69 |
70 | Sets the value, and the wheel will smoothly animate to that value. The speed of the animation is defined by the spinSpeed (can be set with ```setSpinSpeed```, which number is the number of full turns per second)
71 |
72 | ```progressWheel.setInstantProgress(float value)```
73 |
74 | Sets the value, and the wheel will instantly move to that value.
75 |
76 | You can change other wheel properties such as the progress bar color, the wheel's background or the wheel's size and width.
77 |
78 | ### Fill radius
79 |
80 | In case you want the spinning wheel to fill the whole layout instead of having a fixed size, you can use ```matProg_fillRadius```.
81 |
82 | ```xml
83 |
92 | ```
93 |
94 | This way, the wheel will be as big as the parent layout. Be warned though, if the parentlayout is not square, the wheel will become an oval since the wheel will always adapt to fill the parent view.
95 |
96 | ### Other options
97 |
98 | In the xml definition, besides the ```fillRadius``` property, you can set:
99 |
100 | * matProg_progressIndeterminate: boolean, if you want the wheel to spin right away.
101 | * matProg_barColor: color, sets the small bar's color (the spinning bar in the indeterminate wheel, or the progress bar)
102 | * matProg_barWidth: dimension, the width of the spinning bar
103 | * matProg_rimColor: color, the wheel's border color
104 | * matProg_rimWidth: dimension, the wheel's width (not the bar)
105 | * matProg_spinSpeed: float, the base speed for the bar in indeterminate mode, and the animation speed when setting a value on progress. The speed is in full turns per second, this means that if you set speed as 1.0, means that the bar will take one second to do a full turn.
106 | * matProg_barSpinCycleTime: integer, the time in milliseconds the indeterminate progress animation takes to complete (extending and shrinking the bar while spinning)
107 | * matProg_circleRadius: dimension, the radius of the progress wheel, it will be ignored if you set fillRadius to true
108 | * matProg_fillRadius: boolean, set to true if you want the progress wheel to fill the whole layout
109 | * matProg_linearProgress: boolean, set to true if you want a linear animation on the determinate progress (instead of the interpolated default one).
110 |
111 | ## Versions
112 |
113 | * 1.0 Initial release
114 | * 1.1 The default speed is closer to the default progress wheel in Lollipop. Removed unused icons.
115 | * 1.2 Interpolated determinate progress, a new option to set a linear progress (which was the default before)
116 | * 1.3 Added a prefix to the attributes to avoid collisions, new callback called when the progress changes in the determinate wheel.
117 | * 1.4 Improved callback, now receives a value which is rounded to two decimals
118 | * 1.5 Callback is called with a value of -1.0f in the indeterminate wheel every time the animation cycle finishes, updated Gradle and support libraries
119 | * 1.7 Animations are disabled when the system preferences have disabled animations
120 |
121 | License
122 | -------
123 |
124 | Copyright 2014 Nico Hormazábal
125 |
126 | Licensed under the Apache License, Version 2.0 (the "License");
127 | you may not use this file except in compliance with the License.
128 | You may obtain a copy of the License at
129 |
130 | http://www.apache.org/licenses/LICENSE-2.0
131 |
132 | Unless required by applicable law or agreed to in writing, software
133 | distributed under the License is distributed on an "AS IS" BASIS,
134 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135 | See the License for the specific language governing permissions and
136 | limitations under the License.
137 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.pnikosis.materialishprogress.sample"
9 | minSdkVersion 9
10 | targetSdkVersion 22
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(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:22.0.0'
25 | compile project(':library')
26 | }
27 |
--------------------------------------------------------------------------------
/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 /Users/nicolas/Development/android-sdk-macosx/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/androidTest/java/com/pnikosis/materialishprogress/sample/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.pnikosis.materialishprogress.sample;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/pnikosis/materialishprogress/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.pnikosis.materialishprogress.sample;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.DialogInterface;
5 | import android.graphics.Color;
6 | import android.support.v7.app.ActionBarActivity;
7 | import android.os.Bundle;
8 | import android.view.Menu;
9 | import android.view.MenuItem;
10 | import android.view.View;
11 | import android.widget.AdapterView;
12 | import android.widget.Button;
13 | import android.widget.CompoundButton;
14 | import android.widget.RadioButton;
15 | import android.widget.Spinner;
16 | import android.widget.TextView;
17 |
18 | import com.pnikosis.materialishprogress.ProgressWheel;
19 |
20 | import java.text.DecimalFormat;
21 |
22 |
23 | public class MainActivity extends ActionBarActivity {
24 |
25 | private ProgressWheel progressWheel;
26 | private ProgressWheel progressWheelInterpolated;
27 | private ProgressWheel progressWheelLinear;
28 |
29 | private TextView interpolatedValue;
30 | private TextView linearValue;
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_main);
36 |
37 | Button buttonAbout = (Button) findViewById(R.id.button_about);
38 | buttonAbout.setOnClickListener(new View.OnClickListener() {
39 | @Override
40 | public void onClick(View v) {
41 | AlertDialog.Builder dialog = new AlertDialog.Builder(MainActivity.this)
42 | .setTitle(R.string.about)
43 | .setMessage(R.string.about_text)
44 | .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
45 | @Override
46 | public void onClick(DialogInterface dialog, int which) {
47 | dialog.dismiss();
48 | }
49 | });
50 |
51 | dialog.show();
52 | }
53 | });
54 |
55 | progressWheel = (ProgressWheel) findViewById(R.id.progress_wheel);
56 | progressWheelInterpolated = (ProgressWheel) findViewById(R.id.interpolated);
57 | progressWheelLinear = (ProgressWheel) findViewById(R.id.linear);
58 |
59 | interpolatedValue = (TextView) findViewById(R.id.interpolatedValue);
60 | linearValue = (TextView) findViewById(R.id.linearValue);
61 |
62 | Spinner spinnerOptions = (Spinner) findViewById(R.id.spinner_options);
63 | spinnerOptions.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
64 | @Override
65 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
66 | switch(position) {
67 | case 0:
68 | progressWheelLinear.setProgress(0.0f);
69 | progressWheelInterpolated.setProgress(0.0f);
70 |
71 | progressWheelInterpolated.setCallback(new ProgressWheel.ProgressCallback() {
72 | @Override
73 | public void onProgressUpdate(float progress) {
74 | if(progress == 0) {
75 | progressWheelInterpolated.setProgress(1.0f);
76 | } else if(progress == 1.0f) {
77 | progressWheelInterpolated.setProgress(0.0f);
78 | }
79 |
80 | interpolatedValue.setText(String.format("%.2f", progress));
81 | }
82 | });
83 |
84 | progressWheelLinear.setCallback(new ProgressWheel.ProgressCallback() {
85 | @Override
86 | public void onProgressUpdate(float progress) {
87 | if(progress == 0) {
88 | progressWheelLinear.setProgress(1.0f);
89 | } else if(progress == 1.0f) {
90 | progressWheelLinear.setProgress(0.0f);
91 | }
92 |
93 | linearValue.setText(String.format("%.2f", progress));
94 | }
95 | });
96 | break;
97 | case 1:
98 | setProgress(0.0f);
99 | break;
100 | case 2:
101 | setProgress(0.1f);
102 | break;
103 | case 3:
104 | setProgress(0.25f);
105 | break;
106 | case 4:
107 | setProgress(0.5f);
108 | break;
109 | case 5:
110 | setProgress(0.75f);
111 | break;
112 | case 6:
113 | setProgress(1.0f);
114 | break;
115 | }
116 | }
117 |
118 | @Override
119 | public void onNothingSelected(AdapterView> parent) {
120 |
121 | }
122 | });
123 |
124 | final int defaultBarColor = progressWheel.getBarColor();
125 | final int defaultWheelColor = progressWheel.getRimColor();
126 |
127 | Spinner colorOptions = (Spinner) findViewById(R.id.spinner_options_color);
128 | colorOptions.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
129 | @Override
130 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
131 | switch(position) {
132 | case 0:
133 | progressWheel.setBarColor(defaultBarColor);
134 | progressWheelInterpolated.setBarColor(defaultBarColor);
135 | progressWheelLinear.setBarColor(defaultBarColor);
136 | break;
137 | case 1:
138 | progressWheel.setBarColor(Color.RED);
139 | progressWheelInterpolated.setBarColor(Color.RED);
140 | progressWheelLinear.setBarColor(Color.RED);
141 | break;
142 | case 2:
143 | progressWheel.setBarColor(Color.MAGENTA);
144 | progressWheelInterpolated.setBarColor(Color.MAGENTA);
145 | progressWheelLinear.setBarColor(Color.MAGENTA);
146 | break;
147 | }
148 | }
149 |
150 | @Override
151 | public void onNothingSelected(AdapterView> parent) {
152 |
153 | }
154 | });
155 |
156 | Spinner wheelColorOptions = (Spinner) findViewById(R.id.spinner_options_rim_color);
157 | wheelColorOptions.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
158 | @Override
159 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
160 | switch(position) {
161 | case 0:
162 | progressWheel.setRimColor(defaultWheelColor);
163 | progressWheelInterpolated.setRimColor(defaultWheelColor);
164 | progressWheelLinear.setRimColor(defaultWheelColor);
165 | break;
166 | case 1:
167 | progressWheel.setRimColor(Color.LTGRAY);
168 | progressWheelInterpolated.setRimColor(Color.LTGRAY);
169 | progressWheelLinear.setRimColor(Color.LTGRAY);
170 | break;
171 | case 2:
172 | progressWheel.setRimColor(Color.GRAY);
173 | progressWheelInterpolated.setRimColor(Color.GRAY);
174 | progressWheelLinear.setRimColor(Color.GRAY);
175 | break;
176 | }
177 | }
178 |
179 | @Override
180 | public void onNothingSelected(AdapterView> parent) {
181 |
182 | }
183 | });
184 | }
185 |
186 | private void setProgress(float progress) {
187 | progressWheelLinear.setCallback(new ProgressWheel.ProgressCallback() {
188 | @Override
189 | public void onProgressUpdate(float progress) {
190 | linearValue.setText(String.format("%.2f", progress));
191 | }
192 | });
193 | progressWheelInterpolated.setCallback(new ProgressWheel.ProgressCallback() {
194 | @Override
195 | public void onProgressUpdate(float progress) {
196 | interpolatedValue.setText(String.format("%.2f", progress));
197 | }
198 | });
199 |
200 | progressWheelLinear.setProgress(progress);
201 | progressWheelInterpolated.setProgress(progress);
202 | }
203 |
204 | @Override
205 | public boolean onCreateOptionsMenu(Menu menu) {
206 | // Inflate the menu; this adds items to the action bar if it is present.
207 | getMenuInflater().inflate(R.menu.menu_main, menu);
208 | return true;
209 | }
210 |
211 | @Override
212 | public boolean onOptionsItemSelected(MenuItem item) {
213 | // Handle action bar item clicks here. The action bar will
214 | // automatically handle clicks on the Home/Up button, so long
215 | // as you specify a parent activity in AndroidManifest.xml.
216 | int id = item.getItemId();
217 |
218 |
219 |
220 | return super.onOptionsItemSelected(item);
221 | }
222 | }
223 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
15 |
16 |
24 |
25 |
33 |
34 |
43 |
44 |
49 |
50 |
54 |
55 |
60 |
61 |
62 |
67 |
68 |
72 |
73 |
78 |
79 |
80 |
81 |
89 |
90 |
96 |
97 |
103 |
104 |
111 |
112 |
116 |
117 |
122 |
123 |
129 |
130 |
138 |
139 |
145 |
146 |
147 |
152 |
153 |
159 |
160 |
169 |
170 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Material-ish Progress Demo
5 | Options:
6 | Progress:
7 | Bar color:
8 | Wheel color:
9 | Interpolated progress:
10 | Linear progress:
11 | OK
12 | About
13 | This app is for demonstrate the Material-ish progress wheel library, which provides a Material-style progress wheel compatible back to API 9. You can have indeterminate and determinate versions of the progress wheel, the later with a linear animation or a interpolated one like in the guidelines.\n\nRefer to the Github project page for more info at https://github.com/pnikosis/materialish-progress.
14 |
15 | Cycle between 0% and 100%
16 | 0%
17 | 10%
18 | 25%
19 | 50%
20 | 75%
21 | 100%
22 |
23 |
24 | Default
25 | Red
26 | Magenta
27 |
28 |
29 | Default
30 | Light Gray
31 | Gray
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | jcenter()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 |
9 | // NOTE: Do not place your application dependencies here; they belong
10 | // in the individual module build.gradle files
11 | }
12 | }
13 | allprojects {
14 | repositories {
15 | jcenter()
16 | }
17 | }
18 |
19 | dependencies {
20 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Dec 05 08:26:21 CET 2014
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | minSdkVersion 9
9 | targetSdkVersion 22
10 | versionCode 5
11 | versionName "1.4"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | }
24 |
25 | apply from: '../maven_push.gradle'
26 |
--------------------------------------------------------------------------------
/library/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 /Users/nicolas/Development/android-sdk-macosx/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 |
--------------------------------------------------------------------------------
/library/src/androidTest/java/com/pnikosis/materialishprogress/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.pnikosis.materialishprogress;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/library/src/main/java/com/pnikosis/materialishprogress/ProgressWheel.java:
--------------------------------------------------------------------------------
1 | package com.pnikosis.materialishprogress;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.content.res.TypedArray;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.graphics.Paint.Style;
9 | import android.graphics.RectF;
10 | import android.os.Build;
11 | import android.os.Parcel;
12 | import android.os.Parcelable;
13 | import android.os.SystemClock;
14 | import android.provider.Settings;
15 | import android.util.AttributeSet;
16 | import android.util.DisplayMetrics;
17 | import android.util.TypedValue;
18 | import android.view.View;
19 |
20 | /**
21 | * A Material style progress wheel, compatible up to 2.2.
22 | * Todd Davies' Progress Wheel https://github.com/Todd-Davies/ProgressWheel
23 | *
24 | * @author Nico Hormazábal
25 | *
26 | * Licensed under the Apache License 2.0 license see:
27 | * http://www.apache.org/licenses/LICENSE-2.0
28 | */
29 | public class ProgressWheel extends View {
30 | private static final String TAG = ProgressWheel.class.getSimpleName();
31 | private final int barLength = 16;
32 | private final int barMaxLength = 270;
33 | private final long pauseGrowingTime = 200;
34 | /**
35 | * *********
36 | * DEFAULTS *
37 | * **********
38 | */
39 | //Sizes (with defaults in DP)
40 | private int circleRadius = 28;
41 | private int barWidth = 4;
42 | private int rimWidth = 4;
43 | private boolean fillRadius = false;
44 | private double timeStartGrowing = 0;
45 | private double barSpinCycleTime = 460;
46 | private float barExtraLength = 0;
47 | private boolean barGrowingFromFront = true;
48 | private long pausedTimeWithoutGrowing = 0;
49 | //Colors (with defaults)
50 | private int barColor = 0xAA000000;
51 | private int rimColor = 0x00FFFFFF;
52 |
53 | //Paints
54 | private Paint barPaint = new Paint();
55 | private Paint rimPaint = new Paint();
56 |
57 | //Rectangles
58 | private RectF circleBounds = new RectF();
59 |
60 | //Animation
61 | //The amount of degrees per second
62 | private float spinSpeed = 230.0f;
63 | //private float spinSpeed = 120.0f;
64 | // The last time the spinner was animated
65 | private long lastTimeAnimated = 0;
66 |
67 | private boolean linearProgress;
68 |
69 | private float mProgress = 0.0f;
70 | private float mTargetProgress = 0.0f;
71 | private boolean isSpinning = false;
72 |
73 | private ProgressCallback callback;
74 |
75 | private boolean shouldAnimate;
76 |
77 | /**
78 | * The constructor for the ProgressWheel
79 | */
80 | public ProgressWheel(Context context, AttributeSet attrs) {
81 | super(context, attrs);
82 |
83 | parseAttributes(context.obtainStyledAttributes(attrs, R.styleable.ProgressWheel));
84 |
85 | setAnimationEnabled();
86 | }
87 |
88 | /**
89 | * The constructor for the ProgressWheel
90 | */
91 | public ProgressWheel(Context context) {
92 | super(context);
93 | setAnimationEnabled();
94 | }
95 |
96 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) private void setAnimationEnabled() {
97 | int currentApiVersion = android.os.Build.VERSION.SDK_INT;
98 |
99 | float animationValue;
100 | if (currentApiVersion >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
101 | animationValue = Settings.Global.getFloat(getContext().getContentResolver(),
102 | Settings.Global.ANIMATOR_DURATION_SCALE, 1);
103 | } else {
104 | animationValue = Settings.System.getFloat(getContext().getContentResolver(),
105 | Settings.System.ANIMATOR_DURATION_SCALE, 1);
106 | }
107 |
108 | shouldAnimate = animationValue != 0;
109 | }
110 |
111 | //----------------------------------
112 | //Setting up stuff
113 | //----------------------------------
114 |
115 | @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
116 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
117 |
118 | int viewWidth = circleRadius + this.getPaddingLeft() + this.getPaddingRight();
119 | int viewHeight = circleRadius + this.getPaddingTop() + this.getPaddingBottom();
120 |
121 | int widthMode = MeasureSpec.getMode(widthMeasureSpec);
122 | int widthSize = MeasureSpec.getSize(widthMeasureSpec);
123 | int heightMode = MeasureSpec.getMode(heightMeasureSpec);
124 | int heightSize = MeasureSpec.getSize(heightMeasureSpec);
125 |
126 | int width;
127 | int height;
128 |
129 | //Measure Width
130 | if (widthMode == MeasureSpec.EXACTLY) {
131 | //Must be this size
132 | width = widthSize;
133 | } else if (widthMode == MeasureSpec.AT_MOST) {
134 | //Can't be bigger than...
135 | width = Math.min(viewWidth, widthSize);
136 | } else {
137 | //Be whatever you want
138 | width = viewWidth;
139 | }
140 |
141 | //Measure Height
142 | if (heightMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.EXACTLY) {
143 | //Must be this size
144 | height = heightSize;
145 | } else if (heightMode == MeasureSpec.AT_MOST) {
146 | //Can't be bigger than...
147 | height = Math.min(viewHeight, heightSize);
148 | } else {
149 | //Be whatever you want
150 | height = viewHeight;
151 | }
152 |
153 | setMeasuredDimension(width, height);
154 | }
155 |
156 | /**
157 | * Use onSizeChanged instead of onAttachedToWindow to get the dimensions of the view,
158 | * because this method is called after measuring the dimensions of MATCH_PARENT & WRAP_CONTENT.
159 | * Use this dimensions to setup the bounds and paints.
160 | */
161 | @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) {
162 | super.onSizeChanged(w, h, oldw, oldh);
163 |
164 | setupBounds(w, h);
165 | setupPaints();
166 | invalidate();
167 | }
168 |
169 | /**
170 | * Set the properties of the paints we're using to
171 | * draw the progress wheel
172 | */
173 | private void setupPaints() {
174 | barPaint.setColor(barColor);
175 | barPaint.setAntiAlias(true);
176 | barPaint.setStyle(Style.STROKE);
177 | barPaint.setStrokeWidth(barWidth);
178 |
179 | rimPaint.setColor(rimColor);
180 | rimPaint.setAntiAlias(true);
181 | rimPaint.setStyle(Style.STROKE);
182 | rimPaint.setStrokeWidth(rimWidth);
183 | }
184 |
185 | /**
186 | * Set the bounds of the component
187 | */
188 | private void setupBounds(int layout_width, int layout_height) {
189 | int paddingTop = getPaddingTop();
190 | int paddingBottom = getPaddingBottom();
191 | int paddingLeft = getPaddingLeft();
192 | int paddingRight = getPaddingRight();
193 |
194 | if (!fillRadius) {
195 | // Width should equal to Height, find the min value to setup the circle
196 | int minValue = Math.min(layout_width - paddingLeft - paddingRight,
197 | layout_height - paddingBottom - paddingTop);
198 |
199 | int circleDiameter = Math.min(minValue, circleRadius * 2 - barWidth * 2);
200 |
201 | // Calc the Offset if needed for centering the wheel in the available space
202 | int xOffset = (layout_width - paddingLeft - paddingRight - circleDiameter) / 2 + paddingLeft;
203 | int yOffset = (layout_height - paddingTop - paddingBottom - circleDiameter) / 2 + paddingTop;
204 |
205 | circleBounds =
206 | new RectF(xOffset + barWidth, yOffset + barWidth, xOffset + circleDiameter - barWidth,
207 | yOffset + circleDiameter - barWidth);
208 | } else {
209 | circleBounds = new RectF(paddingLeft + barWidth, paddingTop + barWidth,
210 | layout_width - paddingRight - barWidth, layout_height - paddingBottom - barWidth);
211 | }
212 | }
213 |
214 | /**
215 | * Parse the attributes passed to the view from the XML
216 | *
217 | * @param a the attributes to parse
218 | */
219 | private void parseAttributes(TypedArray a) {
220 | // We transform the default values from DIP to pixels
221 | DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
222 | barWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, barWidth, metrics);
223 | rimWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, rimWidth, metrics);
224 | circleRadius =
225 | (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, circleRadius, metrics);
226 |
227 | circleRadius =
228 | (int) a.getDimension(R.styleable.ProgressWheel_matProg_circleRadius, circleRadius);
229 |
230 | fillRadius = a.getBoolean(R.styleable.ProgressWheel_matProg_fillRadius, false);
231 |
232 | barWidth = (int) a.getDimension(R.styleable.ProgressWheel_matProg_barWidth, barWidth);
233 |
234 | rimWidth = (int) a.getDimension(R.styleable.ProgressWheel_matProg_rimWidth, rimWidth);
235 |
236 | float baseSpinSpeed =
237 | a.getFloat(R.styleable.ProgressWheel_matProg_spinSpeed, spinSpeed / 360.0f);
238 | spinSpeed = baseSpinSpeed * 360;
239 |
240 | barSpinCycleTime =
241 | a.getInt(R.styleable.ProgressWheel_matProg_barSpinCycleTime, (int) barSpinCycleTime);
242 |
243 | barColor = a.getColor(R.styleable.ProgressWheel_matProg_barColor, barColor);
244 |
245 | rimColor = a.getColor(R.styleable.ProgressWheel_matProg_rimColor, rimColor);
246 |
247 | linearProgress = a.getBoolean(R.styleable.ProgressWheel_matProg_linearProgress, false);
248 |
249 | if (a.getBoolean(R.styleable.ProgressWheel_matProg_progressIndeterminate, false)) {
250 | spin();
251 | }
252 |
253 | // Recycle
254 | a.recycle();
255 | }
256 |
257 | public void setCallback(ProgressCallback progressCallback) {
258 | callback = progressCallback;
259 |
260 | if (!isSpinning) {
261 | runCallback();
262 | }
263 | }
264 |
265 | //----------------------------------
266 | //Animation stuff
267 | //----------------------------------
268 |
269 | protected void onDraw(Canvas canvas) {
270 | super.onDraw(canvas);
271 |
272 | canvas.drawArc(circleBounds, 360, 360, false, rimPaint);
273 |
274 | boolean mustInvalidate = false;
275 |
276 | if (!shouldAnimate) {
277 | return;
278 | }
279 |
280 | if (isSpinning) {
281 | //Draw the spinning bar
282 | mustInvalidate = true;
283 |
284 | long deltaTime = (SystemClock.uptimeMillis() - lastTimeAnimated);
285 | float deltaNormalized = deltaTime * spinSpeed / 1000.0f;
286 |
287 | updateBarLength(deltaTime);
288 |
289 | mProgress += deltaNormalized;
290 | if (mProgress > 360) {
291 | mProgress -= 360f;
292 |
293 | // A full turn has been completed
294 | // we run the callback with -1 in case we want to
295 | // do something, like changing the color
296 | runCallback(-1.0f);
297 | }
298 | lastTimeAnimated = SystemClock.uptimeMillis();
299 |
300 | float from = mProgress - 90;
301 | float length = barLength + barExtraLength;
302 |
303 | if (isInEditMode()) {
304 | from = 0;
305 | length = 135;
306 | }
307 |
308 | canvas.drawArc(circleBounds, from, length, false, barPaint);
309 | } else {
310 | float oldProgress = mProgress;
311 |
312 | if (mProgress != mTargetProgress) {
313 | //We smoothly increase the progress bar
314 | mustInvalidate = true;
315 |
316 | float deltaTime = (float) (SystemClock.uptimeMillis() - lastTimeAnimated) / 1000;
317 | float deltaNormalized = deltaTime * spinSpeed;
318 |
319 | mProgress = Math.min(mProgress + deltaNormalized, mTargetProgress);
320 | lastTimeAnimated = SystemClock.uptimeMillis();
321 | }
322 |
323 | if (oldProgress != mProgress) {
324 | runCallback();
325 | }
326 |
327 | float offset = 0.0f;
328 | float progress = mProgress;
329 | if (!linearProgress) {
330 | float factor = 2.0f;
331 | offset = (float) (1.0f - Math.pow(1.0f - mProgress / 360.0f, 2.0f * factor)) * 360.0f;
332 | progress = (float) (1.0f - Math.pow(1.0f - mProgress / 360.0f, factor)) * 360.0f;
333 | }
334 |
335 | if (isInEditMode()) {
336 | progress = 360;
337 | }
338 |
339 | canvas.drawArc(circleBounds, offset - 90, progress, false, barPaint);
340 | }
341 |
342 | if (mustInvalidate) {
343 | invalidate();
344 | }
345 | }
346 |
347 | @Override protected void onVisibilityChanged(View changedView, int visibility) {
348 | super.onVisibilityChanged(changedView, visibility);
349 |
350 | if (visibility == VISIBLE) {
351 | lastTimeAnimated = SystemClock.uptimeMillis();
352 | }
353 | }
354 |
355 | private void updateBarLength(long deltaTimeInMilliSeconds) {
356 | if (pausedTimeWithoutGrowing >= pauseGrowingTime) {
357 | timeStartGrowing += deltaTimeInMilliSeconds;
358 |
359 | if (timeStartGrowing > barSpinCycleTime) {
360 | // We completed a size change cycle
361 | // (growing or shrinking)
362 | timeStartGrowing -= barSpinCycleTime;
363 | //if(barGrowingFromFront) {
364 | pausedTimeWithoutGrowing = 0;
365 | //}
366 | barGrowingFromFront = !barGrowingFromFront;
367 | }
368 |
369 | float distance =
370 | (float) Math.cos((timeStartGrowing / barSpinCycleTime + 1) * Math.PI) / 2 + 0.5f;
371 | float destLength = (barMaxLength - barLength);
372 |
373 | if (barGrowingFromFront) {
374 | barExtraLength = distance * destLength;
375 | } else {
376 | float newLength = destLength * (1 - distance);
377 | mProgress += (barExtraLength - newLength);
378 | barExtraLength = newLength;
379 | }
380 | } else {
381 | pausedTimeWithoutGrowing += deltaTimeInMilliSeconds;
382 | }
383 | }
384 |
385 | /**
386 | * Check if the wheel is currently spinning
387 | */
388 |
389 | public boolean isSpinning() {
390 | return isSpinning;
391 | }
392 |
393 | /**
394 | * Reset the count (in increment mode)
395 | */
396 | public void resetCount() {
397 | mProgress = 0.0f;
398 | mTargetProgress = 0.0f;
399 | invalidate();
400 | }
401 |
402 | /**
403 | * Turn off spin mode
404 | */
405 | public void stopSpinning() {
406 | isSpinning = false;
407 | mProgress = 0.0f;
408 | mTargetProgress = 0.0f;
409 | invalidate();
410 | }
411 |
412 | /**
413 | * Puts the view on spin mode
414 | */
415 | public void spin() {
416 | lastTimeAnimated = SystemClock.uptimeMillis();
417 | isSpinning = true;
418 | invalidate();
419 | }
420 |
421 | private void runCallback(float value) {
422 | if (callback != null) {
423 | callback.onProgressUpdate(value);
424 | }
425 | }
426 |
427 | private void runCallback() {
428 | if (callback != null) {
429 | float normalizedProgress = (float) Math.round(mProgress * 100 / 360.0f) / 100;
430 | callback.onProgressUpdate(normalizedProgress);
431 | }
432 | }
433 |
434 | /**
435 | * Set the progress to a specific value,
436 | * the bar will be set instantly to that value
437 | *
438 | * @param progress the progress between 0 and 1
439 | */
440 | public void setInstantProgress(float progress) {
441 | if (isSpinning) {
442 | mProgress = 0.0f;
443 | isSpinning = false;
444 | }
445 |
446 | if (progress > 1.0f) {
447 | progress -= 1.0f;
448 | } else if (progress < 0) {
449 | progress = 0;
450 | }
451 |
452 | if (progress == mTargetProgress) {
453 | return;
454 | }
455 |
456 | mTargetProgress = Math.min(progress * 360.0f, 360.0f);
457 | mProgress = mTargetProgress;
458 | lastTimeAnimated = SystemClock.uptimeMillis();
459 | invalidate();
460 | }
461 |
462 | // Great way to save a view's state http://stackoverflow.com/a/7089687/1991053
463 | @Override public Parcelable onSaveInstanceState() {
464 | Parcelable superState = super.onSaveInstanceState();
465 |
466 | WheelSavedState ss = new WheelSavedState(superState);
467 |
468 | // We save everything that can be changed at runtime
469 | ss.mProgress = this.mProgress;
470 | ss.mTargetProgress = this.mTargetProgress;
471 | ss.isSpinning = this.isSpinning;
472 | ss.spinSpeed = this.spinSpeed;
473 | ss.barWidth = this.barWidth;
474 | ss.barColor = this.barColor;
475 | ss.rimWidth = this.rimWidth;
476 | ss.rimColor = this.rimColor;
477 | ss.circleRadius = this.circleRadius;
478 | ss.linearProgress = this.linearProgress;
479 | ss.fillRadius = this.fillRadius;
480 |
481 | return ss;
482 | }
483 |
484 | @Override public void onRestoreInstanceState(Parcelable state) {
485 | if (!(state instanceof WheelSavedState)) {
486 | super.onRestoreInstanceState(state);
487 | return;
488 | }
489 |
490 | WheelSavedState ss = (WheelSavedState) state;
491 | super.onRestoreInstanceState(ss.getSuperState());
492 |
493 | this.mProgress = ss.mProgress;
494 | this.mTargetProgress = ss.mTargetProgress;
495 | this.isSpinning = ss.isSpinning;
496 | this.spinSpeed = ss.spinSpeed;
497 | this.barWidth = ss.barWidth;
498 | this.barColor = ss.barColor;
499 | this.rimWidth = ss.rimWidth;
500 | this.rimColor = ss.rimColor;
501 | this.circleRadius = ss.circleRadius;
502 | this.linearProgress = ss.linearProgress;
503 | this.fillRadius = ss.fillRadius;
504 |
505 | this.lastTimeAnimated = SystemClock.uptimeMillis();
506 | }
507 |
508 | /**
509 | * @return the current progress between 0.0 and 1.0,
510 | * if the wheel is indeterminate, then the result is -1
511 | */
512 | public float getProgress() {
513 | return isSpinning ? -1 : mProgress / 360.0f;
514 | }
515 |
516 | //----------------------------------
517 | //Getters + setters
518 | //----------------------------------
519 |
520 | /**
521 | * Set the progress to a specific value,
522 | * the bar will smoothly animate until that value
523 | *
524 | * @param progress the progress between 0 and 1
525 | */
526 | public void setProgress(float progress) {
527 | if (isSpinning) {
528 | mProgress = 0.0f;
529 | isSpinning = false;
530 |
531 | runCallback();
532 | }
533 |
534 | if (progress > 1.0f) {
535 | progress -= 1.0f;
536 | } else if (progress < 0) {
537 | progress = 0;
538 | }
539 |
540 | if (progress == mTargetProgress) {
541 | return;
542 | }
543 |
544 | // If we are currently in the right position
545 | // we set again the last time animated so the
546 | // animation starts smooth from here
547 | if (mProgress == mTargetProgress) {
548 | lastTimeAnimated = SystemClock.uptimeMillis();
549 | }
550 |
551 | mTargetProgress = Math.min(progress * 360.0f, 360.0f);
552 |
553 | invalidate();
554 | }
555 |
556 | /**
557 | * Sets the determinate progress mode
558 | *
559 | * @param isLinear if the progress should increase linearly
560 | */
561 | public void setLinearProgress(boolean isLinear) {
562 | linearProgress = isLinear;
563 | if (!isSpinning) {
564 | invalidate();
565 | }
566 | }
567 |
568 | /**
569 | * @return the radius of the wheel in pixels
570 | */
571 | public int getCircleRadius() {
572 | return circleRadius;
573 | }
574 |
575 | /**
576 | * Sets the radius of the wheel
577 | *
578 | * @param circleRadius the expected radius, in pixels
579 | */
580 | public void setCircleRadius(int circleRadius) {
581 | this.circleRadius = circleRadius;
582 | if (!isSpinning) {
583 | invalidate();
584 | }
585 | }
586 |
587 | /**
588 | * @return the width of the spinning bar
589 | */
590 | public int getBarWidth() {
591 | return barWidth;
592 | }
593 |
594 | /**
595 | * Sets the width of the spinning bar
596 | *
597 | * @param barWidth the spinning bar width in pixels
598 | */
599 | public void setBarWidth(int barWidth) {
600 | this.barWidth = barWidth;
601 | if (!isSpinning) {
602 | invalidate();
603 | }
604 | }
605 |
606 | /**
607 | * @return the color of the spinning bar
608 | */
609 | public int getBarColor() {
610 | return barColor;
611 | }
612 |
613 | /**
614 | * Sets the color of the spinning bar
615 | *
616 | * @param barColor The spinning bar color
617 | */
618 | public void setBarColor(int barColor) {
619 | this.barColor = barColor;
620 | setupPaints();
621 | if (!isSpinning) {
622 | invalidate();
623 | }
624 | }
625 |
626 | /**
627 | * @return the color of the wheel's contour
628 | */
629 | public int getRimColor() {
630 | return rimColor;
631 | }
632 |
633 | /**
634 | * Sets the color of the wheel's contour
635 | *
636 | * @param rimColor the color for the wheel
637 | */
638 | public void setRimColor(int rimColor) {
639 | this.rimColor = rimColor;
640 | setupPaints();
641 | if (!isSpinning) {
642 | invalidate();
643 | }
644 | }
645 |
646 | /**
647 | * @return the base spinning speed, in full circle turns per second
648 | * (1.0 equals on full turn in one second), this value also is applied for
649 | * the smoothness when setting a progress
650 | */
651 | public float getSpinSpeed() {
652 | return spinSpeed / 360.0f;
653 | }
654 |
655 | /**
656 | * Sets the base spinning speed, in full circle turns per second
657 | * (1.0 equals on full turn in one second), this value also is applied for
658 | * the smoothness when setting a progress
659 | *
660 | * @param spinSpeed the desired base speed in full turns per second
661 | */
662 | public void setSpinSpeed(float spinSpeed) {
663 | this.spinSpeed = spinSpeed * 360.0f;
664 | }
665 |
666 | /**
667 | * @return the width of the wheel's contour in pixels
668 | */
669 | public int getRimWidth() {
670 | return rimWidth;
671 | }
672 |
673 | /**
674 | * Sets the width of the wheel's contour
675 | *
676 | * @param rimWidth the width in pixels
677 | */
678 | public void setRimWidth(int rimWidth) {
679 | this.rimWidth = rimWidth;
680 | if (!isSpinning) {
681 | invalidate();
682 | }
683 | }
684 |
685 | public interface ProgressCallback {
686 | /**
687 | * Method to call when the progress reaches a value
688 | * in order to avoid float precision issues, the progress
689 | * is rounded to a float with two decimals.
690 | *
691 | * In indeterminate mode, the callback is called each time
692 | * the wheel completes an animation cycle, with, the progress value is -1.0f
693 | *
694 | * @param progress a double value between 0.00 and 1.00 both included
695 | */
696 | public void onProgressUpdate(float progress);
697 | }
698 |
699 | static class WheelSavedState extends BaseSavedState {
700 | //required field that makes Parcelables from a Parcel
701 | public static final Parcelable.Creator CREATOR =
702 | new Parcelable.Creator() {
703 | public WheelSavedState createFromParcel(Parcel in) {
704 | return new WheelSavedState(in);
705 | }
706 |
707 | public WheelSavedState[] newArray(int size) {
708 | return new WheelSavedState[size];
709 | }
710 | };
711 | float mProgress;
712 | float mTargetProgress;
713 | boolean isSpinning;
714 | float spinSpeed;
715 | int barWidth;
716 | int barColor;
717 | int rimWidth;
718 | int rimColor;
719 | int circleRadius;
720 | boolean linearProgress;
721 | boolean fillRadius;
722 |
723 | WheelSavedState(Parcelable superState) {
724 | super(superState);
725 | }
726 |
727 | private WheelSavedState(Parcel in) {
728 | super(in);
729 | this.mProgress = in.readFloat();
730 | this.mTargetProgress = in.readFloat();
731 | this.isSpinning = in.readByte() != 0;
732 | this.spinSpeed = in.readFloat();
733 | this.barWidth = in.readInt();
734 | this.barColor = in.readInt();
735 | this.rimWidth = in.readInt();
736 | this.rimColor = in.readInt();
737 | this.circleRadius = in.readInt();
738 | this.linearProgress = in.readByte() != 0;
739 | this.fillRadius = in.readByte() != 0;
740 | }
741 |
742 | @Override public void writeToParcel(Parcel out, int flags) {
743 | super.writeToParcel(out, flags);
744 | out.writeFloat(this.mProgress);
745 | out.writeFloat(this.mTargetProgress);
746 | out.writeByte((byte) (isSpinning ? 1 : 0));
747 | out.writeFloat(this.spinSpeed);
748 | out.writeInt(this.barWidth);
749 | out.writeInt(this.barColor);
750 | out.writeInt(this.rimWidth);
751 | out.writeInt(this.rimColor);
752 | out.writeInt(this.circleRadius);
753 | out.writeByte((byte) (linearProgress ? 1 : 0));
754 | out.writeByte((byte) (fillRadius ? 1 : 0));
755 | }
756 | }
757 | }
758 |
--------------------------------------------------------------------------------
/library/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Library
3 | Default Progressbar:
4 |
5 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':library', ':app'
2 |
--------------------------------------------------------------------------------
/spinningwheel.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/spinningwheel.gif
--------------------------------------------------------------------------------
/spinningwheel_progress.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nico2sh/materialish-progress/6aa41628133b6f589494bb4b93ea469a7fe8cae6/spinningwheel_progress.gif
--------------------------------------------------------------------------------