|
|
@ -78,9 +78,7 @@ object BackupRestoreUi { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun selectBackupFolder(fragment: Fragment, requestCode: Int = selectFolderRequestCode) { |
|
|
|
fun selectBackupFolder(fragment: Fragment, requestCode: Int = selectFolderRequestCode) { |
|
|
|
FilePicker.selectFolder(fragment, requestCode) { |
|
|
|
FilePicker.selectFolder(fragment, requestCode) |
|
|
|
backupUsePermission(fragment, requestCode = requestCode) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun restore(fragment: Fragment) { |
|
|
|
fun restore(fragment: Fragment) { |
|
|
@ -97,13 +95,13 @@ object BackupRestoreUi { |
|
|
|
Restore.restore(fragment.requireContext(), backupPath) |
|
|
|
Restore.restore(fragment.requireContext(), backupPath) |
|
|
|
fragment.toast(R.string.restore_success) |
|
|
|
fragment.toast(R.string.restore_success) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
selectRestoreFolder(fragment) |
|
|
|
selectBackupFolder(fragment, restoreSelectRequestCode) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
restoreUsePermission(fragment, backupPath) |
|
|
|
restoreUsePermission(fragment, backupPath) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
selectRestoreFolder(fragment) |
|
|
|
selectBackupFolder(fragment, restoreSelectRequestCode) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -124,12 +122,6 @@ object BackupRestoreUi { |
|
|
|
.request() |
|
|
|
.request() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun selectRestoreFolder(fragment: Fragment) { |
|
|
|
|
|
|
|
FilePicker.selectFolder(fragment, restoreSelectRequestCode) { |
|
|
|
|
|
|
|
restoreUsePermission(fragment) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun importOldData(fragment: Fragment) { |
|
|
|
fun importOldData(fragment: Fragment) { |
|
|
|
FilePicker.selectFolder(fragment, oldDataRequestCode) { |
|
|
|
FilePicker.selectFolder(fragment, oldDataRequestCode) { |
|
|
|
importOldUsePermission(fragment) |
|
|
|
importOldUsePermission(fragment) |
|
|
|