From 24d89ae392c7e464ca31ff8c9fcfcee052c04fe9 Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Mon, 1 Aug 2016 16:31:46 +0300 Subject: [PATCH 01/19] Readme update. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index e96e07a..bf25698 100644 --- a/README.md +++ b/README.md @@ -227,3 +227,16 @@ Author Made in [DevLight Mobile Agency](https://github.com/DevLight-Mobile-Agency) Created by [Basil Miller](https://github.com/GIGAMOLE) - [@gigamole](mailto:gigamole53@gmail.com) + +Support +======= + +If you'd like to support future development and new product features, please make a payments on Gratipay and Beerpay or become a patron on Patreon. + +[![Gratipay](https://img.shields.io/gratipay/user/gigamole.svg?maxAge=2592000)](https://gratipay.com/~GIGAMOLE/) +[![Beerpay](https://beerpay.io/DevLight-Mobile-Agency/ArcProgressStackView/badge.svg?style=flat)](https://beerpay.io/DevLight-Mobile-Agency/ArcProgressStackView) +[![Patreon](https://lh5.googleusercontent.com/-lXI_oKp5724/V58ysdDtxHI/AAAAAAAAC7s/g91W_YT2SM0Q_VaIhDAMmoe-jHPP3ijJwCL0B/w140-h20-no/patreon-badge.png)](https://www.patreon.com/gigamole) + +Also, if you use this library in applications that are available on Google Play, please report it to us or author. + +Thanks in advance. \ No newline at end of file From 119ee4afeff4ea71ae44eb2d0330a8d51e6bd7c7 Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Mon, 1 Aug 2016 16:33:27 +0300 Subject: [PATCH 02/19] Readme update. --- README.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/README.md b/README.md index bf25698..6e088e9 100644 --- a/README.md +++ b/README.md @@ -226,17 +226,4 @@ Author Made in [DevLight Mobile Agency](https://github.com/DevLight-Mobile-Agency) -Created by [Basil Miller](https://github.com/GIGAMOLE) - [@gigamole](mailto:gigamole53@gmail.com) - -Support -======= - -If you'd like to support future development and new product features, please make a payments on Gratipay and Beerpay or become a patron on Patreon. - -[![Gratipay](https://img.shields.io/gratipay/user/gigamole.svg?maxAge=2592000)](https://gratipay.com/~GIGAMOLE/) -[![Beerpay](https://beerpay.io/DevLight-Mobile-Agency/ArcProgressStackView/badge.svg?style=flat)](https://beerpay.io/DevLight-Mobile-Agency/ArcProgressStackView) -[![Patreon](https://lh5.googleusercontent.com/-lXI_oKp5724/V58ysdDtxHI/AAAAAAAAC7s/g91W_YT2SM0Q_VaIhDAMmoe-jHPP3ijJwCL0B/w140-h20-no/patreon-badge.png)](https://www.patreon.com/gigamole) - -Also, if you use this library in applications that are available on Google Play, please report it to us or author. - -Thanks in advance. \ No newline at end of file +Created by [Basil Miller](https://github.com/GIGAMOLE) - [@gigamole](mailto:gigamole53@gmail.com) \ No newline at end of file From 6b8432289d21ca518916ebce558b8c87a0b7f103 Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Thu, 15 Sep 2016 16:14:49 +0300 Subject: [PATCH 03/19] Update readme and sample. --- README.md | 152 +++++++++++------------ app/build.gradle | 2 +- build.gradle | 4 +- gradle/wrapper/gradle-wrapper.properties | 4 +- library/build.gradle | 6 +- 5 files changed, 81 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index bf25698..dedb6d5 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,42 @@ +
+

+ + Devlight + +

+
+ ArcProgressStackView ==================== Present your progress bars in arc mode with information and total control. -[![DevLight](https://lh4.googleusercontent.com/-9btnRFp_eVo/V5cfwZsBpMI/AAAAAAAAC4E/s4NGoezKhpAVdVofAoez1QWpzK5Na8_cQCL0B/w147-h20-no/devlight-badge.png)](http://devlight.com.ua) - -[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ArcProgressStackView-yellow.svg?style=flat)](http://android-arsenal.com/details/1/3308) -[![Android](https://img.shields.io/badge/platform-android-brightgreen.svg?style=flat&label=Platform)](https://github.com/DevLight-Mobile-Agency) -[![Download](https://api.bintray.com/packages/gigamole/maven/arcprogressstackview/images/download.svg)](https://bintray.com/gigamole/maven/arcprogressstackview/_latestVersion) -[![Crates.io](https://img.shields.io/crates/l/rustc-serialize.svg?maxAge=2592000&label=License)](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/blob/master/LICENSE.txt) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cc3e2c54db41455e83228d9db0803fae)](https://www.codacy.com/app/gigamole53/ArcProgressStackView?utm_source=github.com&utm_medium=referral&utm_content=DevLight-Mobile-Agency/ArcProgressStackView&utm_campaign=Badge_Grade) - -| | | | | | -:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------: -![](https://lh3.googleusercontent.com/-5wahrBgdCTw/VuwHChXS3FI/AAAAAAAACNQ/eqpqhfnN5G0l3EnETDQ_I5qu4kqQYSysA/w327-h551-no/apsv_preview_size_cb.gif)|![](https://lh4.googleusercontent.com/-c6X1XyKY1go/VuwHCkNghpI/AAAAAAAACNQ/x_xtWAytFPkNrbuEDylIGKNR8mh1jW-rg/w323-h552-no/apsv_preview_typeface_animation.gif)|![](https://lh6.googleusercontent.com/-mz_x7ViHvpQ/VuwHCrwvy-I/AAAAAAAACNQ/vShu09gRxDYv1eekjOLDeSKoHMSluph3w/w325-h552-no/apsv_preview_offset.gif)|![](https://lh6.googleusercontent.com/-iuYi_G-OGrc/VuwHCgvlRNI/AAAAAAAACNQ/LNaGspht3gYsAMJfclfF9InQBzTamHj0Q/w325-h552-no/apsv_preview_angle.gif)|![](https://lh6.googleusercontent.com/-ifOq29FoVrE/VuwHCprAWrI/AAAAAAAACNQ/wLdEYiyV2kwd2rQDQf0QSMe-amHIbhogQ/w325-h552-no/apsv_preview_shadow.gif) +[![Android Arsenal](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScTm9HT0JzcmpHOVE)](http://android-arsenal.com/details/1/3308) +      +[![Android](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wSccEZaclNGN0R5OWc)](https://github.com/DevLight-Mobile-Agency) +      +[![Download](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScaDl2U0QtWUx3emM)](https://bintray.com/gigamole/maven/arcprogressstackview/_latestVersion) +      +[![License](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScU0tmeFpGMHVWNWs)](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/blob/master/LICENSE.txt) +      +[![Codacy](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScSHhmckZyeGJDcXc)](https://www.codacy.com/app/gigamole53/ArcProgressStackView?utm_source=github.com&utm_medium=referral&utm_content=DevLight-Mobile-Agency/ArcProgressStackView&utm_campaign=Badge_Grade) + +
+ + + + + + + + + +
You can check the sample app [here](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/tree/master/app). Download ------------- +======== You can download a `.aar` from GitHub's [releases page](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/releases). @@ -65,98 +83,75 @@ Sample For `APSV` you can set such parameters as: - - models: - + - models: allows you to set `APSV` models, where you set title, progress and colors. Can be set up only via code. - - animation: - + - animation: allows you to animate progress with func call or with touch event. - - shadow: - + - shadow: allows you to add shadow to your progress models, but remember, the shadow need `LAYER_TYPE_SOFTWARE`, so it decrease FPS. - - round corners: - + - round corners: allows you to set round corners to models. - - drag/seek: - + - drag/seek: allows you to make your progress model seek like. - - typeface: - + - typeface: allows you to set custom typeface. - - text color: - + - text color: allows you to set text(title and progress indicator) color. - - shadow distance: - + - shadow distance: allows you to set shadow distance. - - shadow angle: - + - shadow angle: allows you to set shadow angle. - - shadow radius: - + - shadow radius: allows you to set shadow radius. - - shadow color: - + - shadow color: allows you to set shadow color. - - animation duration: - + - animation duration: allows you to set animation duration. - - animation listener: - + - animation listener: allows you to set animation listener. - - interpolator: - + - interpolator: allows you to set interpolator to animation. - - draw width: - + - draw width: allows you to set draw width in fraction mode(e.g. 55%) or dimension mode. - - model offset: - + - model offset: allows you to set model offset(positive or negative). - - model background: - + - model background: allows you to set model background track from start angle to sweep angle. - - start angle: - + - start angle: allows you to set start angle of models. - - sweep angle: - + - sweep angle: allows you to set sweep angle of models. - - progress indicator orientation: - + - progress indicator orientation: allows you to set progress indicator orientation. - - preview colors: - + - preview colors: allows you to set preview colors, which generate count of models equals to count of colors. - - preview background: - + - preview background: allows you to set models background preview color. Tips -All angle variables can only be positive and be in range from 0 to 360 degrees. - +All angle variables can only be positive and be in range from 0 to 360 degrees. The size of `View` automatically set up in square mode. Init @@ -176,7 +171,7 @@ arcProgressStackView.setModels(models); Other methods check out in sample. -And XML init: +And `XML` init: ```xml Date: Thu, 15 Sep 2016 16:27:10 +0300 Subject: [PATCH 04/19] Update readme. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index dedb6d5..b1ca45e 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,6 @@ Present your progress bars in arc mode with information and total control.       [![Codacy](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScSHhmckZyeGJDcXc)](https://www.codacy.com/app/gigamole53/ArcProgressStackView?utm_source=github.com&utm_medium=referral&utm_content=DevLight-Mobile-Agency/ArcProgressStackView&utm_campaign=Badge_Grade) -
- @@ -210,7 +208,7 @@ Credits |[Ron Evgeniy](https://www.behance.net/RonEvgeniy)|[Virgil Pana](https://dribbble.com/virgilpana)| | | |:-----------------------------------------------:|:--------------------------------------------:|:-:|:-:| -|[![](https://mir-s3-cdn-cf.behance.net/project_modules/1400/47e59433128783.570c133a2084b.png)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://d13yacurqjgara.cloudfront.net/users/124059/screenshots/1926158/attachments/352243/shot.gif)](https://dribbble.com/shots/1926158-Data-Visualization)|| +|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScZmFTcTQ3NlhMRWM)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://d13yacurqjgara.cloudfront.net/users/124059/screenshots/1926158/attachments/352243/shot.gif)](https://dribbble.com/shots/1926158-Data-Visualization)|| Author ====== From ecb87ac9bfc623d7a7b5c886ef0d615c6f3d5423 Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Thu, 15 Sep 2016 16:31:32 +0300 Subject: [PATCH 05/19] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b1ca45e..4559b16 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ Credits |[Ron Evgeniy](https://www.behance.net/RonEvgeniy)|[Virgil Pana](https://dribbble.com/virgilpana)| | | |:-----------------------------------------------:|:--------------------------------------------:|:-:|:-:| -|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScZmFTcTQ3NlhMRWM)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://d13yacurqjgara.cloudfront.net/users/124059/screenshots/1926158/attachments/352243/shot.gif)](https://dribbble.com/shots/1926158-Data-Visualization)|| +|[![](https://drive.google.com/file/d/0BxPO_UeS7wScQm9QbjV4VWh2R2c/view?usp=sharing)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|| Author ====== From 5413de7e59b0fdddeeff966ea37e5f8b50fd5c60 Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Thu, 15 Sep 2016 16:32:59 +0300 Subject: [PATCH 06/19] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4559b16..57e03df 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ Credits |[Ron Evgeniy](https://www.behance.net/RonEvgeniy)|[Virgil Pana](https://dribbble.com/virgilpana)| | | |:-----------------------------------------------:|:--------------------------------------------:|:-:|:-:| -|[![](https://drive.google.com/file/d/0BxPO_UeS7wScQm9QbjV4VWh2R2c/view?usp=sharing)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|| +|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScQm9QbjV4VWh2R2c)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|| Author ====== From fb9943e7f923d2572479974c3b0542c76669fc7d Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Thu, 15 Sep 2016 16:34:52 +0300 Subject: [PATCH 07/19] Update readme. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 57e03df..b863478 100644 --- a/README.md +++ b/README.md @@ -206,9 +206,9 @@ To report a specific problem or feature request, [open a new issue on Github](ht Credits ======= -|[Ron Evgeniy](https://www.behance.net/RonEvgeniy)|[Virgil Pana](https://dribbble.com/virgilpana)| | | -|:-----------------------------------------------:|:--------------------------------------------:|:-:|:-:| -|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScQm9QbjV4VWh2R2c)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|| +|[Ron Evgeniy](https://www.behance.net/RonEvgeniy)|[Virgil Pana](https://dribbble.com/virgilpana)|[Gleb Kuznetsov](https://dribbble.com/glebich)| +|:-----------------------------------------------:|:--------------------------------------------:|:--------------------------------------------:| +|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScQm9QbjV4VWh2R2c)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|[![](https://d13yacurqjgara.cloudfront.net/users/32512/screenshots/2123768/untitled-1kj.png)](https://dribbble.com/shots/2123768-graph-ios-app)| Author ====== From 4bb2b242af89a93fe5ff7a1b9d97223ae6556cd0 Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Thu, 15 Sep 2016 16:37:41 +0300 Subject: [PATCH 08/19] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b863478..483e13c 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ Credits |[Ron Evgeniy](https://www.behance.net/RonEvgeniy)|[Virgil Pana](https://dribbble.com/virgilpana)|[Gleb Kuznetsov](https://dribbble.com/glebich)| |:-----------------------------------------------:|:--------------------------------------------:|:--------------------------------------------:| -|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScQm9QbjV4VWh2R2c)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|[![](https://d13yacurqjgara.cloudfront.net/users/32512/screenshots/2123768/untitled-1kj.png)](https://dribbble.com/shots/2123768-graph-ios-app)| +|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScQm9QbjV4VWh2R2c)](https://www.behance.net/gallery/33128783/12-weeks-marathon-in-Sketch)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScc1Qyd0pMQm5vd0U)](https://dribbble.com/shots/1926158-Data-Visualization)|[![](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScakVhdXpENlJQdXc)](https://dribbble.com/shots/2123768-graph-ios-app)| Author ====== From a47360e956f644c9e971a0358542bd8e3f14e8bd Mon Sep 17 00:00:00 2001 From: GIGAMOLE Date: Thu, 22 Sep 2016 11:45:15 +0300 Subject: [PATCH 09/19] Update 1.0.4. --- README.md | 16 +- app/build.gradle | 2 +- .../devlight/io/sample}/ApplicationTest.java | 2 +- app/src/main/AndroidManifest.xml | 16 +- .../io/sample}/MainActivity.java | 29 +- .../io/sample/PresentationActivity.java | 94 +++++++ app/src/main/res/layout/activity_main.xml | 24 +- .../main/res/layout/activity_presentation.xml | 102 +++++++ app/src/main/res/values/arrays.xml | 16 ++ app/src/main/res/values/colors.xml | 6 - app/src/main/res/values/styles.xml | 5 +- {library => arcprogressstackview}/.gitignore | 0 .../build.gradle | 24 +- .../proguard-rules.pro | 0 .../devlight/io/library}/ApplicationTest.java | 2 +- .../src/main/AndroidManifest.xml | 2 +- .../io}/library/ArcProgressStackView.java | 257 +++++++++--------- .../src/main/res/values/arrays.xml | 0 .../src/main/res/values/attrs.xml | 1 + .../src/main/res/values/strings.xml | 0 settings.gradle | 2 +- 21 files changed, 428 insertions(+), 172 deletions(-) rename {library/src/androidTest/java/com/gigamole/library => app/src/androidTest/java/devlight/io/sample}/ApplicationTest.java (91%) rename app/src/main/java/{com/gigamole/arcprogressstackview => devlight/io/sample}/MainActivity.java (91%) create mode 100644 app/src/main/java/devlight/io/sample/PresentationActivity.java create mode 100644 app/src/main/res/layout/activity_presentation.xml delete mode 100644 app/src/main/res/values/colors.xml rename {library => arcprogressstackview}/.gitignore (100%) rename {library => arcprogressstackview}/build.gradle (88%) rename {library => arcprogressstackview}/proguard-rules.pro (100%) rename {app/src/androidTest/java/com/gigamole/arcprogressstackview => arcprogressstackview/src/androidTest/java/devlight/io/library}/ApplicationTest.java (88%) rename {library => arcprogressstackview}/src/main/AndroidManifest.xml (95%) rename {library/src/main/java/com/gigamole => arcprogressstackview/src/main/java/devlight/io}/library/ArcProgressStackView.java (86%) rename {library => arcprogressstackview}/src/main/res/values/arrays.xml (100%) rename {library => arcprogressstackview}/src/main/res/values/attrs.xml (97%) rename {library => arcprogressstackview}/src/main/res/values/strings.xml (100%) diff --git a/README.md b/README.md index 483e13c..8eacd83 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,9 @@ Present your progress bars in arc mode with information and total control.       [![Codacy](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScSHhmckZyeGJDcXc)](https://www.codacy.com/app/gigamole53/ArcProgressStackView?utm_source=github.com&utm_medium=referral&utm_content=DevLight-Mobile-Agency/ArcProgressStackView&utm_campaign=Badge_Grade) -
- - - - - - - -
+

+ +

You can check the sample app [here](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/tree/master/app). @@ -172,14 +166,14 @@ Other methods check out in sample. And `XML` init: ```xml - - + - + - + + + diff --git a/app/src/main/java/com/gigamole/arcprogressstackview/MainActivity.java b/app/src/main/java/devlight/io/sample/MainActivity.java similarity index 91% rename from app/src/main/java/com/gigamole/arcprogressstackview/MainActivity.java rename to app/src/main/java/devlight/io/sample/MainActivity.java index 3abd812..0fc4bd3 100644 --- a/app/src/main/java/com/gigamole/arcprogressstackview/MainActivity.java +++ b/app/src/main/java/devlight/io/sample/MainActivity.java @@ -1,8 +1,9 @@ -package com.gigamole.arcprogressstackview; +package devlight.io.sample; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; +import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; @@ -17,11 +18,12 @@ import com.commonsware.cwac.colormixer.ColorMixer; import com.commonsware.cwac.colormixer.ColorMixerDialog; -import com.gigamole.library.ArcProgressStackView; import java.util.ArrayList; import java.util.Random; +import devlight.io.library.ArcProgressStackView; + public class MainActivity extends AppCompatActivity implements View.OnClickListener, CompoundButton.OnCheckedChangeListener, @@ -59,7 +61,7 @@ private void init() { mArcProgressStackView = (ArcProgressStackView) findViewById(R.id.apsv); // Get colors - final String[] startColors = getResources().getStringArray(R.array.polluted_waves); + final String[] startColors = getResources().getStringArray(R.array.devlight); final String[] endColors = getResources().getStringArray(R.array.default_preview); final String[] bgColors = getResources().getStringArray(R.array.medical_express); @@ -71,10 +73,10 @@ private void init() { // Set models final ArrayList models = new ArrayList<>(); - models.add(new ArcProgressStackView.Model("Circle", 0, Color.parseColor(bgColors[0]), mStartColors[0])); - models.add(new ArcProgressStackView.Model("Progress", 0, Color.parseColor(bgColors[1]), mStartColors[1])); - models.add(new ArcProgressStackView.Model("Stack", 0, Color.parseColor(bgColors[2]), mStartColors[2])); - models.add(new ArcProgressStackView.Model("View", 0, Color.parseColor(bgColors[3]), mStartColors[3])); + models.add(new ArcProgressStackView.Model("Strategy", 0, Color.parseColor(bgColors[0]), mStartColors[0])); + models.add(new ArcProgressStackView.Model("Design", 0, Color.parseColor(bgColors[1]), mStartColors[1])); + models.add(new ArcProgressStackView.Model("Development", 0, Color.parseColor(bgColors[2]), mStartColors[2])); + models.add(new ArcProgressStackView.Model("QA", 0, Color.parseColor(bgColors[3]), mStartColors[3])); mArcProgressStackView.setModels(models); // Get wrappers @@ -86,6 +88,7 @@ private void init() { final CheckBox cbDragging = (CheckBox) findViewById(R.id.cb_dragging); final CheckBox cbShadowing = (CheckBox) findViewById(R.id.cb_shadowing); final CheckBox cbRounding = (CheckBox) findViewById(R.id.cb_rounding); + final CheckBox cbLeveling = (CheckBox) findViewById(R.id.cb_leveling); final CheckBox cbShowModelBg = (CheckBox) findViewById(R.id.cb_show_model_bg); final CheckBox cbUseCustomTypeface = (CheckBox) findViewById(R.id.cb_use_custom_typeface); final CheckBox cbUseOvershootInterpolator = (CheckBox) findViewById(R.id.cb_use_overshoot_interpolator); @@ -98,6 +101,7 @@ private void init() { cbShadowing.setOnCheckedChangeListener(this); cbRounding.setOnCheckedChangeListener(this); cbShowModelBg.setOnCheckedChangeListener(this); + cbLeveling.setOnCheckedChangeListener(this); cbUseCustomTypeface.setOnCheckedChangeListener(this); cbUseOvershootInterpolator.setOnCheckedChangeListener(this); cbUseVerticalOrientation.setOnCheckedChangeListener(this); @@ -107,6 +111,7 @@ private void init() { onCheckedChanged(cbDragging, cbDragging.isChecked()); onCheckedChanged(cbShadowing, cbShadowing.isChecked()); onCheckedChanged(cbRounding, cbRounding.isChecked()); + onCheckedChanged(cbLeveling, cbLeveling.isChecked()); onCheckedChanged(cbShowModelBg, cbShowModelBg.isChecked()); onCheckedChanged(cbUseCustomTypeface, cbUseCustomTypeface.isChecked()); onCheckedChanged(cbUseOvershootInterpolator, cbUseOvershootInterpolator.isChecked()); @@ -117,12 +122,14 @@ private void init() { mBtnTextColor = (Button) findViewById(R.id.btn_text_color); mBtnShadowColor = (Button) findViewById(R.id.btn_shadow_color); final Button btnAnimate = (Button) findViewById(R.id.btn_animate); + final Button btnPresentation = (Button) findViewById(R.id.btn_presentation); final Button btnReset = (Button) findViewById(R.id.btn_reset); // Set buttons mBtnTextColor.setOnClickListener(this); mBtnShadowColor.setOnClickListener(this); btnAnimate.setOnClickListener(this); + btnPresentation.setOnClickListener(this); btnReset.setOnClickListener(this); // Set default colors @@ -187,13 +194,16 @@ public void onCheckedChanged(final CompoundButton buttonView, final boolean isCh break; case R.id.cb_shadowing: mArcProgressStackView.setIsShadowed(isChecked); - mArcProgressStackView.postInvalidate(); + mArcProgressStackView.requestLayout(); mWrapperShadow.setVisibility(isChecked ? View.VISIBLE : View.GONE); break; case R.id.cb_rounding: mArcProgressStackView.setIsRounded(isChecked); mArcProgressStackView.postInvalidate(); break; + case R.id.cb_leveling: + mArcProgressStackView.setIsLeveled(isChecked); + break; case R.id.cb_show_model_bg: mArcProgressStackView.setModelBgEnabled(isChecked); break; @@ -242,6 +252,9 @@ public void onClick(final View v) { finish(); startActivity(getIntent()); break; + case R.id.btn_presentation: + startActivity(new Intent(MainActivity.this, PresentationActivity.class)); + break; default: break; } diff --git a/app/src/main/java/devlight/io/sample/PresentationActivity.java b/app/src/main/java/devlight/io/sample/PresentationActivity.java new file mode 100644 index 0000000..3097d0e --- /dev/null +++ b/app/src/main/java/devlight/io/sample/PresentationActivity.java @@ -0,0 +1,94 @@ +package devlight.io.sample; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.app.Activity; +import android.graphics.Color; +import android.os.Bundle; +import android.view.View; + +import java.util.ArrayList; + +import devlight.io.library.ArcProgressStackView; + +import static devlight.io.library.ArcProgressStackView.Model; +import static devlight.io.sample.MainActivity.MODEL_COUNT; + +/** + * Created by GIGAMOLE on 9/21/16. + */ + +public class PresentationActivity extends Activity { + + private int mCounter = 0; + + private ArcProgressStackView mArcProgressStackView; + + @Override + protected void onCreate(final Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_presentation); + + mArcProgressStackView = (ArcProgressStackView) findViewById(R.id.apsv_presentation); + mArcProgressStackView.setShadowColor(Color.argb(200, 0, 0, 0)); + mArcProgressStackView.setAnimationDuration(1000); + mArcProgressStackView.setSweepAngle(270); + + final String[] stringColors = getResources().getStringArray(R.array.devlight); + final String[] stringBgColors = getResources().getStringArray(R.array.bg); + + final int[] colors = new int[MODEL_COUNT]; + final int[] bgColors = new int[MODEL_COUNT]; + for (int i = 0; i < MODEL_COUNT; i++) { + colors[i] = Color.parseColor(stringColors[i]); + bgColors[i] = Color.parseColor(stringBgColors[i]); + } + + final ArrayList models = new ArrayList<>(); + models.add(new Model("STRATEGY", 1, bgColors[0], colors[0])); + models.add(new Model("DESIGN", 1, bgColors[1], colors[1])); + models.add(new Model("DEVELOPMENT", 1, bgColors[2], colors[2])); + models.add(new Model("QA", 1, bgColors[3], colors[3])); + mArcProgressStackView.setModels(models); + + final ValueAnimator valueAnimator = ValueAnimator.ofFloat(1.0F, 105.0F); + valueAnimator.setDuration(800); + valueAnimator.setStartDelay(200); + valueAnimator.setRepeatMode(ValueAnimator.RESTART); + valueAnimator.setRepeatCount(MODEL_COUNT - 1); + valueAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(final Animator animation) { + animation.removeListener(this); + animation.addListener(this); + mCounter = 0; + + for (final Model model : mArcProgressStackView.getModels()) model.setProgress(1); + mArcProgressStackView.animateProgress(); + } + + @Override + public void onAnimationRepeat(final Animator animation) { + mCounter++; + } + }); + valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(final ValueAnimator animation) { + mArcProgressStackView.getModels().get(Math.min(mCounter, MODEL_COUNT - 1)) + .setProgress((Float) animation.getAnimatedValue()); + mArcProgressStackView.postInvalidate(); + } + }); + + mArcProgressStackView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(final View v) { + if (valueAnimator.isRunning()) return; + if (mArcProgressStackView.getProgressAnimator().isRunning()) return; + valueAnimator.start(); + } + }); + } +} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 668dcba..ae0bed5 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -14,12 +14,12 @@ android:layout_height="wrap_content" android:padding="15dp"> - @@ -98,6 +98,20 @@ + + + + + + + +