Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
anggrayudi committed Nov 1, 2022
1 parent 55fada4 commit 7a8af13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@ class MainActivity : AppCompatActivity() {
.message(text = "Please select $rootPath")
.negativeButton(android.R.string.cancel)
.positiveButton {
val initialRoot = if (expectedStorageType.isExpected(selectedStorageType)) selectedStorageType else expectedStorageType
storage.requestStorageAccess(REQUEST_CODE_STORAGE_ACCESS, initialRoot, expectedStorageType)
storage.requestStorageAccess(
REQUEST_CODE_STORAGE_ACCESS,
initialPath = FileFullPath(storage.context, uri.getStorageId(storage.context), ""),
expectedStorageType = expectedStorageType
)
}.show()
}

Expand Down Expand Up @@ -233,7 +236,7 @@ private fun setupFolderPickerCallback() {
requestStoragePermission()
}

override fun onStorageAccessDenied(requestCode: Int, folder: DocumentFile?, storageType: StorageType) {
override fun onStorageAccessDenied(requestCode: Int, folder: DocumentFile?, storageType: StorageType, storageId: String) {
if (storageType == StorageType.UNKNOWN) {
requestStoragePermission()
return
Expand All @@ -245,7 +248,7 @@ private fun setupFolderPickerCallback() {
)
.negativeButton(android.R.string.cancel)
.positiveButton {
storage.requestStorageAccess(REQUEST_CODE_STORAGE_ACCESS, storageType)
storage.requestStorageAccess(initialPath = FileFullPath(baseContext, storageId, ""))
}.show()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ android.enableJetifier=true
kotlin.code.style=official
GROUP=com.anggrayudi
POM_ARTIFACT_ID=storage
VERSION_NAME=1.5.0-SNAPSHOT
VERSION_NAME=1.5.1-SNAPSHOT

0 comments on commit 7a8af13

Please sign in to comment.