android: fix directory listing, keyboard show/hide and read chars

This commit is contained in:
2017-08-20 00:51:59 +01:00
parent a2b888efd6
commit 81a5fb10e3
6 changed files with 218 additions and 14 deletions

View File

@@ -7,6 +7,7 @@
#endif
#ifdef __ANDROID__
#include <dirent.h>
AAssetManager* Asset::m_am;
#endif
@@ -49,7 +50,19 @@ std::vector<std::string> Asset::list_files(std::string folder, bool is_asset, co
}
else
{
DIR *dp;
struct dirent *ep;
dp = opendir(folder.c_str());
if (dp != NULL)
{
while ((ep = readdir(dp)))
if (ep->d_type != DT_DIR)
names.push_back(ep->d_name);
closedir(dp);
}
else
LOG("Couldn't open the directory: %s", folder.c_str());
}
#else
std::string abs_path = folder;