Skip to content

Commit

Permalink
tidy up documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
esafirm committed May 22, 2020
1 parent f3fea3e commit 1f278f0
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 63 deletions.
68 changes: 5 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ dependencies {

change `x.y.z` to version in the [release page](https://github.com/esafirm/android-image-picker/releases)

**Breaking changes**

If you're not using custom image loader and have Glide v3 in your classpath, please using version `1.8.0` below!
Will improve this image loader compatibility issue in ImagePicker v2!

# Usage

For full example, please refer to the `sample` app.
Expand Down Expand Up @@ -83,16 +78,6 @@ ImagePicker.create(this)
.enableLog(false) // disabling log
.start(); // start image picker activity with request code
```

You also can change how to process the image and how to get the image files through `ImageLoader` and `ImageFileLoader`
To change this, simply set it on `ImagePickerComponentHolder`

```java
ImagePickerCompomnentHolder.getInstance()
.setImageLoader(new GrayScaleImageLoader())
.setImageFileLoader(new WebpImageFileLoader())
```

If you want to call it outside `Activity` or `Fragment`, you can simply get the `Intent` from the builder

```java
Expand Down Expand Up @@ -127,55 +112,13 @@ ImagePicker.cameraOnly().getIntent(context)

You also still can use the `DefaultCameraModule` but discouraged to do it.

## Return Mode

There's 4 mode available:

1. `ReturnMode.NONE` -> When image is picked, ImagePickerActivity will not dismissed even in Single Mode

2. `ReturnMode.ALL` -> When image is picked dismiss then deliver result

3. `ReturnMode.CAMERA_ONLY` -> When image is picked with Camera, dismiss then deliver the result

4. `ReturnMode.GALLERY_ONLY` -> Same as CAMERA_ONLY but with Gallery

You can define your selected mode with `setReturnMode()` method.

## Set Save Location

By default, ImagePicker will try to save the image generated from camera to `Environment.DIRECTORY_PICTURES` with directory name `"Camera"`.

You can change the directory name only by using:

```java
ImagePicker.create(activity).imageDiretory(String dirName)
```

Or you can change the full path of the save location by using:

```java
ImagePicker.create(activity).imageFullDirectory(String fullPath)
```

## Using Another Image Loader Library

By default, Image picker is using [Glide](https://github.com/bumptech/glide) as its image loader library.
# Wiki

You can change this by using:
- [Custom components](https://github.com/esafirm/android-image-picker/blob/master/docs/custom_components.md)
- [Using another image library](https://github.com/esafirm/android-image-picker/blob/master/docs/another_image_library.md)
- [Return mode](https://github.com/esafirm/android-image-picker/blob/master/docs/return_mode.md)
- [Save location](https://github.com/esafirm/android-image-picker/blob/master/docs/save_location.md)

```java
ImagePicker.create(activity).imageLoader(ImageLoader customImageLoader)
```

Next thing you wanna do is excluding Glide library from ImagePicker. You can achieve this with Gradle. Ex:

```groovy
implementation("com.github.esafirm.android-image-picker:imagepicker:x.y.z") {
exclude group: 'com.github.bumptech.glide', module: 'glide'
})
```

You can find more about this in [here](https://github.com/esafirm/android-image-picker/issues/105). Thanks to [Galaxer](https://github.com/Galaxer) 🙏

# AndroidX and version 2.0.0 above

Expand All @@ -189,7 +132,6 @@ android.useAndroidX=true
android.enableJetifier=true
```


# Credits

- AIP Logo by [anaufalm](https://github.com/anaufalm)
Expand Down
15 changes: 15 additions & 0 deletions docs/another_image_library.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Using Another Image Loader Library

By default, Image picker is using [Glide](https://github.com/bumptech/glide) as its image loader library.

You can change this by defining custom image loader. You can find the documentation in [here](https://github.com/esafirm/android-image-picker/blob/master/docs/custom_components.md)

Next thing you wanna do is excluding Glide library from ImagePicker. You can achieve this with Gradle. Ex:

```groovy
implementation("com.github.esafirm.android-image-picker:imagepicker:x.y.z") {
exclude group: 'com.github.bumptech.glide', module: 'glide'
})
```

You can find more about this in [here](https://github.com/esafirm/android-image-picker/issues/105). Thanks to [Galaxer](https://github.com/Galaxer) 🙏
12 changes: 12 additions & 0 deletions docs/custom_components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Custom Components

You also can change how to process the image and how to get the image files through `ImageLoader` and `ImageFileLoader`
To change this, simply set it on `ImagePickerComponentHolder`

```java
ImagePickerCompomnentHolder.getInstance()
.setImageLoader(new GrayScaleImageLoader())
.setImageFileLoader(new WebpImageFileLoader())
```

Happy coding!
13 changes: 13 additions & 0 deletions docs/return_mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Return Mode

There's 4 mode available:

1. `ReturnMode.NONE` -> When image is picked, ImagePickerActivity will not dismissed even in Single Mode

2. `ReturnMode.ALL` -> When image is picked dismiss then deliver result

3. `ReturnMode.CAMERA_ONLY` -> When image is picked with Camera, dismiss then deliver the result

4. `ReturnMode.GALLERY_ONLY` -> Same as CAMERA_ONLY but with Gallery

You can define your selected mode with `setReturnMode()` method.
15 changes: 15 additions & 0 deletions docs/save_location.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Set Save Location

By default, ImagePicker will try to save the image generated from camera to `Environment.DIRECTORY_PICTURES` with directory name `"Camera"`.

You can change the directory name only by using:

```java
ImagePicker.create(activity).imageDiretory(String dirName)
```

Or you can change the full path of the save location by using:

```java
ImagePicker.create(activity).imageFullDirectory(String fullPath)
```

0 comments on commit 1f278f0

Please sign in to comment.