make android ci apk build work, also launches and connects to tox

This commit is contained in:
2024-06-02 18:09:20 +02:00
parent 7a2d7336fb
commit e7b1eec2cc
15 changed files with 271 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include "./start_screen.hpp"
#include <filesystem>
#include <memory>
#include <iostream>
#include <string_view>
@ -23,6 +24,11 @@ int main(int argc, char** argv) {
args.push_back(argv[i]);
}
#ifdef __ANDROID__
// change current working dir to internal storage
std::filesystem::current_path(SDL_AndroidGetInternalStoragePath());
#endif
// setup hints
if (SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1") != SDL_TRUE) {
std::cerr << "Failed to set '" << SDL_HINT_VIDEO_ALLOW_SCREENSAVER << "' to 1\n";

View File

@ -49,6 +49,7 @@ StartScreen::StartScreen(const std::vector<std::string_view>& args, SDL_Renderer
std::cerr << "TOMATO error: unknown cli arg: '" << args.at(ai) << "'\n";
}
}
}
Screen* StartScreen::render(float, bool&) {
@ -182,6 +183,7 @@ Screen* StartScreen::render(float, bool&) {
}
} else {
if (ImGui::Button("load", {60, 25})) {
auto new_screen = std::make_unique<MainScreen>(std::move(_conf), _renderer, _theme, _tox_profile_path, _password, _user_name, queued_plugin_paths);
return new_screen.release();
}