store the real destination path in a variable
This commit is contained in:
parent
d6fd4ad378
commit
d7ffc35dd0
1 changed files with 3 additions and 2 deletions
|
@ -22,12 +22,14 @@ class CopyDialog(val activity: Activity, val files: List<File>, val copyListener
|
||||||
val context = activity
|
val context = activity
|
||||||
val view = LayoutInflater.from(context).inflate(R.layout.copy_item, null)
|
val view = LayoutInflater.from(context).inflate(R.layout.copy_item, null)
|
||||||
val path = files[0].parent.trimEnd('/')
|
val path = files[0].parent.trimEnd('/')
|
||||||
|
var destinationPath = ""
|
||||||
|
|
||||||
view.source.text = context.humanizePath(path)
|
view.source.text = context.humanizePath(path)
|
||||||
|
|
||||||
view.destination.setOnClickListener {
|
view.destination.setOnClickListener {
|
||||||
PickAlbumDialog(activity, object : PickAlbumDialog.OnPickAlbumListener {
|
PickAlbumDialog(activity, object : PickAlbumDialog.OnPickAlbumListener {
|
||||||
override fun onSuccess(path: String) {
|
override fun onSuccess(path: String) {
|
||||||
|
destinationPath = path
|
||||||
view.destination.text = context.humanizePath(path)
|
view.destination.text = context.humanizePath(path)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -42,8 +44,7 @@ class CopyDialog(val activity: Activity, val files: List<File>, val copyListener
|
||||||
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||||
show()
|
show()
|
||||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
|
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
|
||||||
val destinationPath = view.destination.value
|
if (destinationPath == context.resources.getString(R.string.select_destination) || destinationPath.isEmpty()) {
|
||||||
if (destinationPath == context.resources.getString(R.string.select_destination)) {
|
|
||||||
context.toast(R.string.please_select_destination)
|
context.toast(R.string.please_select_destination)
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue