From 5643c1d6d3e41453e52e4c145494342405b92e2d Mon Sep 17 00:00:00 2001 From: Sanjay Prajapati <82382452+sanjay-mi@users.noreply.github.com> Date: Wed, 17 May 2023 17:06:43 +0530 Subject: [PATCH] Readme.md updated (#99) * SetMaxFileSize method called two times removed from the sample * README.md updated --------- Co-authored-by: AKASH PATEL --- README.md | 4 +- .../main/java/com/lassi/app/MainActivity.kt | 60 ------------------- .../presentation/camera/CameraViewModel.kt | 2 +- 3 files changed, 4 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 9b4e08c..51f8d75 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/app/src/main/java/com/lassi/app/MainActivity.kt b/app/src/main/java/com/lassi/app/MainActivity.kt index ed4576d..ee5d4a6 100644 --- a/app/src/main/java/com/lassi/app/MainActivity.kt +++ b/app/src/main/java/com/lassi/app/MainActivity.kt @@ -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) @@ -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) - } } } diff --git a/lassi/src/main/java/com/lassi/presentation/camera/CameraViewModel.kt b/lassi/src/main/java/com/lassi/presentation/camera/CameraViewModel.kt index f275805..6e02db4 100644 --- a/lassi/src/main/java/com/lassi/presentation/camera/CameraViewModel.kt +++ b/lassi/src/main/java/com/lassi/presentation/camera/CameraViewModel.kt @@ -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) }