@@ -1240,3 +1240,78 @@ DeviceUtils.getMacAddress(Context context)
12401240 android : layout_marginTop =" @dimen/five_dp" />
12411241
12421242```
1243+ ### ImagePicker
1244+
1245+ > ** This class will help users to Select image from gallery or capture using camera. This class also helps in croping, compressing the image.**
1246+
1247+ ``` java
1248+ // Pick image using Gallery:
1249+ // this example is to use directly in kotlin
1250+ ImagePicker . with(this )
1251+ .galleryOnly() // User can only select image from Gallery
1252+ .start(REQUEST_CODE ) // Default Request Code is ImagePicker.REQUEST_CODE
1253+
1254+ // this example is to use in java
1255+ ImagePicker . Companion . with(this )
1256+ .galleryOnly() // User can only select image from Gallery
1257+ .start(REQUEST_CODE ) // Default Request Code is ImagePicker.REQUEST_CODE
1258+
1259+ // Capture image using Camera:
1260+ // this example is to use directly in kotlin
1261+ ImagePicker . with(this )
1262+ .cameraOnly() // User can only capture image using Camera
1263+ .start(REQUEST_CODE ) // Default Request Code is ImagePicker.REQUEST_CODE
1264+
1265+ // this example is to use in java
1266+ ImagePicker . Companion . with(this )
1267+ .cameraOnly() // User can only capture image using Camera
1268+ .start(REQUEST_CODE ) // Default Request Code is ImagePicker.REQUEST_CODE
1269+
1270+ // Crop image
1271+ // in kotlin
1272+ ImagePicker . with(this )
1273+ .crop(16f , 9f ) // Crop image with 16:9 aspect ratio
1274+ .start()
1275+
1276+ // in java
1277+ ImagePicker . Companion . with(this )
1278+ .crop(16f , 9f ) // Crop image with 16:9 aspect ratio
1279+ .start()
1280+
1281+ // Crop square image(e.g for profile)
1282+ // in kotlin
1283+ ImagePicker . with(this )
1284+ .cropSquare() // Crop square image, its same as crop(1f, 1f)
1285+ .start()
1286+
1287+ // in java
1288+ ImagePicker . Companion . with(this )
1289+ .cropSquare() // Crop square image, its same as crop(1f, 1f)
1290+ .start()
1291+
1292+ // Compress image size(e.g image should be maximum 1 MB)
1293+ // in kotlin
1294+ ImagePicker . with(this )
1295+ .compress(1024 ) // Final image size will be less than 1 MB
1296+ .start()
1297+
1298+ // in java
1299+ ImagePicker . Companion . with(this )
1300+ .compress(1024 ) // Final image size will be less than 1 MB
1301+ .start()
1302+
1303+ // Resize image resolution
1304+ // in kotlin
1305+ ImagePicker . with(this )
1306+ // Final image resolution will be less than 620 x 620
1307+ .maxResultSize(620 , 620 )
1308+ .start()
1309+
1310+ // in java
1311+ ImagePicker . Companion . with(this )
1312+ // Final image resolution will be less than 620 x 620
1313+ .maxResultSize(620 , 620 )
1314+ .start()
1315+
1316+ To get all the images you captured in camera or gallery or cropped you can get normally in onActivityResult
1317+ ```
0 commit comments