mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-01-06 06:11:34 +01:00
use the proper request code at returning result from SelectFolderDialog
This commit is contained in:
parent
af8b43a6f6
commit
a3277190e5
@ -18,7 +18,6 @@ import java.util.*
|
||||
import kotlin.comparisons.compareBy
|
||||
|
||||
class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener {
|
||||
val SELECT_FOLDER_REQUEST = 1
|
||||
val SELECT_FOLDER_PATH = "path"
|
||||
|
||||
companion object {
|
||||
@ -37,9 +36,11 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener {
|
||||
}
|
||||
|
||||
lateinit var dialog: View
|
||||
var requestCode = 0
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
dialog = activity.layoutInflater.inflate(R.layout.smtfp_directory_picker, null)
|
||||
requestCode = targetRequestCode
|
||||
|
||||
updateItems()
|
||||
setupBreadcrumbs()
|
||||
@ -78,7 +79,7 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener {
|
||||
private fun sendResult() {
|
||||
val intent = Intent()
|
||||
intent.putExtra(SELECT_FOLDER_PATH, mPath)
|
||||
targetFragment.onActivityResult(SELECT_FOLDER_REQUEST, Activity.RESULT_OK, intent)
|
||||
targetFragment.onActivityResult(requestCode, Activity.RESULT_OK, intent)
|
||||
dismiss()
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context,
|
||||
}
|
||||
}
|
||||
|
||||
fun addBreadcrumb(item: FileDirItem, addPrefix: Boolean) {
|
||||
private fun addBreadcrumb(item: FileDirItem, addPrefix: Boolean) {
|
||||
val view = mInflater!!.inflate(R.layout.smtfp_breadcrumb_item, null, false)
|
||||
var textToAdd = item.name
|
||||
if (addPrefix)
|
||||
|
Loading…
Reference in New Issue
Block a user