[App] Change app-wide storage dir to Download subfolder.

This commit is contained in:
Kuba Szczodrzyński 2021-09-10 16:56:52 +02:00
parent 5913707519
commit b9aca981e5
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB
2 changed files with 3 additions and 4 deletions

View File

@ -37,9 +37,7 @@ class AttachmentsView @JvmOverloads constructor(
}
private val storageDir by lazy {
val storageDir = Environment.getExternalStoragePublicDirectory("Szkolny.eu")
storageDir.mkdirs()
storageDir
Utils.getStorageDir()
}
fun init(arguments: Bundle, owner: Any) {

View File

@ -776,7 +776,8 @@ public class Utils {
public static File getStorageDir() {
if (storageDir != null)
return storageDir;
storageDir = Environment.getExternalStoragePublicDirectory("Szkolny.eu");
storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
storageDir = new File(storageDir, "Szkolny.eu");
storageDir.mkdirs();
return storageDir;
}