what i got so far

This commit is contained in:
tom5079
2020-09-01 18:07:16 +09:00
parent c96d609803
commit 7704c96955
28 changed files with 611 additions and 444 deletions

View File

@@ -29,6 +29,7 @@ import androidx.preference.PreferenceFragmentCompat
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import xyz.quaver.io.FileX
import xyz.quaver.pupil.R
import xyz.quaver.pupil.histories
import xyz.quaver.pupil.ui.LockActivity
@@ -141,7 +142,7 @@ class SettingsFragment :
setNegativeButton(android.R.string.no) { _, _ -> }
}.show()
}
"dl_location" -> {
"download_folder" -> {
DownloadLocationDialog(requireActivity()).show()
}
"default_query" -> {
@@ -208,9 +209,6 @@ class SettingsFragment :
"proxy" -> {
summary = context?.let { getProxyInfo().type.name }
}
"dl_location" -> {
summary = context?.let { getDownloadDirectory(it).canonicalPath }
}
}
}
}
@@ -275,8 +273,14 @@ class SettingsFragment :
onPreferenceClickListener = this@SettingsFragment
}
"dl_location" -> {
summary = getDownloadDirectory(requireContext()).canonicalPath
"download_folder" -> {
setSummaryProvider {
val uri: String = Preferences[it.key]
kotlin.runCatching {
FileX(context, uri).canonicalPath
}.getOrElse { "" }
}
onPreferenceClickListener = this@SettingsFragment
}