├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── reminder_map.png │ │ │ │ ├── reminder_coffee.png │ │ │ │ ├── reminder_movie.png │ │ │ │ ├── reminder_music.png │ │ │ │ ├── reminder_sushi.png │ │ │ │ ├── profile_gender_male.png │ │ │ │ └── reminder_vintage_handheld.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── my_action_dialog.xml │ │ │ │ └── main_scroll_content.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── stone │ │ │ └── dragsquare │ │ │ ├── MyActionDialog.java │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── stone │ │ │ └── dragsquare │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── stone │ │ └── dragsquare │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── dragsquareimage ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ └── plus.png │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── drag_item.xml │ │ │ │ └── default_action_dialog.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── swifty │ │ │ │ └── dragsquareimage │ │ │ │ ├── ActionDialogClick.java │ │ │ │ ├── DraggablePresenter.java │ │ │ │ ├── ActionDialog.java │ │ │ │ ├── DefaultActionDialog.java │ │ │ │ ├── DraggablePresenterImpl.java │ │ │ │ ├── DraggableItemView.java │ │ │ │ └── DraggableSquareView.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── tinklabs │ │ │ └── dragsquareimage │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── swifty │ │ └── dragsquareimage │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── capture1.gif ├── capture2.gif ├── capture3.gif ├── crop ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── attrs.xml │ │ │ │ └── styles.xml │ │ │ ├── values-land │ │ │ │ └── dimens.xml │ │ │ ├── values-large │ │ │ │ └── dimens.xml │ │ │ ├── values-v21 │ │ │ │ └── colors.xml │ │ │ ├── drawable-xhdpi │ │ │ │ ├── crop__tile.png │ │ │ │ ├── crop__ic_done.png │ │ │ │ └── crop__ic_cancel.png │ │ │ ├── xml │ │ │ │ └── provider_paths.xml │ │ │ ├── drawable │ │ │ │ ├── crop__texture.xml │ │ │ │ └── crop__selectable_background.xml │ │ │ ├── drawable-v21 │ │ │ │ └── crop__selectable_background.xml │ │ │ ├── values-zh-rCN │ │ │ │ └── strings.xml │ │ │ ├── values-ja │ │ │ │ └── strings.xml │ │ │ ├── values-zh-rTW │ │ │ │ └── strings.xml │ │ │ ├── values-ko │ │ │ │ └── strings.xml │ │ │ ├── values-ar │ │ │ │ └── strings.xml │ │ │ ├── values-sv │ │ │ │ └── strings.xml │ │ │ ├── values-tr │ │ │ │ └── strings.xml │ │ │ ├── values-de │ │ │ │ └── strings.xml │ │ │ ├── values-es │ │ │ │ └── strings.xml │ │ │ ├── values-ca │ │ │ │ └── strings.xml │ │ │ ├── values-in │ │ │ │ └── strings.xml │ │ │ ├── values-it │ │ │ │ └── strings.xml │ │ │ ├── values-fr │ │ │ │ └── strings.xml │ │ │ ├── values-pt │ │ │ │ └── strings.xml │ │ │ ├── values-ru │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── crop__activity_crop.xml │ │ │ │ └── crop__layout_done_cancel.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── soundcloud │ │ │ │ └── android │ │ │ │ └── crop │ │ │ │ ├── provider │ │ │ │ └── SwiftyFileProvider.java │ │ │ │ ├── Log.java │ │ │ │ ├── RotateBitmap.java │ │ │ │ ├── MonitoredActivity.java │ │ │ │ ├── CropImageView.java │ │ │ │ ├── CropUtil.java │ │ │ │ ├── Crop.java │ │ │ │ ├── ImageViewTouchBase.java │ │ │ │ ├── HighlightView.java │ │ │ │ └── CropImageActivity.java │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── soundcloud │ │ └── android │ │ └── crop │ │ ├── BaseTestCase.java │ │ └── CropBuilderTest.java └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /dragsquareimage/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':crop', ':dragsquareimage' 2 | -------------------------------------------------------------------------------- /capture1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/capture1.gif -------------------------------------------------------------------------------- /capture2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/capture2.gif -------------------------------------------------------------------------------- /capture3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/capture3.gif -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DragRankSquare 3 | 4 | -------------------------------------------------------------------------------- /crop/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 56dp 4 | 5 | -------------------------------------------------------------------------------- /crop/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 48dp 4 | 5 | -------------------------------------------------------------------------------- /crop/src/main/res/values-large/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 64dp 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /crop/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #aaaaaa 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/reminder_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/reminder_map.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/reminder_coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/reminder_coffee.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/reminder_movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/reminder_movie.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/reminder_music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/reminder_music.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/reminder_sushi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/reminder_sushi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /dragsquareimage/src/main/res/drawable/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/dragsquareimage/src/main/res/drawable/plus.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /crop/src/main/res/drawable-xhdpi/crop__tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/crop/src/main/res/drawable-xhdpi/crop__tile.png -------------------------------------------------------------------------------- /crop/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/profile_gender_male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/profile_gender_male.png -------------------------------------------------------------------------------- /crop/src/main/res/drawable-xhdpi/crop__ic_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/crop/src/main/res/drawable-xhdpi/crop__ic_done.png -------------------------------------------------------------------------------- /crop/src/main/res/drawable-xhdpi/crop__ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/crop/src/main/res/drawable-xhdpi/crop__ic_cancel.png -------------------------------------------------------------------------------- /dragsquareimage/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2dp 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/reminder_vintage_handheld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftyWang/android-drag-square/HEAD/app/src/main/res/drawable/reminder_vintage_handheld.png -------------------------------------------------------------------------------- /crop/src/main/res/drawable/crop__texture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /dragsquareimage/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DragSquareImage 3 | Select Image 4 | Delete 5 | Take Photo 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 29 15:20:11 HKT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #555555 7 | 8 | -------------------------------------------------------------------------------- /crop/src/main/res/drawable-v21/crop__selectable_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /crop/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #f3f3f3 4 | #666666 5 | #1a000000 6 | #77000000 7 | 8 | -------------------------------------------------------------------------------- /crop/src/main/java/com/soundcloud/android/crop/provider/SwiftyFileProvider.java: -------------------------------------------------------------------------------- 1 | package com.soundcloud.android.crop.provider; 2 | 3 | import android.support.v4.content.FileProvider; 4 | 5 | /** 6 | * Created by kelvin_tang on 10/10/2017. 7 | */ 8 | 9 | public class SwiftyFileProvider extends FileProvider { 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 16dp 4 | 5dp 5 | 10dp 6 | 15dp 7 | 8 | -------------------------------------------------------------------------------- /dragsquareimage/src/main/java/com/swifty/dragsquareimage/ActionDialogClick.java: -------------------------------------------------------------------------------- 1 | package com.swifty.dragsquareimage; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by swifty on 9/12/2016. 7 | */ 8 | public interface ActionDialogClick { 9 | 10 | void onTakePhotoClick(View view); 11 | 12 | void onPickImageClick(View view); 13 | 14 | void onDeleteClick(View view); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /crop/src/main/java/com/soundcloud/android/crop/Log.java: -------------------------------------------------------------------------------- 1 | package com.soundcloud.android.crop; 2 | 3 | class Log { 4 | 5 | private static final String TAG = "android-crop"; 6 | 7 | public static void e(String msg) { 8 | android.util.Log.e(TAG, msg); 9 | } 10 | 11 | public static void e(String msg, Throwable e) { 12 | android.util.Log.e(TAG, msg, e); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /crop/src/main/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 正在保存照片… 4 | 请等待… 5 | 无效的图片 6 | 7 | 完成 8 | 取消 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 保存中… 4 | お待ちください… 5 | 画像が見つかりません 6 | 7 | 決定 8 | キャンセル 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-zh-rTW/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 正在儲存相片… 4 | 請稍候… 5 | 沒有可用的圖片來源 6 | 7 | 完成 8 | 取消 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/test/java/com/stone/dragsquare/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.stone.dragsquare; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /crop/src/main/res/values-ko/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 사진을 저장중입니다… 4 | 잠시만 기다려주세요… 5 | 이미지가 존재하지 않습니다. 6 | 7 | 확인 8 | 취소 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-ar/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | جارى حفظ الصورة … 4 | رجاء الأنتظار … 5 | الصورة غير متاحة 6 | 7 | تم 8 | الغاء 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Saving picture… 4 | Please wait… 5 | No image sources available 6 | 7 | DONE 8 | CANCEL 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-sv/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sparar bild… 4 | Var god vänta… 5 | Inga bildkällor tillgängliga 6 | 7 | KLAR 8 | AVBRYT 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-tr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Fotoğraf kaydediliyor… 4 | Lütfen bekleyin… 5 | Fotoğraf bulunamadı 6 | 7 | TAMAM 8 | ÇIKIŞ 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/stone/dragsquare/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.stone.dragsquare; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /crop/src/main/res/values-de/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bild speichern… 4 | Bitte warten… 5 | Keine Bildquellen verfügbar 6 | 7 | übernehmen 8 | abbrechen 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-es/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Guardando imagen… 4 | Por favor espere… 5 | No hay imágenes disponibles 6 | 7 | ACEPTAR 8 | CANCELAR 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-ca/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Guardant imatge… 4 | Si us plau esperi… 5 | No hi ha imatges disponibles 6 | 7 | ACCEPTAR 8 | CANCEL·LAR 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-in/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Menyimpan gambar… 4 | Silakan tunggu… 5 | Tidak ada sumber gambar yang tersedia 6 | 7 | SELESAI 8 | BATAL 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-it/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Salvataggio immagine… 4 | Attendere prego… 5 | Nessuna immagine disponibile 6 | 7 | ACCETTA 8 | ANNULLA 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Enregistrement de l\'image… 4 | Veuillez patienter… 5 | Aucune image disponible 6 | 7 | ACCEPTER 8 | ANNULER 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-pt/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Salvando imagem… 4 | Por favor, aguarde… 5 | Sem fontes de imagem disponíveis 6 | 7 | FINALIZADO 8 | CANCELAR 9 | 10 | 11 | -------------------------------------------------------------------------------- /crop/src/main/res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Изображение сохраняется… 4 | Пожалуйста, подождите… 5 | Нет доступных изображений 6 | 7 | ГОТОВО 8 | ОТМЕНА 9 | 10 | 11 | -------------------------------------------------------------------------------- /dragsquareimage/src/test/java/com/tinklabs/dragsquareimage/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.swifty.dragsquareimage; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /crop/src/androidTest/java/com/soundcloud/android/crop/BaseTestCase.java: -------------------------------------------------------------------------------- 1 | package com.soundcloud.android.crop; 2 | 3 | import android.test.InstrumentationTestCase; 4 | 5 | public class BaseTestCase extends InstrumentationTestCase { 6 | 7 | @Override 8 | public void setUp() throws Exception { 9 | super.setUp(); 10 | // Work around dexmaker issue when running tests on Android 4.3 11 | System.setProperty("dexmaker.dexcache", 12 | getInstrumentation().getTargetContext().getCacheDir().getPath()); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /dragsquareimage/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /crop/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /crop/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /crop/src/main/res/drawable/crop__selectable_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /dragsquareimage/src/main/java/com/swifty/dragsquareimage/DraggablePresenter.java: -------------------------------------------------------------------------------- 1 | package com.swifty.dragsquareimage; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.util.SparseArray; 6 | 7 | /** 8 | * Created by swifty on 29/11/2016. 9 | */ 10 | 11 | public interface DraggablePresenter { 12 | 13 | void onActivityResult(int requestCode, int resultCode, Intent result); 14 | 15 | void beginCrop(Uri source); 16 | 17 | void handleCrop(int resultCode, Intent result); 18 | 19 | SparseArray getImageUrls(); 20 | 21 | void setImages(String... imageUrls); 22 | 23 | void setCustomActionDialog(ActionDialog actionDialog); 24 | } 25 | -------------------------------------------------------------------------------- /crop/src/main/res/layout/crop__activity_crop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\adt-bundle-windows-x86_64-20140702\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /dragsquareimage/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/swifty/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local configuration file (sdk path, etc) 2 | local.properties 3 | secrets.properties 4 | 5 | # Proguard folder generated by Eclipse 6 | proguard/ 7 | 8 | # Android Studio 9 | *.iml 10 | .idea 11 | 12 | # Built application files 13 | *.apk 14 | *.ap_ 15 | 16 | # Files for the Dalvik VM 17 | *.dex 18 | 19 | # Java class files 20 | *.class 21 | 22 | # Generated files 23 | bin/ 24 | gen/ 25 | captures/ 26 | 27 | # Gradle files 28 | .gradle/ 29 | gradlew.bat 30 | build/ 31 | /*/build/ 32 | 33 | # Log Files 34 | *.log 35 | 36 | # Prototype project 37 | prototype/* 38 | 39 | # Node modules for React Native, should initialize with commands: 40 | # npm init 41 | # npm install --save react-native 42 | # Windows meta files 43 | Thumbs.db 44 | Desktop.ini 45 | 46 | # Mac 47 | .DS_Store 48 | 49 | true/crashlytics-build.properties 50 | node_modules/ 51 | projectFilesBackup/ 52 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /dragsquareimage/src/androidTest/java/com/swifty/dragsquareimage/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.swifty.dragsquareimage; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.swifty.dragsquareimage.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileSdkVersion 5 | buildToolsVersion rootProject.ext.buildToolsVersion 6 | 7 | defaultConfig { 8 | applicationId "com.stone.dragsquare" 9 | minSdkVersion rootProject.ext.minSdkVersion 10 | targetSdkVersion rootProject.ext.targetSdkVersion 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | testCompile 'junit:junit:4.12' 25 | compile project(':dragsquareimage') 26 | compile "com.android.support:appcompat-v7:$rootProject.ext.supportVersion" 27 | compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 28 | } 29 | -------------------------------------------------------------------------------- /crop/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'maven' 3 | apply plugin: 'signing' 4 | //apply from: '../.publishing/sonatype.gradle' 5 | 6 | archivesBaseName = 'android-crop' 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | targetSdkVersion rootProject.ext.targetSdkVersion 15 | 16 | testApplicationId 'com.soundcloud.android.crop.test' 17 | testInstrumentationRunner 'android.test.InstrumentationTestRunner' 18 | } 19 | } 20 | 21 | dependencies { 22 | compile "com.android.support:support-annotations:$rootProject.ext.supportVersion" 23 | compile "com.android.support:support-v4:$rootProject.ext.supportVersion" 24 | androidTestCompile 'com.squareup:fest-android:1.0.7' 25 | androidTestCompile "com.android.support:support-v4:$rootProject.ext.supportVersion" 26 | androidTestCompile 'org.mockito:mockito-core:1.9.5' 27 | androidTestCompile 'com.google.dexmaker:dexmaker:1.0' 28 | androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0' 29 | } 30 | 31 | -------------------------------------------------------------------------------- /dragsquareimage/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileSdkVersion 5 | buildToolsVersion rootProject.ext.buildToolsVersion 6 | 7 | defaultConfig { 8 | minSdkVersion rootProject.ext.minSdkVersion 9 | targetSdkVersion rootProject.ext.targetSdkVersion 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile fileTree(dir: 'libs', include: ['*.jar']) 26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 27 | exclude group: 'com.android.support', module: 'support-annotations' 28 | }) 29 | compile "com.android.support:appcompat-v7:$rootProject.ext.supportVersion" 30 | testCompile 'junit:junit:4.12' 31 | compile 'com.facebook.rebound:rebound:0.3.8' 32 | compile 'com.squareup.picasso:picasso:2.5.2' 33 | compile project(':crop') 34 | } 35 | -------------------------------------------------------------------------------- /dragsquareimage/src/main/res/layout/drag_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 15 | 22 | 23 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 18 | 19 |