prompt folder unlocking at some operations
This commit is contained in:
parent
734db5f242
commit
505b925ed8
1 changed files with 15 additions and 3 deletions
|
@ -122,10 +122,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
R.id.cab_copy_to -> copyMoveTo(true)
|
R.id.cab_copy_to -> copyMoveTo(true)
|
||||||
R.id.cab_move_to -> moveFilesTo()
|
R.id.cab_move_to -> moveFilesTo()
|
||||||
R.id.cab_select_all -> selectAll()
|
R.id.cab_select_all -> selectAll()
|
||||||
R.id.cab_create_shortcut -> createShortcut()
|
R.id.cab_create_shortcut -> tryCreateShortcut()
|
||||||
R.id.cab_delete -> askConfirmDelete()
|
R.id.cab_delete -> askConfirmDelete()
|
||||||
R.id.cab_select_photo -> changeAlbumCover(false)
|
R.id.cab_select_photo -> tryChangeAlbumCover(false)
|
||||||
R.id.cab_use_default -> changeAlbumCover(true)
|
R.id.cab_use_default -> tryChangeAlbumCover(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,6 +407,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun tryCreateShortcut() {
|
||||||
|
activity.handleLockedFolderOpening(getFirstSelectedItemPath() ?: "") {
|
||||||
|
createShortcut()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
private fun createShortcut() {
|
private fun createShortcut() {
|
||||||
val manager = activity.getSystemService(ShortcutManager::class.java)
|
val manager = activity.getSystemService(ShortcutManager::class.java)
|
||||||
|
@ -505,6 +511,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun tryChangeAlbumCover(useDefault: Boolean) {
|
||||||
|
activity.handleLockedFolderOpening(getFirstSelectedItemPath() ?: "") {
|
||||||
|
changeAlbumCover(useDefault)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun changeAlbumCover(useDefault: Boolean) {
|
private fun changeAlbumCover(useDefault: Boolean) {
|
||||||
if (selectedKeys.size != 1)
|
if (selectedKeys.size != 1)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue