From 058b870a13d1e2ce66e573898a7bab4b1506190f Mon Sep 17 00:00:00 2001 From: nostra13 Date: Thu, 19 Feb 2015 17:49:43 +0300 Subject: [PATCH 1/2] Support Fragments from support-v4. Update versions of buildTools and support-v4. --- lib/build.gradle | 5 +++-- .../com/soundcloud/android/crop/Crop.java | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/build.gradle b/lib/build.gradle index 2809a27..6a788b2 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -7,7 +7,7 @@ archivesBaseName = 'android-crop' android { compileSdkVersion 21 - buildToolsVersion '21.1.1' + buildToolsVersion '21.1.2' defaultConfig { minSdkVersion 9 @@ -20,8 +20,9 @@ android { dependencies { compile 'com.android.support:support-annotations:21.0.0' + provided 'com.android.support:support-v4:21.0.3' androidTestCompile 'com.squareup:fest-android:1.0.7' - androidTestCompile 'com.android.support:support-v4:21.0.0' + androidTestCompile 'com.android.support:support-v4:21.0.3' androidTestCompile 'org.mockito:mockito-core:1.9.5' androidTestCompile 'com.google.dexmaker:dexmaker:1.0' androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0' diff --git a/lib/src/main/java/com/soundcloud/android/crop/Crop.java b/lib/src/main/java/com/soundcloud/android/crop/Crop.java index 52d8601..2ad7fa9 100644 --- a/lib/src/main/java/com/soundcloud/android/crop/Crop.java +++ b/lib/src/main/java/com/soundcloud/android/crop/Crop.java @@ -113,6 +113,16 @@ public class Crop { start(context, fragment, REQUEST_CROP); } + /** + * Send the crop Intent! + * + * @param context Context + * @param fragment Fragment to receive result + */ + public void start(Context context, android.support.v4.app.Fragment fragment) { + start(context, fragment, REQUEST_CROP); + } + /** * Send the crop Intent with a custom requestCode * @@ -125,6 +135,17 @@ public class Crop { fragment.startActivityForResult(getIntent(context), requestCode); } + /** + * Send the crop Intent with a custom requestCode + * + * @param context Context + * @param fragment Fragment to receive result + * @param requestCode requestCode for result + */ + public void start(Context context, android.support.v4.app.Fragment fragment, int requestCode) { + fragment.startActivityForResult(getIntent(context), requestCode); + } + /** * Get Intent to start crop Activity * From 06137586b4bbd399b8872432df2e86022bcedf10 Mon Sep 17 00:00:00 2001 From: nostra13 Date: Sun, 22 Feb 2015 22:58:38 +0300 Subject: [PATCH 2/2] Travis: Update buildTools version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f1a113..efe0251 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: android android: components: - - build-tools-21.1.1 + - build-tools-21.1.2 - android-21 - extra-android-support - sys-img-armeabi-v7a-android-21