|
|
@ -108,7 +108,7 @@ class BackupConfigFragment : PreferenceFragmentCompat(), |
|
|
|
} |
|
|
|
} |
|
|
|
else -> preference?.summary = newValue?.toString() |
|
|
|
else -> preference?.summary = newValue?.toString() |
|
|
|
} |
|
|
|
} |
|
|
|
return true |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onPreferenceTreeClick(preference: Preference?): Boolean { |
|
|
|
override fun onPreferenceTreeClick(preference: Preference?): Boolean { |
|
|
@ -305,6 +305,7 @@ class BackupConfigFragment : PreferenceFragmentCompat(), |
|
|
|
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION |
|
|
|
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION |
|
|
|
) |
|
|
|
) |
|
|
|
putPrefString(PreferKey.backupPath, uri.toString()) |
|
|
|
putPrefString(PreferKey.backupPath, uri.toString()) |
|
|
|
|
|
|
|
findPreference<Preference>(PreferKey.backupPath)?.summary = uri.toString() |
|
|
|
launch { |
|
|
|
launch { |
|
|
|
Backup.backup(requireContext(), uri) |
|
|
|
Backup.backup(requireContext(), uri) |
|
|
|
} |
|
|
|
} |
|
|
@ -317,6 +318,7 @@ class BackupConfigFragment : PreferenceFragmentCompat(), |
|
|
|
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION |
|
|
|
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION |
|
|
|
) |
|
|
|
) |
|
|
|
putPrefString(PreferKey.backupPath, uri.toString()) |
|
|
|
putPrefString(PreferKey.backupPath, uri.toString()) |
|
|
|
|
|
|
|
findPreference<Preference>(PreferKey.backupPath)?.summary = uri.toString() |
|
|
|
launch { |
|
|
|
launch { |
|
|
|
Restore.restore(requireContext(), uri) |
|
|
|
Restore.restore(requireContext(), uri) |
|
|
|
toast(R.string.restore_success) |
|
|
|
toast(R.string.restore_success) |
|
|
|