Skip to content

Commit

Permalink
Develop (#118)
Browse files Browse the repository at this point in the history
*  Updated readme

---------

Co-authored-by: Vrajendra <[email protected]>
  • Loading branch information
sanjay-mi and vrajendraBhavsar authored Mar 28, 2024
1 parent c8e44e5 commit 98da4ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ Lassi is simplest way to pick media (either image, video, audio or doc)

### Key features

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

# Usage

Expand Down Expand Up @@ -146,6 +147,21 @@ Lassi is simplest way to pick media (either image, video, audio or doc)
* 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.
* [Lassi String Resources](https://github.com/Mindinventory/Lassi-Android/blob/931e147ebe6282bd1629858b5a9f29fe5a0b8b32/lassi/src/main/res/values/strings.xml)
### Way of utilizing Photo Picker
```kotlin
val intent = Lassi(this)
.with(LassiOption.CAMERA_AND_GALLERY)
.setMediaType(MediaType.PHOTO_PICKER)
.setMaxCount(4)
.setStatusBarColor(R.color.colorPrimaryDark)
.setToolbarColor(R.color.colorPrimary)
.setToolbarResourceColor(android.R.color.white)
.setProgressBarColor(R.color.colorAccent)
.setGalleryBackgroundColor(R.color.colorGrey)
.setCustomLimitExceedingErrorMessage("Selected item exceeded the limit!")
.build()
```
### Document access permission note
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.
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.
Expand Down
24 changes: 1 addition & 23 deletions app/src/main/java/com/lassi/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -216,36 +216,14 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {

R.id.btnPhotoPicker -> {
val intent = lassi.with(LassiOption.CAMERA_AND_GALLERY).setMaxCount(4)
.setAscSort(SortingOption.ASCENDING).setGridSize(2)
.setMediaType(MediaType.PHOTO_PICKER)
.setPlaceHolder(R.drawable.ic_image_placeholder)
.setErrorDrawable(R.drawable.ic_image_placeholder)
.setSelectionDrawable(R.drawable.ic_checked_media)
.setStatusBarColor(R.color.colorPrimaryDark)
.setToolbarColor(R.color.colorPrimary)
.setToolbarResourceColor(android.R.color.white)
.setAlertDialogNegativeButtonColor(R.color.cherry_red)
.setAlertDialogPositiveButtonColor(R.color.emerald_green)
.setProgressBarColor(R.color.colorAccent)
.setGalleryBackgroundColor(R.color.colorGrey)
.setCropType(CropImageView.CropShape.OVAL).setCropAspectRatio(1, 1)
.setCompressionRatio(10).setMinFileSize(0).setMaxFileSize(Int.MAX_VALUE.toLong())
.enableActualCircleCrop()
.setCustomLimitExceedingErrorMessage("Selected item exceeded the limit!")
.setSupportedFileTypes(
"jpg",
"jpeg",
"png",
"webp",
"gif",
"mp4",
"mkv",
"webm",
"avi",
"flv",
"3gp"
).enableFlip()
.enableRotate().build()
.build()
receiveData.launch(intent)
}
}
Expand Down

0 comments on commit 98da4ab

Please sign in to comment.