File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed
src/main/java/com/thirdegg/mediapicker Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ android {
1010 defaultConfig {
1111 minSdkVersion 19
1212 targetSdkVersion 28
13- versionCode 2
14- versionName " 1.0.2 "
13+ versionCode 3
14+ versionName " 1.0.3 "
1515 }
1616
1717 lintOptions {
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ object FileProcessing {
2525 * @param context The context.
2626 * @param uri The Uri to query.
2727 */
28- @TargetApi(Build .VERSION_CODES .KITKAT )
2928 fun getPath (context : Context , uri : Uri ): String? {
3029
3130 val isKitKat = Build .VERSION .SDK_INT >= Build .VERSION_CODES .KITKAT
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import android.content.Context
55import android.content.Intent
66import android.content.IntentFilter
77import android.os.Bundle
8- import android.os.Environment
98import androidx.appcompat.app.AppCompatActivity
9+ import com.thirdegg.mediapicker.media.MediaFragment.Companion.SERVICE_ACTION
1010
1111class MediaPicker (builder : Builder ) {
1212
@@ -27,7 +27,7 @@ class MediaPicker(builder: Builder) {
2727 fragment.arguments = Bundle ().apply {
2828 putSerializable(" config" , config)
2929 }
30- context.registerReceiver(dataReceiver, IntentFilter (MediaTags . Action . SERVICE_ACTION ))
30+ context.registerReceiver(dataReceiver, IntentFilter (SERVICE_ACTION ))
3131 context.supportFragmentManager.beginTransaction().add(fragment," chooser" ).commit()
3232 }
3333 }
Original file line number Diff line number Diff line change @@ -4,21 +4,20 @@ import android.content.Context
44import android.content.Intent
55import com.thirdegg.mediapicker.FileProcessing
66
7-
87object MediaProcessing {
98
109 fun processMultiMedia (context : Context , data : Intent ): ArrayList <String > {
1110 val listOfImgs = HashSet <String >()
1211 val singleData = data.data
1312 singleData?.let {uri->
14- val selectedImagePath = FileProcessing .getPath(context, uri)
13+ val selectedImagePath = FileProcessing .getPath(context, uri)? : return @let
1514 listOfImgs.add(selectedImagePath)
1615 }
1716
1817 val clipdata = data.clipData
1918 for (i in 0 until (clipdata?.itemCount ? : 0 )) {
2019 val selectedImage = clipdata!! .getItemAt(i).uri
21- val selectedImagePath = FileProcessing .getPath(context, selectedImage)
20+ val selectedImagePath = FileProcessing .getPath(context, selectedImage)? : continue
2221 listOfImgs.add(selectedImagePath)
2322 }
2423 return listOfImgs.mapTo(ArrayList ()) {it}
You can’t perform that action at this time.
0 commit comments