You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**[Please let me know if your application go to production via this link](https://docs.google.com/forms/d/e/1FAIpQLSe4Y5Fwn1mlEoD4RxjXQzTvL4mofhESuBlTkAPQhI7J_WqMDQ/viewform?c=0&w=1)**
13
3
------
14
-
Media Picker is an Android Libary that lets you to select multiple images, video or voice for Android 4.1 (API 16) +.
15
-
You can report any issue on issues page. **Note: If you speak Arabic, you can submit issues with Arabic language and I will check them. :)**
4
+
Media Picker is an Android Libary that lets you to select multiple images, video for Android 4.4 (API 19) +.
16
5
17
6
# NOTE
18
7
----
19
-
This build `2.x.x` will break backward compatibility and there are a lot of changes to improve the performance and fix a lot of Leak memory issues, So please read below document carefully.
20
8
## Installation
21
9
------
22
-
**Maven**
23
-
24
-
```xml
25
-
<dependency>
26
-
<groupId>net.alhazmy13.MediaPicker</groupId>
27
-
<artifactId>libary</artifactId>
28
-
<version>2.4.4</version>
29
-
</dependency>
30
-
```
31
-
32
10
33
11
**Gradle**
34
12
@@ -43,190 +21,71 @@ dependencies {
43
21
## Images
44
22
After adding the library, you need to:
45
23
46
-
1. Create an object from `ImagePicker` or `VideoPicker`
47
-
2. Override `onActivityResult` to receive the path of image or videos.
48
-
49
-
50
-
51
-
### Create an `ImagePicker`
52
-
You will need to create a new instance of `ImagePicker`. Once the instance are configured, you can call `build()`.
24
+
### Create an `MediaPicker`
25
+
You will need to create a new instance of `MediaPicker`. Once the instance are configured, you can call `build()`.
53
26
54
-
```java
55
-
newImagePicker.Builder(MainActivity.this)
56
-
.mode(ImagePicker.Mode.CAMERA_AND_GALLERY)
57
-
.compressLevel(ImagePicker.ComperesLevel.MEDIUM)
58
-
.directory(ImagePicker.Directory.DEFAULT)
59
-
.imageExtension(ImagePicker.Extension.PNG)
60
-
.scale(600, 600)
61
-
.allowMultipleImages(false)
62
-
.enableDebuggingMode(true)
63
-
.build();
64
-
```
65
-
### Override `onActivityResult `
66
-
In order to receive the path of image, you will need to override `onActivityResult ` .
67
-
68
-
```java
69
-
@Override
70
-
protectedvoid onActivityResult(int requestCode, int resultCode, Intent data) {
*`scale` You can scale the image to a a minimum width and height. This will only be used if compressLevel is set. To avoid OutOfMemory issues, ensure this is used.
110
-
111
-
```java
112
-
.scale(500, 500)
113
-
```
114
65
*`allowMultipleImages` Extra used to select and return multiple images from gallery **CANNOT select single image from gallery if this feature was enabled**
115
66
116
-
```java
67
+
```kotlin
117
68
.allowMultipleImages(true)
118
69
```
119
70
120
-
*`enableDebuggingMode` used to print Image Picker Log
121
-
122
-
```java
123
-
.enableDebuggingMode(true)
124
-
```
125
-
126
71
*`allowOnlineImages` an option to allow the user to select any image from online resource ex: Google Drive **(KNOWN ISSUE) if you enable this option then you cannot select multiple images**
127
72
128
-
```java
73
+
```kotlin
129
74
.allowOnlineImages(true)
130
75
```
131
76
132
-
133
-
### Create an `VideoPicker`
134
-
You will need to create a new instance of `VideoPicker`. Once the instance are configured, you can call `build()`.
135
-
136
-
```java
137
-
newVideoPicker.Builder(MainActivity.this)
138
-
.mode(VideoPicker.Mode.CAMERA_AND_GALLERY)
139
-
.directory(VideoPicker.Directory.DEFAULT)
140
-
.imageExtension(VideoPicker.Extension.MP4)
141
-
.enableDebuggingMode(true)
142
-
.build();
143
-
```
144
-
### Override `onActivityResult `
145
-
In order to receive the path of videos, you will need to override `onActivityResult ` .
146
-
147
-
```java
148
-
@Override
149
-
protectedvoid onActivityResult(int requestCode, int resultCode, Intent data) {
*`enableDebuggingMode` used to print Video Picker Log
184
-
185
-
```java
186
-
.enableDebuggingMode(true)
187
-
```
188
-
189
-
### RxJava 2 for MediaPicker
190
-
191
-
It's an extenstion that allow you to return an observable from `ImagePickerBuilder` or `VideoPickerBuilder`, all you need is to add below dependency and then return the observable from `ImagePickerHelper` || `VideoPickerHelper` class.
0 commit comments