├── lib ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── github │ │ └── brunodles │ │ ├── compressor │ │ ├── Compressor.java │ │ ├── SizeCompressor.java │ │ ├── QualityCompressor.java │ │ └── BitmapCompressor.java │ │ └── picpicker │ │ ├── listener │ │ ├── CantFindCameraAppErrorListener.java │ │ ├── ErrorCreatingTempFileForCameraListener.java │ │ ├── NeedWritePermissionErrorListener.java │ │ ├── PicResultListener.java │ │ └── ActivityStarter.java │ │ ├── Activity_ActivityStarter.java │ │ ├── AddImageAsyncTask.java │ │ ├── impl │ │ └── WritePermissionAsker.java │ │ └── PicPicker.java ├── proguard-rules.pro └── build.gradle ├── sample ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── 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 │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── brunodles │ │ │ └── picpicker │ │ │ └── sample │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── brunodles │ │ │ └── picpicker │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── github │ │ └── brunodles │ │ └── picpicker │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── LICENSE.md ├── .travis.yml ├── .gitignore ├── README.md ├── gradlew.bat └── gradlew /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample' 2 | include 'lib' -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunodles/PicPicker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunodles/PicPicker/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunodles/PicPicker/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunodles/PicPicker/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunodles/PicPicker/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brunodles/PicPicker/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PicPicker Sample 3 | We need to write on disk to use camera. 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 26 14:18:16 BRT 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.10-all.zip 7 | -------------------------------------------------------------------------------- /lib/src/main/java/com/github/brunodles/compressor/Compressor.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.compressor; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | /** 6 | * Created by bruno on 05/08/16. 7 | */ 8 | public interface Compressor { 9 | Bitmap compress(Bitmap bitmap, int targetSize); 10 | } 11 | -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /lib/src/main/java/com/github/brunodles/picpicker/listener/CantFindCameraAppErrorListener.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker.listener; 2 | 3 | /** 4 | * This interface will be called when the lib fails to find the camera app. 5 | * Created by bruno on 29/11/15. 6 | */ 7 | public interface CantFindCameraAppErrorListener { 8 | void cantFindCameraApp(); 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/main/java/com/github/brunodles/picpicker/listener/ErrorCreatingTempFileForCameraListener.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker.listener; 2 | 3 | /** 4 | * This interface will be called when the lib fails to create a temp file. 5 | * Created by bruno on 29/11/15. 6 | */ 7 | public interface ErrorCreatingTempFileForCameraListener { 8 | void errorCreatingTempFileForCamera(); 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/main/java/com/github/brunodles/picpicker/listener/NeedWritePermissionErrorListener.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker.listener; 2 | 3 | /** 4 | * This interface will be called when the user need to be authorize the app to write a temp file. 5 | * Created by bruno on 29/11/15. 6 | */ 7 | public interface NeedWritePermissionErrorListener { 8 | void needWritePermission(); 9 | } 10 | -------------------------------------------------------------------------------- /sample/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /lib/src/main/java/com/github/brunodles/picpicker/listener/PicResultListener.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker.listener; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | /** 6 | * This interface will receive a bitmap when the lib got the response. 7 | * Created by brunodles on 10/11/14. 8 | */ 9 | public interface PicResultListener { 10 | void onPictureResult(Bitmap bitmap); 11 | } 12 | -------------------------------------------------------------------------------- /sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /sample/src/test/java/com/github/brunodles/picpicker/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker; 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 | } -------------------------------------------------------------------------------- /sample/src/androidTest/java/com/github/brunodles/picpicker/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker; 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 | } -------------------------------------------------------------------------------- /lib/src/main/java/com/github/brunodles/picpicker/Activity_ActivityStarter.java: -------------------------------------------------------------------------------- 1 | package com.github.brunodles.picpicker; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | 6 | import com.github.brunodles.picpicker.listener.ActivityStarter; 7 | 8 | /** 9 | * Created by bruno on 31/01/16. 10 | */ 11 | class Activity_ActivityStarter implements ActivityStarter { 12 | 13 | private Activity activity; 14 | 15 | public Activity_ActivityStarter(Activity activity) { 16 | this.activity = activity; 17 | } 18 | 19 | @Override 20 | public void startActivityForResult(Intent intent, int requestCode) { 21 | activity.startActivityForResult(intent, requestCode); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample/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 /home/bruno/android-sdk-linux/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 | -------------------------------------------------------------------------------- /lib/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 /home/bruno/android-sdk-linux/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 | -------------------------------------------------------------------------------- /sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |