MCPcopy Index your code
hub / github.com/brunodles/PicPicker

github.com/brunodles/PicPicker @1.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2.1 ↗ · + Follow
58 symbols 134 edges 13 files 21 documented · 36%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PicPicker

Release

A simple library to pick pictures from the gallery and camera. By using a single object to make the requests.

How add it

Add it to your build.gradle with:

repositories {
    maven { url "https://jitpack.io" }
}

and:

dependencies {
    compile 'com.github.brunodles:PicPicker:{latest version}'
}

Ok, now you have the lib on your project, let's see how to use it.

Seting things up

First make a property on your activity or fragment, like this. private PicPicker picPicker;

Then on the onCreate method you should initialize it. picPicker = new PicPicker(imageView, this)

That this on the code means the ActivityStarter it's a class that will start the camera or gallery app intent. To make it work like that we need to add implements ActivityStarter on our activity or fragment. Don't even need to change anything. This is needed to let the lib know where the response will be sent.

Now we need to pass the result to the lib and to do that we just need to override onActivityResult and pass it's parameters to the lib, just like that.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    picPicker.onActivityResult(requestCode, resultCode, data);
    super.onActivityResult(requestCode, resultCode, data);
}

You can even make a validation to check if the lib had used those parameters, it returns true when made something to it.

Using it

Now to use the lib is so simple, to pick a image from the gallery just call.

picPicker.gallery();

If you want to grab a image from the camera call.

picPicker.camera();

Sample

You can see more thing on sample, it have some explanations too. On the sample you will see how to: * work with runtime permissions. * grab the bitmap. * listen for possible errors

You can help this lib to grow

If you fond something wrong or if you want some feature, just create a issue or even better create a pull request with you idea.

Extension points exported contracts — how you extend this code

ActivityStarter (Interface)
This interface is need just to make who will care about the onActivityResponse listener. If you start an activity from a [4 …
lib/src/main/java/com/github/brunodles/pic_picker/listener/ActivityStarter.java
NeedWritePermissionErrorListener (Interface)
This interface will be called when the user need to be authorize the app to write a temp file. Created by bruno on 29/11 [3 …
lib/src/main/java/com/github/brunodles/pic_picker/listener/NeedWritePermissionErrorListener.java
CantFindCameraAppErrorListener (Interface)
This interface will be called when the lib fails to find the camera app. Created by bruno on 29/11/15. [2 implementers]
lib/src/main/java/com/github/brunodles/pic_picker/listener/CantFindCameraAppErrorListener.java
ErrorCreatingTempFileForCameraListener (Interface)
This interface will be called when the lib fails to create a temp file. Created by bruno on 29/11/15. [2 implementers]
lib/src/main/java/com/github/brunodles/pic_picker/listener/ErrorCreatingTempFileForCameraListener.java
PicResultListener (Interface)
This interface will receive a bitmap when the lib got the response. Created by brunodles on 10/11/14. [1 implementers]
lib/src/main/java/com/github/brunodles/pic_picker/listener/PicResultListener.java

Core symbols most depended-on inside this repo

startActivityForResult
called by 2
lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java
camera
called by 2
lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java
startActivityForResult
called by 2
lib/src/main/java/com/github/brunodles/pic_picker/listener/ActivityStarter.java
getBitmapFromStream
called by 1
lib/src/main/java/com/github/brunodles/pic_picker/AddImageAsyncTask.java
setCameraAppErrorListener
called by 1
lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java
setPermissionErrorListener
called by 1
lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java
setFileForCameraListener
called by 1
lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java
gallery
called by 1
lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java

Shape

Method 45
Class 8
Interface 5

Languages

Java100%

Modules by API surface

lib/src/main/java/com/github/brunodles/pic_picker/PicPicker.java17 symbols
sample/src/main/java/com/github/brunodles/picpicker/sample/MainActivity.java9 symbols
lib/src/main/java/com/github/brunodles/pic_picker/impl/WritePermissionAsker.java6 symbols
lib/src/main/java/com/github/brunodles/pic_picker/AddImageAsyncTask.java5 symbols
lib/src/main/java/com/github/brunodles/compressor/BitmapCompressor.java4 symbols
lib/src/main/java/com/github/brunodles/pic_picker/Activity_ActivityStarter.java3 symbols
sample/src/test/java/com/github/brunodles/picpicker/ExampleUnitTest.java2 symbols
sample/src/androidTest/java/com/github/brunodles/picpicker/ApplicationTest.java2 symbols
lib/src/main/java/com/github/brunodles/pic_picker/listener/PicResultListener.java2 symbols
lib/src/main/java/com/github/brunodles/pic_picker/listener/NeedWritePermissionErrorListener.java2 symbols
lib/src/main/java/com/github/brunodles/pic_picker/listener/ErrorCreatingTempFileForCameraListener.java2 symbols
lib/src/main/java/com/github/brunodles/pic_picker/listener/CantFindCameraAppErrorListener.java2 symbols

For agents

$ claude mcp add PicPicker \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact