Skip to content

Commit 98da4ab

Browse files
Develop (#118)
* Updated readme --------- Co-authored-by: Vrajendra <vrajendra.bhavsar@mindinventory.com>
1 parent c8e44e5 commit 98da4ab

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ Lassi is simplest way to pick media (either image, video, audio or doc)
1111

1212
### Key features
1313

14-
* Android 13 support
14+
* Android 14 support
1515
* Simple implementation
1616
* Set your own custom styles
1717
* Filter by particular media type
1818
* Filter videos by min and max time
1919
* Enable/disable camera from LassiOption
2020
* You can open System Default view for file selection by using MediaType.FILE_TYPE_WITH_SYSTEM_VIEW
21+
* Photo Picker feature integration
2122

2223
# Usage
2324

@@ -146,6 +147,21 @@ Lassi is simplest way to pick media (either image, video, audio or doc)
146147
* Option - 2. To localize text content of Lassi picker with multiple language options, define language-specific string resource file in your project and update values of string resource keys mentioned in below link with your desired language.
147148
* [Lassi String Resources](https://github.com/Mindinventory/Lassi-Android/blob/931e147ebe6282bd1629858b5a9f29fe5a0b8b32/lassi/src/main/res/values/strings.xml)
148149
150+
### Way of utilizing Photo Picker
151+
```kotlin
152+
val intent = Lassi(this)
153+
.with(LassiOption.CAMERA_AND_GALLERY)
154+
.setMediaType(MediaType.PHOTO_PICKER)
155+
.setMaxCount(4)
156+
.setStatusBarColor(R.color.colorPrimaryDark)
157+
.setToolbarColor(R.color.colorPrimary)
158+
.setToolbarResourceColor(android.R.color.white)
159+
.setProgressBarColor(R.color.colorAccent)
160+
.setGalleryBackgroundColor(R.color.colorGrey)
161+
.setCustomLimitExceedingErrorMessage("Selected item exceeded the limit!")
162+
.build()
163+
```
164+
149165
### Document access permission note
150166
If Android device SDK is >= 30 and wants to access document (only for choose the non media file) then add ```android.permission.MANAGE_EXTERNAL_STORAGE``` permission in your app otherwise library won't allow to access documents. Kindly check sample app for more detail.
151167
If you don't want to give Manage External Storage permission and wants to get files with system default view then You can use `OR` option from Step 1 and give required file type of document.

app/src/main/java/com/lassi/app/MainActivity.kt

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -216,36 +216,14 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {
216216

217217
R.id.btnPhotoPicker -> {
218218
val intent = lassi.with(LassiOption.CAMERA_AND_GALLERY).setMaxCount(4)
219-
.setAscSort(SortingOption.ASCENDING).setGridSize(2)
220219
.setMediaType(MediaType.PHOTO_PICKER)
221-
.setPlaceHolder(R.drawable.ic_image_placeholder)
222-
.setErrorDrawable(R.drawable.ic_image_placeholder)
223-
.setSelectionDrawable(R.drawable.ic_checked_media)
224220
.setStatusBarColor(R.color.colorPrimaryDark)
225221
.setToolbarColor(R.color.colorPrimary)
226222
.setToolbarResourceColor(android.R.color.white)
227-
.setAlertDialogNegativeButtonColor(R.color.cherry_red)
228-
.setAlertDialogPositiveButtonColor(R.color.emerald_green)
229223
.setProgressBarColor(R.color.colorAccent)
230224
.setGalleryBackgroundColor(R.color.colorGrey)
231-
.setCropType(CropImageView.CropShape.OVAL).setCropAspectRatio(1, 1)
232-
.setCompressionRatio(10).setMinFileSize(0).setMaxFileSize(Int.MAX_VALUE.toLong())
233-
.enableActualCircleCrop()
234225
.setCustomLimitExceedingErrorMessage("Selected item exceeded the limit!")
235-
.setSupportedFileTypes(
236-
"jpg",
237-
"jpeg",
238-
"png",
239-
"webp",
240-
"gif",
241-
"mp4",
242-
"mkv",
243-
"webm",
244-
"avi",
245-
"flv",
246-
"3gp"
247-
).enableFlip()
248-
.enableRotate().build()
226+
.build()
249227
receiveData.launch(intent)
250228
}
251229
}

0 commit comments

Comments
 (0)