From 01afba0d3f339ceebc5e5048b5042f72ace7fd6f Mon Sep 17 00:00:00 2001 From: Ronil Gwalani Date: Tue, 17 Oct 2023 18:26:46 +0530 Subject: [PATCH] VideoIssueSoved --- .../java/com/colourmoon/imagepicker/CMImagePicker.kt | 2 +- .../imagepicker/activities/ImagePickerMainActivity.kt | 9 +++++++-- app/build.gradle | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ImagePicker/src/main/java/com/colourmoon/imagepicker/CMImagePicker.kt b/ImagePicker/src/main/java/com/colourmoon/imagepicker/CMImagePicker.kt index 5cfd2c2..f5baa13 100644 --- a/ImagePicker/src/main/java/com/colourmoon/imagepicker/CMImagePicker.kt +++ b/ImagePicker/src/main/java/com/colourmoon/imagepicker/CMImagePicker.kt @@ -34,7 +34,7 @@ class CMImagePicker( return this } - fun allowgalleryOnly(galleryOnly: Boolean): CMImagePicker { + fun allowGalleryOnly(galleryOnly: Boolean): CMImagePicker { this.galleryOnly = galleryOnly return this } diff --git a/ImagePicker/src/main/java/com/colourmoon/imagepicker/activities/ImagePickerMainActivity.kt b/ImagePicker/src/main/java/com/colourmoon/imagepicker/activities/ImagePickerMainActivity.kt index f118857..ae9d6e0 100644 --- a/ImagePicker/src/main/java/com/colourmoon/imagepicker/activities/ImagePickerMainActivity.kt +++ b/ImagePicker/src/main/java/com/colourmoon/imagepicker/activities/ImagePickerMainActivity.kt @@ -172,7 +172,8 @@ class ImagePickerMainActivity : AppCompatActivity() { } private fun openGallery() { - val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI) + val intent = Intent(Intent.ACTION_PICK) + intent.type = "image/*" galleryLauncher.launch(intent) } @@ -313,7 +314,11 @@ class ImagePickerMainActivity : AppCompatActivity() { setResultAndFinish(imagePath, imageFile, resultIntent) } } else { - Toast.makeText(this, getString(R.string.some_error_occur_try_again), Toast.LENGTH_SHORT).show() + Toast.makeText( + this, + getString(R.string.some_error_occur_try_again), + Toast.LENGTH_SHORT + ).show() dialog.dismiss() finish() } diff --git a/app/build.gradle b/app/build.gradle index 7b898c0..dc4576a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { applicationId "com.tcm.imagepicker.project" minSdk 21 targetSdk 34 - versionCode 1 - versionName "1.0.0" + versionCode 2 + versionName "1.0.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }