Skip to content

Commit

Permalink
Readme.md updated (#99)
Browse files Browse the repository at this point in the history
* SetMaxFileSize method called two times removed from the sample
* README.md updated

---------
Co-authored-by: AKASH PATEL <[email protected]>
  • Loading branch information
sanjay-mi authored May 17, 2023
1 parent 60cd802 commit 5643c1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 62 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ Lassi is simplest way to pick media (either image, video, audio or doc)
.setPlaceHolder(R.drawable.ic_image_placeholder)
.setErrorDrawable(R.drawable.ic_image_placeholder)
.setSelectionDrawable(R.drawable.ic_checked_media)
.setAlertDialogNegativeButtonColor(R.color.cherry_red)
.setAlertDialogPositiveButtonColor(R.color.emerald_green)
.setGalleryBackgroundColor(R.color.colorGrey)//Customize background color of gallery (default color is white)
.setCropType(CropImageView.CropShape.RECTANGLE) // choose shape for cropping after capturing an image from camera (for MediaType.IMAGE only)
.setCropAspectRatio(1, 1) // define crop aspect ratio for cropping after capturing an image from camera (for MediaType.IMAGE only)
Expand Down Expand Up @@ -143,7 +145,7 @@ It would be great for us if the reporter can share the below things to understan
### Requirements
* minSdkVersion >= 19
* minSdkVersion >= 21
* Androidx
### Library used
Expand Down
60 changes: 0 additions & 60 deletions app/src/main/java/com/lassi/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {
.setGridSize(3)
.setMinTime(5)
.setMaxTime(30)
.setMinFileSize(0)
.setMaxFileSize(2000)
.setPlaceHolder(R.drawable.ic_image_placeholder)
.setErrorDrawable(R.drawable.ic_image_placeholder)
.setSelectionDrawable(R.drawable.ic_checked_media)
Expand All @@ -220,64 +218,6 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {
.build()
receiveData.launch(intent)
}

R.id.btnImageCapture -> {
val intent = Lassi(this)
.with(LassiOption.CAMERA)
.setMaxCount(4)
.setGridSize(2)
.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)
.setProgressBarColor(R.color.colorAccent)
.setGalleryBackgroundColor(R.color.colorGrey)
.setMediaType(MediaType.IMAGE)
.setCropType(CropImageView.CropShape.OVAL)
.setCropAspectRatio(1, 1)
.setCompressionRation(0)
.setMinFileSize(0)
.setMaxFileSize(10000)
.enableActualCircleCrop()
.setSupportedFileTypes("jpg", "jpeg", "png", "webp", "gif")
.enableFlip()
.enableRotate()
.build()
receiveData.launch(intent)
}

R.id.btnVideoCapture -> {
val intent = Lassi(this)
.with(LassiOption.CAMERA)
.setMaxCount(1)
.setGridSize(3)
.setMinTime(5)
.setMaxTime(30)
.setMinFileSize(0)
.setMaxFileSize(2000)
.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)
.setMediaType(MediaType.VIDEO)
.setToolbarResourceColor(android.R.color.white)
.setProgressBarColor(R.color.colorAccent)
.setGalleryBackgroundColor(R.color.colorGrey)
.setCropType(CropImageView.CropShape.OVAL)
.setCropAspectRatio(1, 1)
.setCompressionRation(0)
.setMinFileSize(0)
.setMaxFileSize(10000)
.enableActualCircleCrop()
.setSupportedFileTypes("jpg", "jpeg", "png", "webp", "gif")
.enableFlip()
.enableRotate()
.build()
receiveData.launch(intent)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CameraViewModel : LassiBaseViewModel() {
if (LassiConfig.getConfig().minTime
== KeyUtils.DEFAULT_DURATION
) {
KeyUtils.FIVE_SECOND_INTERVAL // 10 sec
KeyUtils.FIVE_SECOND_INTERVAL // 5 sec
} else {
(LassiConfig.getConfig().minTime * KeyUtils.ONE_SECOND_INTERVAL)
}
Expand Down

0 comments on commit 5643c1d

Please sign in to comment.