diff --git a/app/.gitignore b/FaceCropper-library/.gitignore
similarity index 100%
rename from app/.gitignore
rename to FaceCropper-library/.gitignore
diff --git a/FaceCropper-library/build.gradle b/FaceCropper-library/build.gradle
new file mode 100644
index 0000000..0e01ceb
--- /dev/null
+++ b/FaceCropper-library/build.gradle
@@ -0,0 +1,24 @@
+apply plugin: 'android-library'
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion "19.0.3"
+
+ defaultConfig {
+ minSdkVersion 8
+ targetSdkVersion 16
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ runProguard false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+ }
+ }
+}
+
+dependencies {
+ compile 'com.android.support:appcompat-v7:19.+'
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+}
diff --git a/app/proguard-rules.txt b/FaceCropper-library/proguard-rules.txt
similarity index 100%
rename from app/proguard-rules.txt
rename to FaceCropper-library/proguard-rules.txt
diff --git a/FaceCropper-library/src/main/AndroidManifest.xml b/FaceCropper-library/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..aa54855
--- /dev/null
+++ b/FaceCropper-library/src/main/AndroidManifest.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/java/cat/lafosca/facecropper/util/BitmapUtils.java b/FaceCropper-library/src/main/java/cat/lafosca/facecropper/BitmapUtils.java
similarity index 98%
rename from app/src/main/java/cat/lafosca/facecropper/util/BitmapUtils.java
rename to FaceCropper-library/src/main/java/cat/lafosca/facecropper/BitmapUtils.java
index b8d1426..f67ccf6 100644
--- a/app/src/main/java/cat/lafosca/facecropper/util/BitmapUtils.java
+++ b/FaceCropper-library/src/main/java/cat/lafosca/facecropper/BitmapUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package cat.lafosca.facecropper.util;
+package cat.lafosca.facecropper;
import android.graphics.Bitmap;
import android.graphics.Canvas;
diff --git a/app/src/main/java/cat/lafosca/facecropper/util/FaceCropper.java b/FaceCropper-library/src/main/java/cat/lafosca/facecropper/FaceCropper.java
similarity index 98%
rename from app/src/main/java/cat/lafosca/facecropper/util/FaceCropper.java
rename to FaceCropper-library/src/main/java/cat/lafosca/facecropper/FaceCropper.java
index 550cd4e..fc37964 100644
--- a/app/src/main/java/cat/lafosca/facecropper/util/FaceCropper.java
+++ b/FaceCropper-library/src/main/java/cat/lafosca/facecropper/FaceCropper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package cat.lafosca.facecropper.util;
+package cat.lafosca.facecropper;
import android.content.Context;
import android.graphics.Bitmap;
@@ -23,8 +23,6 @@
import android.media.FaceDetector;
import android.util.Log;
-import cat.lafosca.facecropper.BuildConfig;
-
/**
* An utility that crops faces from bitmaps.
* It support multiple faces (max 8 by default) and crop them all, fitted in the same image.
diff --git a/FaceCropper-sample/.gitignore b/FaceCropper-sample/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/FaceCropper-sample/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/FaceCropper-sample/build.gradle
similarity index 92%
rename from app/build.gradle
rename to FaceCropper-sample/build.gradle
index 28f1477..fe0e172 100644
--- a/app/build.gradle
+++ b/FaceCropper-sample/build.gradle
@@ -22,4 +22,5 @@ dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.squareup.picasso:picasso:2.2.0'
+ compile project(':FaceCropper-library')
}
diff --git a/FaceCropper-sample/proguard-rules.txt b/FaceCropper-sample/proguard-rules.txt
new file mode 100644
index 0000000..ee7cef9
--- /dev/null
+++ b/FaceCropper-sample/proguard-rules.txt
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Develop/android-sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# 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 *;
+#}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/FaceCropper-sample/src/main/AndroidManifest.xml
similarity index 88%
rename from app/src/main/AndroidManifest.xml
rename to FaceCropper-sample/src/main/AndroidManifest.xml
index 4a8e4d8..ff0623a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/FaceCropper-sample/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
+ package="cat.lafosca.facecropper.sample" >
@@ -10,7 +10,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
diff --git a/app/src/main/java/cat/lafosca/facecropper/ui/MainActivity.java b/FaceCropper-sample/src/main/java/cat/lafosca/facecropper/sample/MainActivity.java
similarity index 97%
rename from app/src/main/java/cat/lafosca/facecropper/ui/MainActivity.java
rename to FaceCropper-sample/src/main/java/cat/lafosca/facecropper/sample/MainActivity.java
index 6c7831e..03b2087 100644
--- a/app/src/main/java/cat/lafosca/facecropper/ui/MainActivity.java
+++ b/FaceCropper-sample/src/main/java/cat/lafosca/facecropper/sample/MainActivity.java
@@ -1,4 +1,4 @@
-package cat.lafosca.facecropper.ui;
+package cat.lafosca.facecropper.sample;
import android.graphics.Bitmap;
import android.support.v4.view.PagerAdapter;
@@ -14,9 +14,7 @@
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Transformation;
-import cat.lafosca.facecropper.R;
-import cat.lafosca.facecropper.util.FaceCropper;
-
+import cat.lafosca.facecropper.FaceCropper;
public class MainActivity extends ActionBarActivity {
diff --git a/app/src/main/res/drawable-hdpi/ic_launcher.png b/FaceCropper-sample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/drawable-hdpi/ic_launcher.png
rename to FaceCropper-sample/src/main/res/drawable-hdpi/ic_launcher.png
diff --git a/app/src/main/res/drawable-mdpi/ic_launcher.png b/FaceCropper-sample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/drawable-mdpi/ic_launcher.png
rename to FaceCropper-sample/src/main/res/drawable-mdpi/ic_launcher.png
diff --git a/app/src/main/res/drawable-nodpi/arol1.jpg b/FaceCropper-sample/src/main/res/drawable-nodpi/arol1.jpg
similarity index 100%
rename from app/src/main/res/drawable-nodpi/arol1.jpg
rename to FaceCropper-sample/src/main/res/drawable-nodpi/arol1.jpg
diff --git a/app/src/main/res/drawable-nodpi/git1.jpg b/FaceCropper-sample/src/main/res/drawable-nodpi/git1.jpg
similarity index 100%
rename from app/src/main/res/drawable-nodpi/git1.jpg
rename to FaceCropper-sample/src/main/res/drawable-nodpi/git1.jpg
diff --git a/app/src/main/res/drawable-nodpi/git2.jpg b/FaceCropper-sample/src/main/res/drawable-nodpi/git2.jpg
similarity index 100%
rename from app/src/main/res/drawable-nodpi/git2.jpg
rename to FaceCropper-sample/src/main/res/drawable-nodpi/git2.jpg
diff --git a/app/src/main/res/drawable-nodpi/lluis1.jpg b/FaceCropper-sample/src/main/res/drawable-nodpi/lluis1.jpg
similarity index 100%
rename from app/src/main/res/drawable-nodpi/lluis1.jpg
rename to FaceCropper-sample/src/main/res/drawable-nodpi/lluis1.jpg
diff --git a/app/src/main/res/drawable-nodpi/vueling.jpg b/FaceCropper-sample/src/main/res/drawable-nodpi/vueling.jpg
similarity index 100%
rename from app/src/main/res/drawable-nodpi/vueling.jpg
rename to FaceCropper-sample/src/main/res/drawable-nodpi/vueling.jpg
diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher.png b/FaceCropper-sample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/drawable-xhdpi/ic_launcher.png
rename to FaceCropper-sample/src/main/res/drawable-xhdpi/ic_launcher.png
diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/FaceCropper-sample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to FaceCropper-sample/src/main/res/drawable-xxhdpi/ic_launcher.png
diff --git a/app/src/main/res/layout/activity_main.xml b/FaceCropper-sample/src/main/res/layout/activity_main.xml
similarity index 100%
rename from app/src/main/res/layout/activity_main.xml
rename to FaceCropper-sample/src/main/res/layout/activity_main.xml
diff --git a/app/src/main/res/layout/pager_item.xml b/FaceCropper-sample/src/main/res/layout/pager_item.xml
similarity index 100%
rename from app/src/main/res/layout/pager_item.xml
rename to FaceCropper-sample/src/main/res/layout/pager_item.xml
diff --git a/app/src/main/res/values/dimens.xml b/FaceCropper-sample/src/main/res/values/dimens.xml
similarity index 100%
rename from app/src/main/res/values/dimens.xml
rename to FaceCropper-sample/src/main/res/values/dimens.xml
diff --git a/app/src/main/res/values/strings.xml b/FaceCropper-sample/src/main/res/values/strings.xml
similarity index 100%
rename from app/src/main/res/values/strings.xml
rename to FaceCropper-sample/src/main/res/values/strings.xml
diff --git a/app/src/main/res/values/styles.xml b/FaceCropper-sample/src/main/res/values/styles.xml
similarity index 100%
rename from app/src/main/res/values/styles.xml
rename to FaceCropper-sample/src/main/res/values/styles.xml
diff --git a/settings.gradle b/settings.gradle
index e7b4def..a6e2868 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app'
+include 'FaceCropper-library', 'FaceCropper-sample'