From d10c61898d3b98ff69e1e3698fe7b3f52166b70b Mon Sep 17 00:00:00 2001 From: ligi Date: Thu, 28 Jul 2016 10:02:59 +0200 Subject: [PATCH] Add syntax highlight for xml/groovy and some more java snippets --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 96a1933..a4c7060 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Grab the above demo app from here : Add it in your root build.gradle at the end of repositories: -``` +```groovy allprojects { repositories { ... @@ -34,7 +34,7 @@ allprojects { ``` and then add dependency -``` +```groovy dependencies { compile 'com.github.varunest:sparkbutton:1.0.0' } @@ -44,7 +44,7 @@ dependencies { ###XML -``` +```xml @@ -92,14 +92,14 @@ You can specify both active and inactive image of the button. If only active ima SparkButton takes two colors primary and secondary. (It is recommended that primary color is lighter than secondary for better results). ####XML -``` +```xml app:sparkbutton_activeImage="@drawable/active_image" app:sparkbutton_inActiveImage="@drawable/inactive_image" app:sparkbutton_primaryColor="@color/primaryColor" app:sparkbutton_secondaryColor="@color/secondaryColor" ``` ####Java -``` +```java SparkButton button = new SparkButtonBuilder(context) .setActiveImage(R.drawable.active_image) .setInActiveImage(R.drawable.inactive_image) @@ -112,12 +112,12 @@ SparkButton button = new SparkButtonBuilder(context) You can specify the fraction by which the animation speed should increase/decrease. ####XML -``` +```xml app:sparkbutton_animationSpeed="1.5" ``` ####Java -``` +```java sparkbutton.setAnimationSpeed(1.5f); ``` @@ -133,7 +133,7 @@ sparkButton.setChecked(true); Simply call setEventListener to listen click events. -``` +```java sparkButton.setEventListener(new SparkEventListener(){ @Override void onEvent(ImageView button, boolean buttonState) { @@ -149,7 +149,7 @@ sparkButton.setEventListener(new SparkEventListener(){ ###Play Animation If you want to play animation regardless of click event execute following function: -``` +```java sparkButton.playAnimation(); ```