diff --git a/README.md b/README.md index fb3d79e..aba6388 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Usage Grab it from maven: ```groovy - compile 'com.github.tibolte:elasticdownload:1.0.+' + implementation 'com.github.tibolte:elasticdownload:1.0.+' ```` diff --git a/elasticdownload/src/main/java/is/arontibo/library/ElasticDownloadView.java b/elasticdownload/src/main/java/is/arontibo/library/ElasticDownloadView.java index 17f2b6d..bf280bb 100644 --- a/elasticdownload/src/main/java/is/arontibo/library/ElasticDownloadView.java +++ b/elasticdownload/src/main/java/is/arontibo/library/ElasticDownloadView.java @@ -107,5 +107,32 @@ public void onEnterAnimationFinished() { // Do further actions if necessary } + + + /** + * Set the background color of the Elastic Download View + * @param passedColor int Color Color to set the background + */ + public void setBackgroundColor(int passedColor) { + this.mBackgroundColor = passedColor; + this.mProgressDownloadView.setBackgroundColor(mBackgroundColor); + } + + /** + * Overloaded method, takes in a String color to parse + * @param passedColor String of a color hex color (IE: #fd5c79) that can be parsed by + * Color.parseColor(string) + */ + public void setBackgroundColor(String passedColor) { + if (passedColor == null){ + return; + } + try { + int color = Color.parseColor(passedColor); + this.setBackgroundColor(color); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } + } }