From 0593bbdf2286e88222316bfd0b5f6b348c60ea73 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 20 Jan 2022 15:15:08 +0200 Subject: Android: External downloads; Back button handling; bumped version --- CMakeLists.txt | 4 ++-- res/about/android-version.gmi | 5 +++++ src/app.c | 14 +++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b1dfef1..0a654d7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,8 @@ if (IOS) endif () if (ANDROID) set (PROJECT_VERSION 1.10) - set (ANDROID_BUILD_VERSION a3) # remember to update Gradle, AndroidManifest.xml - set (ANDROID_BUILD_DATE "2022-01-03") + set (ANDROID_BUILD_VERSION a4) # remember to update Gradle, AndroidManifest.xml + set (ANDROID_BUILD_DATE "2022-01-20") endif () # Defaults that depend on environment. diff --git a/res/about/android-version.gmi b/res/about/android-version.gmi index fc7b444b..c36d5be4 100644 --- a/res/about/android-version.gmi +++ b/res/about/android-version.gmi @@ -6,6 +6,11 @@ ``` # Release notes +## 1.10 (Alpha 4) +* Save downloads to the external storage so they're accessible from a file manager. +* Handle Gemini, Gopher and Finger URIs opened from other apps. +* Back button dismisses UI panels/dialogs when appropriate instead of navigating back. + ## 1.10 (Alpha 3) * Added Android-specific release notes. * Added Settings > UI > Toolbar Actions: customize the two leftmost phone toolbar buttons. diff --git a/src/app.c b/src/app.c index 6392e7fa..a137dc23 100644 --- a/src/app.c +++ b/src/app.c @@ -333,7 +333,9 @@ static const char *dataDir_App_(void) { static const char *downloadDir_App_(void) { #if defined (iPlatformAndroidMobile) - return concatPath_CStr(SDL_AndroidGetInternalStoragePath(), "Downloads"); + const char *dir = concatPath_CStr(SDL_AndroidGetExternalStoragePath(), "Downloads"); + makeDirs_Path(collectNewCStr_String(dir)); + return dir; #endif #if defined (iPlatformLinux) || defined (iPlatformOther) /* Parse user-dirs.dirs using the `xdg-user-dir` tool. */ @@ -1391,6 +1393,16 @@ void processEvents_App(enum iAppEventMode eventMode) { ev.key.keysym.mod = mapMods_Keys(ev.key.keysym.mod & ~KMOD_CAPS); } #if defined (iPlatformAndroidMobile) + /* Use the system Back button to close panels, if they're open. */ + if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_AC_BACK) { + SDL_UserEvent panelBackCmd = { .type = SDL_USEREVENT, + .code = command_UserEventCode, + .data1 = iDupStr("panel.close"), + .data2 = d->window->base.keyRoot }; + if (dispatchEvent_Window(&d->window->base, (SDL_Event *) &panelBackCmd)) { + continue; /* Was handled by someone. */ + } + } /* Ignore all mouse events; just use touch. */ if (ev.type == SDL_MOUSEBUTTONDOWN || ev.type == SDL_MOUSEBUTTONUP || -- cgit v1.2.3