Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Fix camera picker bug
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombo11 committed Jan 14, 2021
1 parent 32e4ab6 commit 9dc9a3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plukke/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "0.6"
versionName "0.7"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -25,5 +25,5 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.fragment:fragment-ktx:$fragment_ktx_version"
implementation "androidx.fragment:fragment-ktx:$fragment_ktx_version" //FIXME Not working with next 1.3.0-rc01
}
5 changes: 2 additions & 3 deletions plukke/src/main/java/eu/acolombo/plukke/Plukke.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.io.Closeable

class Plukke(
private val componentActivity: ComponentActivity,
clearOnDestroy: Boolean = false
clearOnDestroy: Boolean = true
) : LifecycleObserver, Closeable {

private class ExternalContent(private val resolver: ContentResolver) : Closeable {
Expand All @@ -43,8 +43,7 @@ class Plukke(
if (result.resultCode == Activity.RESULT_OK) onResult(
result?.data?.data ?: photo?.uri ?: exc.close()
.run { return@registerForActivityResult }
)
exc.close()
) else exc.close()
}.launch(listOfNotNull(photo, pick))
}

Expand Down

0 comments on commit 9dc9a3f

Please sign in to comment.