## New features - Implemented support for app packaging in firmware and `tactility.py`: load `.app` files instead of `.elf` files. Install apps remotely or via `FileBrowser`. - Ensure headless mode works: all services that require LVGL can deal with the absence of a display - Service `onStart()` is now allowed to fail (return `bool` result) - Added and improved various file-related helper functions ## Improvements - Completely revamped the SystemInfo app UI - Improved Calculator UI of internal and external variant - Fix Chat UI and removed the emoji buttons for now - Fix for toolbar bottom padding issue in all apps ## Fixes - Fix for allowing recursive locking for certain SPI SD cards & more
30 lines
940 B
C++
30 lines
940 B
C++
#include <Tactility/StringUtils.h>
|
|
#include <Tactility/TactilityCore.h>
|
|
|
|
namespace tt::app::filebrowser {
|
|
|
|
constexpr auto* TAG = "FileBrowser";
|
|
|
|
bool isSupportedAppFile(const std::string& filename) {
|
|
return filename.ends_with(".app");
|
|
}
|
|
|
|
bool isSupportedImageFile(const std::string& filename) {
|
|
// Currently only the PNG library is built into Tactility
|
|
return string::lowercase(filename).ends_with(".png");
|
|
}
|
|
|
|
bool isSupportedTextFile(const std::string& filename) {
|
|
std::string filename_lower = string::lowercase(filename);
|
|
return filename_lower.ends_with(".txt") ||
|
|
filename_lower.ends_with(".ini") ||
|
|
filename_lower.ends_with(".json") ||
|
|
filename_lower.ends_with(".yaml") ||
|
|
filename_lower.ends_with(".yml") ||
|
|
filename_lower.ends_with(".lua") ||
|
|
filename_lower.ends_with(".js") ||
|
|
filename_lower.ends_with(".properties");
|
|
}
|
|
|
|
} // namespace tt::app::filebrowser
|