mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
request WRITE_EXTERNAL_STORAGE + cleanup
This commit is contained in:
@ -51,7 +51,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
||||
if (Utils.hasStoragePermission(applicationContext)) {
|
||||
initRootFileManager()
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), STORAGE_PERMISSION)
|
||||
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,7 @@ class CopyDialog(val activity: Activity, val files: List<File>, val path: String
|
||||
.setTitle(mContext.resources.getString(R.string.create_new))
|
||||
.setView(view)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, { dialog, which -> dialogDismissed() })
|
||||
.setOnCancelListener { dialogDismissed() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||
show()
|
||||
@ -75,13 +74,7 @@ class CopyDialog(val activity: Activity, val files: List<File>, val path: String
|
||||
}
|
||||
}
|
||||
|
||||
private fun dialogDismissed() {
|
||||
listener.onCancel()
|
||||
}
|
||||
|
||||
interface OnCopyListener {
|
||||
fun onSuccess()
|
||||
|
||||
fun onCancel()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user