Fixed some images crashing

Added auto pageturn timer
This commit is contained in:
tom5079
2020-08-08 15:55:17 +09:00
parent 647294daf2
commit 9415ab4ef9
13 changed files with 89 additions and 14 deletions

View File

@@ -79,13 +79,16 @@ class SettingsFragment :
}
private fun getDirSize(dir: File) : String {
return getString(R.string.settings_storage_usage,
Runtime.getRuntime().exec("du -hs " + dir.absolutePath).let {
BufferedReader(InputStreamReader(it.inputStream)).use { reader ->
reader.readLine()?.split('\t')?.firstOrNull() ?: "0"
return if (activity != null)
getString(R.string.settings_storage_usage,
Runtime.getRuntime().exec("du -hs " + dir.absolutePath).let {
BufferedReader(InputStreamReader(it.inputStream)).use { reader ->
reader.readLine()?.split('\t')?.firstOrNull() ?: "0"
}
}
}
)
)
else
""
}
override fun onPreferenceClick(preference: Preference?): Boolean {