pull/84/head
kunfei 5 years ago
parent 5987b2c2e2
commit c2fd24836c
  1. 4
      app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt
  2. 3
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt

@ -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)

@ -106,7 +106,7 @@ class OtherConfigFragment : PreferenceFragmentCompat(),
getString(R.string.threads_num, stringValue) getString(R.string.threads_num, stringValue)
else -> preference?.summary = stringValue else -> preference?.summary = stringValue
} }
return true return false
} }
private fun bindPreferenceSummaryToValue(preference: Preference?) { private fun bindPreferenceSummaryToValue(preference: Preference?) {
@ -188,6 +188,7 @@ class OtherConfigFragment : 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.downloadPath, uri.toString()) putPrefString(PreferKey.downloadPath, uri.toString())
findPreference<Preference>(PreferKey.downloadPath)?.summary = uri.toString()
BookHelp.upDownloadPath() BookHelp.upDownloadPath()
} }
} }

Loading…
Cancel
Save