File tree Expand file tree Collapse file tree 6 files changed +11
-9
lines changed
kotlin/com/github/dhaval2404/imagepicker/util
src/main/kotlin/com.github.dhaval2404.imagepicker/sample/util Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ android {
1313 defaultConfig {
1414 minSdkVersion 19
1515 targetSdkVersion 28
16- versionCode 8
17- versionName " 1.7"
16+ versionCode 9
17+ versionName " 1.7.1 "
1818
1919 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
2020 }
7272 siteUrl = ' https://github.com/Dhaval2404/ImagePicker/'
7373 gitUrl = ' https://github.com/Dhaval2404/ImagePicker.git'
7474
75- libraryVersion = ' 1.7'
75+ libraryVersion = ' 1.7.1 '
7676 // If you are uploading new library try : gradlew install
7777 // If you are updating existing library then execute: gradlew bintrayUpload
7878 // In both the case don't forgot to put bintray credentials in local.properties file.
Original file line number Diff line number Diff line change 1717
1818 <provider
1919 android : name =" com.github.dhaval2404.imagepicker.ImagePickerFileProvider"
20- android : authorities =" @string/image_picker_provider_authority "
20+ android : authorities =" ${applicationId}.imagepicker.provider "
2121 android : exported =" false"
2222 android : grantUriPermissions =" true" >
2323
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ object IntentUtils {
6767
6868 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
6969 // authority = com.github.dhaval2404.imagepicker.provider
70- val authority = context.getString(R .string.image_picker_provider_authority )
70+ val authority = context.packageName + context. getString(R .string.image_picker_provider_authority_suffix )
7171 val photoURI = FileProvider .getUriForFile(context, authority, file)
7272 intent.putExtra(MediaStore .EXTRA_OUTPUT , photoURI)
7373 } else {
Original file line number Diff line number Diff line change 66 <string name =" title_gallery" >Gallery</string >
77 <string name =" title_camera" >Camera</string >
88
9- <string name =" image_picker_provider_authority " >com.github.dhaval2404 .imagepicker.provider</string >
9+ <string name =" image_picker_provider_authority_suffix " > .imagepicker.provider</string >
1010
1111 <string name =" message_gallery_permission_denied" >Read External Storage permissions is needed to select Image. Please turn on requested permissions from Settings > Permissions.</string >
1212 <string name =" message_camera_permission_denied" >Camera and External Storage permissions are needed to capture image. Turning off any permission won\'t allow application run smoothly. Please turn on all requested permissions from Settings > Permissions.</string >
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ android {
1212 applicationId " com.github.dhaval2404.imagepicker.sample"
1313 minSdkVersion 19
1414 targetSdkVersion 28
15- versionCode 8
16- versionName " 1.7"
15+ versionCode 9
16+ versionName " 1.7.1 "
1717 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
1818 vectorDrawables. useSupportLibrary = true
1919 }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import android.content.Intent
55import android.net.Uri
66import androidx.browser.customtabs.CustomTabsIntent
77import androidx.core.content.FileProvider
8+ import com.github.dhaval2404.imagepicker.R
89import java.io.File
910
1011/* *
@@ -25,7 +26,8 @@ object IntentUtil {
2526 */
2627 fun showImage (activity : Activity , file : File ) {
2728 val intent = Intent (Intent .ACTION_VIEW )
28- val uri = FileProvider .getUriForFile(activity, " ${activity.packageName} .provider" , file)
29+ val authority = activity.packageName + activity.getString(R .string.image_picker_provider_authority_suffix)
30+ val uri = FileProvider .getUriForFile(activity, authority, file)
2931 intent.setDataAndType(uri, " image/*" )
3032 intent.addFlags(Intent .FLAG_GRANT_READ_URI_PERMISSION )
3133 activity.startActivity(intent)
You can’t perform that action at this time.
0 commit comments