Improve file handling on android

This commit is contained in:
luboslenco
2021-02-14 15:23:36 +01:00
parent 743f6d3a9d
commit 37120e1f6b
2 changed files with 12 additions and 4 deletions
+1
View File
@@ -52,6 +52,7 @@ node Kinc/make -g metal
node armorcore/make android -g opengl --shaderversion 300
cp -r build/krom/* armorcore/build/Krom/app/src/main/assets/
cd armorcore
git apply patch/android_document_picker.diff --directory=Kinc
node Kinc/make android -g opengl
# Manual tweaking is required for now:
# https://github.com/armory3d/armorcore/blob/master/kincfile.js#L68
+11 -4
View File
@@ -24,9 +24,12 @@ class UIFiles {
public static function show(filters: String, isSave: Bool, filesDone: String->Void) {
#if krom_android
if (path == null) path = defaultPath;
showCustom(filters, isSave, filesDone);
#else
if (isSave) {
if (path == null) path = defaultPath;
showCustom(filters, isSave, filesDone);
}
else {
#end
path = isSave ? Krom.saveDialog(filters, "") : Krom.openDialog(filters, "");
if (path != null) {
@@ -37,6 +40,9 @@ class UIFiles {
filesDone(path);
}
releaseKeys();
#if krom_android
}
#end
}
@@ -259,7 +265,8 @@ class UIFiles {
#if krom_windows
"C:\\Users"
#elseif krom_android
"/sdcard/Android/data/org.armorpaint/files"
// "/sdcard/Android/data/org.armorpaint/files"
"/sdcard/Download"
#elseif krom_darwin
"/Users"
#else