Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
dismiss() -> dismissAllowingStateLoss()
Browse files Browse the repository at this point in the history
  • Loading branch information
kroegerama committed May 3, 2019
1 parent 4946370 commit be33615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0.1"
versionName "1.0.2"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class BottomSheetImagePicker internal constructor() :
btnDone.isVisible = true
btnDone.setOnClickListener {
onImagesSelectedListener?.onImagesSelected(adapter.getSelectedImages(), requestTag)
dismiss()
dismissAllowingStateLoss()
}
btnClearSelection.isVisible = true
btnClearSelection.setOnClickListener { adapter.clear() }
Expand Down Expand Up @@ -161,7 +161,7 @@ class BottomSheetImagePicker internal constructor() :

override fun onStateChanged(bottomSheet: View, newState: Int) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
dismiss()
dismissAllowingStateLoss()
}
}
}
Expand All @@ -177,7 +177,7 @@ class BottomSheetImagePicker internal constructor() :
}
is ClickedTile.ImageTile -> {
onImagesSelectedListener?.onImagesSelected(listOf(tile.uri), requestTag)
dismiss()
dismissAllowingStateLoss()
}
}
}
Expand Down Expand Up @@ -254,7 +254,7 @@ class BottomSheetImagePicker internal constructor() :
REQUEST_PERMISSION_READ_STORAGE ->
if (grantResults.isPermissionGranted)
LoaderManager.getInstance(this).initLoader(LOADER_ID, null, this)
else dismiss()
else dismissAllowingStateLoss()
REQUEST_PERMISSION_WRITE_STORAGE ->
if (grantResults.isPermissionGranted)
launchCamera()
Expand All @@ -279,14 +279,14 @@ class BottomSheetImagePicker internal constructor() :
currentPhotoUri?.let { uri ->
onImagesSelectedListener?.onImagesSelected(listOf(uri), requestTag)
}
dismiss()
dismissAllowingStateLoss()
return
}
REQUEST_GALLERY -> {
data?.data?.let { uri ->
onImagesSelectedListener?.onImagesSelected(listOf(uri), requestTag)
}
dismiss()
dismissAllowingStateLoss()
return
}
}
Expand Down

0 comments on commit be33615

Please sign in to comment.