diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..fe5af22
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,14 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:$GRADLE_PLUGIN_VERSION"
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
diff --git a/demo.gif b/demo.gif
new file mode 100644
index 0000000..9d70a2d
Binary files /dev/null and b/demo.gif differ
diff --git a/example/build.gradle b/example/build.gradle
new file mode 100644
index 0000000..e4ee41a
--- /dev/null
+++ b/example/build.gradle
@@ -0,0 +1,27 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion COMPILE_SDK_VERSION
+ buildToolsVersion BUILD_TOOLS_VERSION
+
+ defaultConfig {
+ applicationId "com.github.ivbaranov.mfb.exmaple"
+ minSdkVersion MIN_SDK_VERSION
+ targetSdkVersion TARGET_SDK_VERSION
+ versionCode 1
+ versionName VERSION_NAME
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile project(':materialfavoritebutton')
+ compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
+ compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
+ compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
+}
diff --git a/example/proguard-rules.pro b/example/proguard-rules.pro
new file mode 100644
index 0000000..19345ba
--- /dev/null
+++ b/example/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Users/ivbaranov/Documents/Android/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/example/src/main/AndroidManifest.xml b/example/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..2674678
--- /dev/null
+++ b/example/src/main/AndroidManifest.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/src/main/java/com/github/ivbaranov/mfb/example/MainActivity.java b/example/src/main/java/com/github/ivbaranov/mfb/example/MainActivity.java
new file mode 100644
index 0000000..251b81e
--- /dev/null
+++ b/example/src/main/java/com/github/ivbaranov/mfb/example/MainActivity.java
@@ -0,0 +1,84 @@
+package com.github.ivbaranov.mfb.example;
+
+import android.os.Bundle;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.TextView;
+import com.github.ivbaranov.mfb.MaterialFavoriteButton;
+
+public class MainActivity extends AppCompatActivity {
+ private TextView niceCounter;
+ private int niceCounterValue = 37;
+
+ @Override protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ //in the toolbar
+ MaterialFavoriteButton toolbarFavorite = new MaterialFavoriteButton.Builder(this) //
+ .favorite(true)
+ .color(MaterialFavoriteButton.STYLE_WHITE)
+ .type(MaterialFavoriteButton.STYLE_HEART)
+ .rotationDuration(400)
+ .create();
+ toolbar.addView(toolbarFavorite);
+ toolbarFavorite.setOnFavoriteChangeListener(
+ new MaterialFavoriteButton.OnFavoriteChangeListener() {
+ @Override
+ public void onFavoriteChanged(MaterialFavoriteButton buttonView, boolean favorite) {
+ Snackbar.make(buttonView, getString(R.string.toolbar_favorite_snack) + favorite,
+ Snackbar.LENGTH_SHORT).show();
+ }
+ });
+
+ //nice cardview
+ niceCounter = (TextView) findViewById(R.id.counter_value);
+ niceCounter.setText(String.valueOf(niceCounterValue));
+ MaterialFavoriteButton materialFavoriteButtonNice =
+ (MaterialFavoriteButton) findViewById(R.id.favorite_nice);
+ materialFavoriteButtonNice.setFavorite(true, false);
+ materialFavoriteButtonNice.setOnFavoriteChangeListener(
+ new MaterialFavoriteButton.OnFavoriteChangeListener() {
+ @Override
+ public void onFavoriteChanged(MaterialFavoriteButton buttonView, boolean favorite) {
+ if (favorite) {
+ niceCounterValue++;
+ } else {
+ niceCounterValue--;
+ }
+ }
+ });
+ materialFavoriteButtonNice.setOnFavoriteAnimationEndListener(
+ new MaterialFavoriteButton.OnFavoriteAnimationEndListener() {
+ @Override
+ public void onAnimationEnd(MaterialFavoriteButton buttonView, boolean favorite) {
+ niceCounter.setText(String.valueOf(niceCounterValue));
+ }
+ });
+ }
+
+ @Override public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ return true;
+ }
+
+ @Override public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ //noinspection SimplifiableIfStatement
+ if (id == R.id.action_settings) {
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/example/src/main/res/drawable-hdpi/ic_event_available_black_24dp.png b/example/src/main/res/drawable-hdpi/ic_event_available_black_24dp.png
new file mode 100644
index 0000000..aed4caf
Binary files /dev/null and b/example/src/main/res/drawable-hdpi/ic_event_available_black_24dp.png differ
diff --git a/example/src/main/res/drawable-hdpi/ic_event_busy_black_24dp.png b/example/src/main/res/drawable-hdpi/ic_event_busy_black_24dp.png
new file mode 100644
index 0000000..bc75dcb
Binary files /dev/null and b/example/src/main/res/drawable-hdpi/ic_event_busy_black_24dp.png differ
diff --git a/example/src/main/res/drawable-hdpi/ic_settings_black_24dp.png b/example/src/main/res/drawable-hdpi/ic_settings_black_24dp.png
new file mode 100644
index 0000000..acf1ddf
Binary files /dev/null and b/example/src/main/res/drawable-hdpi/ic_settings_black_24dp.png differ
diff --git a/example/src/main/res/layout/activity_main.xml b/example/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..d3cb3e2
--- /dev/null
+++ b/example/src/main/res/layout/activity_main.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/src/main/res/layout/content_main.xml b/example/src/main/res/layout/content_main.xml
new file mode 100644
index 0000000..d4ebf55
--- /dev/null
+++ b/example/src/main/res/layout/content_main.xml
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/src/main/res/menu/menu_main.xml b/example/src/main/res/menu/menu_main.xml
new file mode 100644
index 0000000..0eaad1b
--- /dev/null
+++ b/example/src/main/res/menu/menu_main.xml
@@ -0,0 +1,11 @@
+
diff --git a/example/src/main/res/mipmap-hdpi/ic_launcher.png b/example/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/example/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/example/src/main/res/mipmap-mdpi/ic_launcher.png b/example/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/example/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/example/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/example/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/example/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/example/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/example/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
Binary files /dev/null and b/example/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/example/src/main/res/values-v21/styles.xml b/example/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..9431d7a
--- /dev/null
+++ b/example/src/main/res/values-v21/styles.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/example/src/main/res/values-w820dp/dimens.xml b/example/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/example/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/example/src/main/res/values/colors.xml b/example/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/example/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/example/src/main/res/values/dimens.xml b/example/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..17d54c5
--- /dev/null
+++ b/example/src/main/res/values/dimens.xml
@@ -0,0 +1,11 @@
+
+
+ 16dp
+ 16dp
+ 16dp
+ 8dp
+ 8dp
+ 8dp
+ 16dp
+ 6dp
+
diff --git a/example/src/main/res/values/strings.xml b/example/src/main/res/values/strings.xml
new file mode 100644
index 0000000..5956c7e
--- /dev/null
+++ b/example/src/main/res/values/strings.xml
@@ -0,0 +1,11 @@
+
+ MaterialFavoriteButton
+ Settings
+ On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue.
+ In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ Starred:
+ Favorite
+ "Toolbar favorite clicked: "
+
diff --git a/example/src/main/res/values/styles.xml b/example/src/main/res/values/styles.xml
new file mode 100644
index 0000000..3ddceb4
--- /dev/null
+++ b/example/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..db01311
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,22 @@
+# suppress inspection "UnusedProperty" for whole file
+
+# Compile SDK version (SDK platform to compile with)
+COMPILE_SDK_VERSION=android-23
+
+# Build tools version (Build tools version to build with)
+BUILD_TOOLS_VERSION=23.0.1
+
+# Minimum SDK version (lowest SDK platform to target)
+MIN_SDK_VERSION=11
+
+# Target SDK version (highest SDK platform to target)
+TARGET_SDK_VERSION=23
+
+# Current library version
+VERSION_NAME=0.1.0
+
+# Dependency versions (library)
+SUPPORT_LIBRARY_VERSION=23.0.1
+
+# Dependency versions (plugins)
+GRADLE_PLUGIN_VERSION=1.3.0
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..b433f90
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu Sep 24 13:58:58 MSK 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/materialfavoritebutton/build.gradle b/materialfavoritebutton/build.gradle
new file mode 100644
index 0000000..ba43360
--- /dev/null
+++ b/materialfavoritebutton/build.gradle
@@ -0,0 +1,15 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion COMPILE_SDK_VERSION
+ buildToolsVersion BUILD_TOOLS_VERSION
+
+ defaultConfig {
+ minSdkVersion MIN_SDK_VERSION
+ targetSdkVersion TARGET_SDK_VERSION
+ versionName VERSION_NAME
+ }
+}
+
+dependencies {
+}
diff --git a/materialfavoritebutton/proguard-rules.pro b/materialfavoritebutton/proguard-rules.pro
new file mode 100644
index 0000000..19345ba
--- /dev/null
+++ b/materialfavoritebutton/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Users/ivbaranov/Documents/Android/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/materialfavoritebutton/src/androidTest/java/com/github/ivbaranov/mfb/ApplicationTest.java b/materialfavoritebutton/src/androidTest/java/com/github/ivbaranov/mfb/ApplicationTest.java
new file mode 100644
index 0000000..2ab4bff
--- /dev/null
+++ b/materialfavoritebutton/src/androidTest/java/com/github/ivbaranov/mfb/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.github.ivbaranov.mfb;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
\ No newline at end of file
diff --git a/materialfavoritebutton/src/main/AndroidManifest.xml b/materialfavoritebutton/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..dc8be4d
--- /dev/null
+++ b/materialfavoritebutton/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/materialfavoritebutton/src/main/java/com/github/ivbaranov/mfb/MaterialFavoriteButton.java b/materialfavoritebutton/src/main/java/com/github/ivbaranov/mfb/MaterialFavoriteButton.java
new file mode 100644
index 0000000..bb4d0f2
--- /dev/null
+++ b/materialfavoritebutton/src/main/java/com/github/ivbaranov/mfb/MaterialFavoriteButton.java
@@ -0,0 +1,466 @@
+package com.github.ivbaranov.mfb;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.OvershootInterpolator;
+import android.widget.ImageView;
+
+public class MaterialFavoriteButton extends ImageView {
+ private static final int DEFAULT_PADDING = 12;
+ private static final boolean DEFAULT_FAVORITE = false;
+ private static final boolean DEFAULT_ANIMATION = true;
+ private static final int DEFAULT_ROTATION_DURATION = 400;
+ private static final int DEFAULT_ROTATION_ANGLE = 360;
+ private static final int DEFAULT_BOUNCE_DURATION = 300;
+ private static final int FAVORITE_STAR_BLACK = R.drawable.ic_star_black_24dp;
+ private static final int FAVORITE_STAR_BORDER_BLACK = R.drawable.ic_star_border_black_24dp;
+ private static final int FAVORITE_STAR_WHITE = R.drawable.ic_star_white_24dp;
+ private static final int FAVORITE_STAR_BORDER_WHITE = R.drawable.ic_star_border_white_24dp;
+ private static final int FAVORITE_HEART_BLACK = R.drawable.ic_favorite_black_24dp;
+ private static final int FAVORITE_HEART_BORDER_BLACK = R.drawable.ic_favorite_border_black_24dp;
+ private static final int FAVORITE_HEART_WHITE = R.drawable.ic_favorite_white_24dp;
+ private static final int FAVORITE_HEART_BORDER_WHITE = R.drawable.ic_favorite_border_white_24dp;
+ public static final int STYLE_BLACK = 0;
+ public static final int STYLE_WHITE = 1;
+ public static final int STYLE_STAR = 0;
+ public static final int STYLE_HEART = 1;
+ private static final AccelerateInterpolator ACCELERATE_INTERPOLATOR =
+ new AccelerateInterpolator();
+ private static final OvershootInterpolator OVERSHOOT_INTERPOLATOR = new OvershootInterpolator(4);
+
+ private int mButtonSize;
+ private int mPadding;
+ private boolean mFavorite;
+ private boolean mAnimation;
+ private int mFavoriteResource;
+ private int mNotFavoriteResource;
+ private int mRotationDuration;
+ private int mRotationAngle;
+ private int mBounceDuration;
+ private int mColor;
+ private int mType;
+
+ private OnFavoriteChangeListener mOnFavoriteChangeListener;
+ private OnFavoriteAnimationEndListener mOnFavoriteAnimationEndListener;
+ private boolean mBroadcasting;
+
+ public MaterialFavoriteButton(Context context) {
+ super(context);
+ init(context, null);
+ }
+
+ public MaterialFavoriteButton(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init(context, attrs);
+ }
+
+ public MaterialFavoriteButton(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ init(context, attrs);
+ }
+
+ /**
+ * Interface definition for a callback to be invoked when the favorite state is changed.
+ */
+ public interface OnFavoriteChangeListener {
+ /**
+ * Called when the favorite state is changed.
+ *
+ * @param buttonView the button view whose state has changed
+ * @param favorite the favorite state
+ */
+ public void onFavoriteChanged(MaterialFavoriteButton buttonView, boolean favorite);
+ }
+
+ /**
+ * Set a listener will be called when the favorite state is changed.
+ *
+ * @param listener the {@link MaterialFavoriteButton.OnFavoriteChangeListener} will be called
+ */
+ public void setOnFavoriteChangeListener(OnFavoriteChangeListener listener) {
+ mOnFavoriteChangeListener = listener;
+ }
+
+ /**
+ * Interface definition for a callback to be invoked when the favorite animation ends.
+ */
+ public interface OnFavoriteAnimationEndListener {
+ /**
+ * Called when the favorite animation ended.
+ *
+ * @param buttonView the button view whose animation ended
+ * @param favorite the favorite state
+ */
+ public void onAnimationEnd(MaterialFavoriteButton buttonView, boolean favorite);
+ }
+
+ /**
+ * Set a listener will be called when the favorite state is changed.
+ *
+ * @param listener the {@link MaterialFavoriteButton.OnFavoriteAnimationEndListener} will be
+ * called
+ */
+ public void setOnFavoriteAnimationEndListener(OnFavoriteAnimationEndListener listener) {
+ mOnFavoriteAnimationEndListener = listener;
+ }
+
+ /**
+ * Initialize the default values
+ *
+ * - size = 48 dp
+ * - padding = 12 dp
+ * - is mFavorite = false
+ * - animated = true
+ * - default drawables - stars
+ * - rotation duration = 300 ms
+ * - rotation angle = 360 degrees
+ * - bounce duration = 300 ms
+ * - color of default icon = black
+ * - type of default icon = star
+ *
+ */
+ private void init(Context context, AttributeSet attrs) {
+ mButtonSize = Utils.dpToPx(48, getResources());
+ mPadding = Utils.dpToPx(DEFAULT_PADDING, getResources());
+ mFavorite = DEFAULT_FAVORITE;
+ mAnimation = DEFAULT_ANIMATION;
+ mFavoriteResource = FAVORITE_STAR_BLACK;
+ mNotFavoriteResource = FAVORITE_STAR_BORDER_BLACK;
+ mRotationDuration = DEFAULT_ROTATION_DURATION;
+ mRotationAngle = DEFAULT_ROTATION_ANGLE;
+ mBounceDuration = DEFAULT_BOUNCE_DURATION;
+ mColor = STYLE_BLACK;
+ mType = STYLE_STAR;
+ if (!isInEditMode()) {
+ if (attrs != null) {
+ initAttributes(context, attrs);
+ }
+ setOnClickListener(new OnClickListener() {
+ @Override public void onClick(View v) {
+ toggleFavorite();
+ }
+ });
+ }
+ if (mFavorite) {
+ setImageResource(mFavoriteResource);
+ } else {
+ setImageResource(mNotFavoriteResource);
+ }
+ setPadding(mPadding, mPadding, mPadding, mPadding);
+ }
+
+ private void initAttributes(Context context, AttributeSet attributeSet) {
+ TypedArray attr = getTypedArray(context, attributeSet, R.styleable.MaterialFavoriteButton);
+ if (attr != null) {
+ try {
+ mAnimation = attr.getBoolean(R.styleable.MaterialFavoriteButton_mfb_animated, mAnimation);
+ mPadding = Utils.dpToPx(
+ attr.getInt(R.styleable.MaterialFavoriteButton_mfb_padding, DEFAULT_PADDING),
+ getResources());
+ if (attr.getResourceId(R.styleable.MaterialFavoriteButton_mfb_favorite_image, 0) != 0
+ && attr.getResourceId(R.styleable.MaterialFavoriteButton_mfb_not_favorite_image, 0)
+ != 0) {
+ mFavoriteResource =
+ attr.getResourceId(R.styleable.MaterialFavoriteButton_mfb_favorite_image,
+ FAVORITE_STAR_BLACK);
+ mNotFavoriteResource =
+ attr.getResourceId(R.styleable.MaterialFavoriteButton_mfb_not_favorite_image,
+ FAVORITE_STAR_BORDER_BLACK);
+ } else {
+ setTheme(attr.getInt(R.styleable.MaterialFavoriteButton_mfb_color, STYLE_BLACK),
+ attr.getInt(R.styleable.MaterialFavoriteButton_mfb_type, STYLE_STAR));
+ }
+
+ mRotationDuration = attr.getInt(R.styleable.MaterialFavoriteButton_mfb_rotation_duration,
+ mRotationDuration);
+ mRotationAngle =
+ attr.getInt(R.styleable.MaterialFavoriteButton_mfb_rotation_angle, mRotationAngle);
+ mBounceDuration =
+ attr.getInt(R.styleable.MaterialFavoriteButton_mfb_bounce_duration, mBounceDuration);
+ } finally {
+ attr.recycle();
+ }
+ }
+ }
+
+ private TypedArray getTypedArray(Context context, AttributeSet attributeSet, int[] attr) {
+ return context.obtainStyledAttributes(attributeSet, attr, 0, 0);
+ }
+
+ private void setTheme(int color, int type) {
+ if (color == STYLE_BLACK) {
+ if (type == STYLE_STAR) {
+ mFavoriteResource = FAVORITE_STAR_BLACK;
+ mNotFavoriteResource = FAVORITE_STAR_BORDER_BLACK;
+ } else {
+ mFavoriteResource = FAVORITE_HEART_BLACK;
+ mNotFavoriteResource = FAVORITE_HEART_BORDER_BLACK;
+ }
+ } else {
+ if (type == STYLE_STAR) {
+ mFavoriteResource = FAVORITE_STAR_WHITE;
+ mNotFavoriteResource = FAVORITE_STAR_BORDER_WHITE;
+ } else {
+ mFavoriteResource = FAVORITE_HEART_WHITE;
+ mNotFavoriteResource = FAVORITE_HEART_BORDER_WHITE;
+ }
+ }
+ }
+
+ private void setResources() {
+ if (mFavorite) {
+ setImageResource(mFavoriteResource);
+ } else {
+ setImageResource(mNotFavoriteResource);
+ }
+ }
+
+ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ setMeasuredDimension(mButtonSize, mButtonSize);
+ }
+
+ /**
+ * Returns favorite state.
+ *
+ * @return true if button is in favorite state, false if not
+ */
+ public boolean isFavorite() {
+ return mFavorite;
+ }
+
+ /**
+ * Changes the favorite state of this button.
+ *
+ * @param favorite true to favorite the button, false to uncheck it
+ */
+ public void setFavorite(boolean favorite) {
+ if (mFavorite != favorite) {
+ mFavorite = favorite;
+ // Avoid infinite recursions if setChecked() is called from a listener
+ if (mBroadcasting) {
+ return;
+ }
+
+ mBroadcasting = true;
+ if (mOnFavoriteChangeListener != null) {
+ mOnFavoriteChangeListener.onFavoriteChanged(this, mFavorite);
+ }
+ updateFavoriteButton(mAnimation);
+ mBroadcasting = false;
+ }
+ }
+
+ /**
+ * Changes the favorite state of this button.
+ *
+ * @param favorite true to favorite the button, false to uncheck it
+ * @param animated true to force animated change, false to force not animated one
+ */
+ public void setFavorite(boolean favorite, boolean animated) {
+ mAnimation = animated;
+ setFavorite(favorite);
+ mAnimation = !animated;
+ }
+
+ /**
+ * Toggle the favorite state of this button.
+ */
+ public void toggleFavorite() {
+ setFavorite(!mFavorite);
+ }
+
+ /**
+ * Toggle the favorite state of this button.
+ *
+ * @param animated true to force animated toggle, false to force not animated one
+ */
+ public void toggleFavorite(boolean animated) {
+ mAnimation = animated;
+ setFavorite(!mFavorite);
+ mAnimation = !animated;
+ }
+
+ private void updateFavoriteButton(boolean animated) {
+ if (animated && mFavorite) {
+ AnimatorSet animatorSet = new AnimatorSet();
+
+ ObjectAnimator rotationAnim = ObjectAnimator.ofFloat(this, "rotation", 0f, mRotationAngle);
+ rotationAnim.setDuration(mRotationDuration);
+ rotationAnim.setInterpolator(ACCELERATE_INTERPOLATOR);
+
+ ObjectAnimator bounceAnimX = ObjectAnimator.ofFloat(this, "scaleX", 0.2f, 1f);
+ bounceAnimX.setDuration(mBounceDuration);
+ bounceAnimX.setInterpolator(OVERSHOOT_INTERPOLATOR);
+
+ ObjectAnimator bounceAnimY = ObjectAnimator.ofFloat(this, "scaleY", 0.2f, 1f);
+ bounceAnimY.setDuration(mBounceDuration);
+ bounceAnimY.setInterpolator(OVERSHOOT_INTERPOLATOR);
+ bounceAnimY.addListener(new AnimatorListenerAdapter() {
+ @Override public void onAnimationStart(Animator animation) {
+ if (mFavorite) {
+ setImageResource(mFavoriteResource);
+ } else {
+ setImageResource(mNotFavoriteResource);
+ }
+ }
+ });
+
+ animatorSet.play(rotationAnim);
+ animatorSet.play(bounceAnimX).with(bounceAnimY).after(rotationAnim);
+
+ animatorSet.addListener(new AnimatorListenerAdapter() {
+ @Override public void onAnimationEnd(Animator animation) {
+ if (mOnFavoriteAnimationEndListener != null) {
+ mOnFavoriteAnimationEndListener.onAnimationEnd(MaterialFavoriteButton.this, mFavorite);
+ }
+ }
+ });
+
+ animatorSet.start();
+ } else {
+ if (mFavorite) {
+ super.setImageResource(mFavoriteResource);
+ } else {
+ super.setImageResource(mNotFavoriteResource);
+ }
+ if (mOnFavoriteAnimationEndListener != null) {
+ mOnFavoriteAnimationEndListener.onAnimationEnd(this, mFavorite);
+ }
+ }
+ }
+
+ /**
+ * Builder.
+ */
+ public static final class Builder {
+ private final Context context;
+
+ private int mPadding = DEFAULT_PADDING;
+ private boolean mFavorite = DEFAULT_FAVORITE;
+ private boolean mAnimation = DEFAULT_ANIMATION;
+ private int mFavoriteResource = FAVORITE_STAR_BLACK;
+ private int mNotFavoriteResource = FAVORITE_STAR_BORDER_BLACK;
+ private int mRotationDuration = DEFAULT_ROTATION_DURATION;
+ private int mRotationAngle = DEFAULT_ROTATION_ANGLE;
+ private int mBounceDuration = DEFAULT_BOUNCE_DURATION;
+ private int mColor = STYLE_WHITE;
+ private int mType = STYLE_BLACK;
+
+ public Builder(Context context) {
+ this.context = context;
+ }
+
+ public Builder padding(int padding) {
+ this.mPadding = padding;
+ return this;
+ }
+
+ public Builder favorite(boolean favorite) {
+ this.mFavorite = favorite;
+ return this;
+ }
+
+ public Builder animation(boolean animation) {
+ this.mAnimation = animation;
+ return this;
+ }
+
+ public Builder favoriteResource(int resource) {
+ this.mFavoriteResource = resource;
+ return this;
+ }
+
+ public Builder notFavoriteResource(int recsource) {
+ this.mNotFavoriteResource = recsource;
+ return this;
+ }
+
+ public Builder rotationDuration(int rotationDuration) {
+ this.mRotationDuration = rotationDuration;
+ return this;
+ }
+
+ public Builder rotationAngle(int rotationAngle) {
+ this.mRotationAngle = rotationAngle;
+ return this;
+ }
+
+ public Builder bounceDuration(int bounceDuration) {
+ this.mBounceDuration = bounceDuration;
+ return this;
+ }
+
+ public Builder color(int color) {
+ this.mColor = color;
+ return this;
+ }
+
+ public Builder type(int type) {
+ this.mType = type;
+ return this;
+ }
+
+ public MaterialFavoriteButton create() {
+ MaterialFavoriteButton materialFavoriteButton = new MaterialFavoriteButton(context);
+ materialFavoriteButton.setPadding(mPadding);
+ materialFavoriteButton.setFavorite(mFavorite, false);
+ materialFavoriteButton.setAnimation(mAnimation);
+ materialFavoriteButton.setFavoriteResource(mFavoriteResource);
+ materialFavoriteButton.setNotFavoriteResource(mNotFavoriteResource);
+ materialFavoriteButton.setRotationDuration(mRotationDuration);
+ materialFavoriteButton.setRotationAngle(mRotationAngle);
+ materialFavoriteButton.setBounceDuration(mBounceDuration);
+ materialFavoriteButton.setColor(mColor);
+ materialFavoriteButton.setType(mType);
+ materialFavoriteButton.setResources();
+
+ return materialFavoriteButton;
+ }
+ }
+
+ public void setPadding(int padding) {
+ this.mPadding = padding;
+ }
+
+ public void setAnimation(boolean animation) {
+ this.mAnimation = animation;
+ }
+
+ public void setFavoriteResource(int favoriteResource) {
+ this.mFavoriteResource = favoriteResource;
+ }
+
+ public void setNotFavoriteResource(int notFavoriteResource) {
+ this.mNotFavoriteResource = notFavoriteResource;
+ }
+
+ public void setRotationDuration(int rotationDuration) {
+ this.mRotationDuration = rotationDuration;
+ }
+
+ public void setRotationAngle(int rotationAngle) {
+ this.mRotationAngle = rotationAngle;
+ }
+
+ public void setBounceDuration(int bounceDuration) {
+ this.mBounceDuration = bounceDuration;
+ }
+
+ public void setColor(int color) {
+ this.mColor = color;
+ setTheme(color, mType);
+ }
+
+ public void setType(int type) {
+ this.mType = type;
+ setTheme(mColor, type);
+ }
+}
\ No newline at end of file
diff --git a/materialfavoritebutton/src/main/java/com/github/ivbaranov/mfb/Utils.java b/materialfavoritebutton/src/main/java/com/github/ivbaranov/mfb/Utils.java
new file mode 100644
index 0000000..02e9566
--- /dev/null
+++ b/materialfavoritebutton/src/main/java/com/github/ivbaranov/mfb/Utils.java
@@ -0,0 +1,15 @@
+package com.github.ivbaranov.mfb;
+
+import android.content.res.Resources;
+import android.util.TypedValue;
+
+public class Utils {
+ /**
+ * Convert Dp to Pixel
+ */
+ public static int dpToPx(float dp, Resources resources) {
+ float px =
+ TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.getDisplayMetrics());
+ return (int) px;
+ }
+}
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_black_24dp.png
new file mode 100644
index 0000000..b8a2be6
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_border_black_24dp.png
new file mode 100644
index 0000000..de12450
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_border_white_24dp.png
new file mode 100644
index 0000000..c82d09e
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_white_24dp.png
new file mode 100644
index 0000000..f0328fa
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_favorite_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_black_24dp.png
new file mode 100644
index 0000000..92a0f58
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_border_black_24dp.png
new file mode 100644
index 0000000..cb31ce2
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_border_white_24dp.png
new file mode 100644
index 0000000..e302ef6
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_white_24dp.png
new file mode 100644
index 0000000..86eecdd
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-hdpi/ic_star_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_black_24dp.png
new file mode 100644
index 0000000..b3659bc
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_border_black_24dp.png
new file mode 100644
index 0000000..5659cdb
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_border_white_24dp.png
new file mode 100644
index 0000000..9037570
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_white_24dp.png
new file mode 100644
index 0000000..259a40c
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_favorite_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_black_24dp.png
new file mode 100644
index 0000000..a728afe
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_border_black_24dp.png
new file mode 100644
index 0000000..b753848
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_border_white_24dp.png
new file mode 100644
index 0000000..88142bf
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_white_24dp.png
new file mode 100644
index 0000000..d2cbe4c
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-mdpi/ic_star_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_black_24dp.png
new file mode 100644
index 0000000..460bfb6
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_border_black_24dp.png
new file mode 100644
index 0000000..6c157b7
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_border_white_24dp.png
new file mode 100644
index 0000000..5035a36
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_white_24dp.png
new file mode 100644
index 0000000..4bb7278
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_favorite_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_black_24dp.png
new file mode 100644
index 0000000..c636ce8
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_border_black_24dp.png
new file mode 100644
index 0000000..4f978e7
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_border_white_24dp.png
new file mode 100644
index 0000000..c7a5388
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_white_24dp.png
new file mode 100644
index 0000000..9143406
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xhdpi/ic_star_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_black_24dp.png
new file mode 100644
index 0000000..1139f5f
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_border_black_24dp.png
new file mode 100644
index 0000000..3d3036e
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_border_white_24dp.png
new file mode 100644
index 0000000..884a8a2
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_white_24dp.png
new file mode 100644
index 0000000..07569c8
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_favorite_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png
new file mode 100644
index 0000000..54d3065
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_border_black_24dp.png
new file mode 100644
index 0000000..f10d427
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_border_white_24dp.png
new file mode 100644
index 0000000..7e41906
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_white_24dp.png
new file mode 100644
index 0000000..aa58792
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxhdpi/ic_star_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_black_24dp.png
new file mode 100644
index 0000000..b46fa0a
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_border_black_24dp.png
new file mode 100644
index 0000000..96e0b9e
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_border_white_24dp.png
new file mode 100644
index 0000000..134a486
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_white_24dp.png
new file mode 100644
index 0000000..18d0768
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_favorite_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png
new file mode 100644
index 0000000..7be2280
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_border_black_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_border_black_24dp.png
new file mode 100644
index 0000000..041aa6b
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_border_black_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_border_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_border_white_24dp.png
new file mode 100644
index 0000000..0bae0bd
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_border_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_white_24dp.png b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_white_24dp.png
new file mode 100644
index 0000000..58d71b3
Binary files /dev/null and b/materialfavoritebutton/src/main/res/drawable-xxxhdpi/ic_star_white_24dp.png differ
diff --git a/materialfavoritebutton/src/main/res/values/attrs.xml b/materialfavoritebutton/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..c500a79
--- /dev/null
+++ b/materialfavoritebutton/src/main/res/values/attrs.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/materialfavoritebutton/src/main/res/values/strings.xml b/materialfavoritebutton/src/main/res/values/strings.xml
new file mode 100644
index 0000000..90b4a35
--- /dev/null
+++ b/materialfavoritebutton/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ MaterialFavoriteButton
+
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..964a423
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':example', ':materialfavoritebutton'