diff --git a/Boards/Simulator/Source/hal/SimulatorPower.cpp b/Boards/Simulator/Source/hal/SimulatorPower.cpp
index c0568457..186e3c11 100644
--- a/Boards/Simulator/Source/hal/SimulatorPower.cpp
+++ b/Boards/Simulator/Source/hal/SimulatorPower.cpp
@@ -26,7 +26,7 @@ bool SimulatorPower::getMetric(Power::MetricType type, Power::MetricData& data)
data.valueAsUint32 = 4032;
return true;
case CHARGE_LEVEL:
- data.valueAsUint8 = 80;
+ data.valueAsUint8 = 100;
return true;
}
diff --git a/Data/assets/power_0.png b/Data/assets/power_0.png
new file mode 100644
index 00000000..20cca0eb
Binary files /dev/null and b/Data/assets/power_0.png differ
diff --git a/Data/assets/power_020.png b/Data/assets/power_020.png
deleted file mode 100644
index 4827f245..00000000
Binary files a/Data/assets/power_020.png and /dev/null differ
diff --git a/Data/assets/power_040.png b/Data/assets/power_040.png
deleted file mode 100644
index 67079c18..00000000
Binary files a/Data/assets/power_040.png and /dev/null differ
diff --git a/Data/assets/power_060.png b/Data/assets/power_060.png
deleted file mode 100644
index 9600ceab..00000000
Binary files a/Data/assets/power_060.png and /dev/null differ
diff --git a/Data/assets/power_080.png b/Data/assets/power_080.png
deleted file mode 100644
index a3dd78ff..00000000
Binary files a/Data/assets/power_080.png and /dev/null differ
diff --git a/Data/assets/power_10.png b/Data/assets/power_10.png
new file mode 100644
index 00000000..0ef185e5
Binary files /dev/null and b/Data/assets/power_10.png differ
diff --git a/Data/assets/power_100.png b/Data/assets/power_100.png
index 4098f968..b2fec1a2 100644
Binary files a/Data/assets/power_100.png and b/Data/assets/power_100.png differ
diff --git a/Data/assets/power_20.png b/Data/assets/power_20.png
new file mode 100644
index 00000000..6ca1a20f
Binary files /dev/null and b/Data/assets/power_20.png differ
diff --git a/Data/assets/power_30.png b/Data/assets/power_30.png
new file mode 100644
index 00000000..deec850d
Binary files /dev/null and b/Data/assets/power_30.png differ
diff --git a/Data/assets/power_40.png b/Data/assets/power_40.png
new file mode 100644
index 00000000..6337de67
Binary files /dev/null and b/Data/assets/power_40.png differ
diff --git a/Data/assets/power_50.png b/Data/assets/power_50.png
new file mode 100644
index 00000000..06a056f2
Binary files /dev/null and b/Data/assets/power_50.png differ
diff --git a/Data/assets/power_60.png b/Data/assets/power_60.png
new file mode 100644
index 00000000..e4ed68af
Binary files /dev/null and b/Data/assets/power_60.png differ
diff --git a/Data/assets/power_70.png b/Data/assets/power_70.png
new file mode 100644
index 00000000..1b5923f4
Binary files /dev/null and b/Data/assets/power_70.png differ
diff --git a/Data/assets/power_80.png b/Data/assets/power_80.png
new file mode 100644
index 00000000..e8d8062f
Binary files /dev/null and b/Data/assets/power_80.png differ
diff --git a/Data/assets/power_90.png b/Data/assets/power_90.png
new file mode 100644
index 00000000..c670bf44
Binary files /dev/null and b/Data/assets/power_90.png differ
diff --git a/Data/assets/sdcard.png b/Data/assets/sdcard.png
index 6c222e11..f78d5ec0 100644
Binary files a/Data/assets/sdcard.png and b/Data/assets/sdcard.png differ
diff --git a/Data/assets/sdcard_alert.png b/Data/assets/sdcard_alert.png
index 933c8465..613fdfde 100644
Binary files a/Data/assets/sdcard_alert.png and b/Data/assets/sdcard_alert.png differ
diff --git a/Data/assets/wifi_connection_issue.png b/Data/assets/wifi_connection_issue.png
deleted file mode 100644
index 5c79dbdb..00000000
Binary files a/Data/assets/wifi_connection_issue.png and /dev/null differ
diff --git a/Data/assets/wifi_find.png b/Data/assets/wifi_find.png
deleted file mode 100644
index f20ab74f..00000000
Binary files a/Data/assets/wifi_find.png and /dev/null differ
diff --git a/Data/assets/wifi_lock_black.png b/Data/assets/wifi_lock_black.png
new file mode 100644
index 00000000..0594d913
Binary files /dev/null and b/Data/assets/wifi_lock_black.png differ
diff --git a/Data/assets/wifi_off.png b/Data/assets/wifi_off.png
deleted file mode 100644
index 983b1792..00000000
Binary files a/Data/assets/wifi_off.png and /dev/null differ
diff --git a/Data/assets/wifi_off_white.png b/Data/assets/wifi_off_white.png
new file mode 100644
index 00000000..503cace8
Binary files /dev/null and b/Data/assets/wifi_off_white.png differ
diff --git a/Data/assets/wifi_perm_scan.png b/Data/assets/wifi_perm_scan.png
deleted file mode 100644
index c6b668d7..00000000
Binary files a/Data/assets/wifi_perm_scan.png and /dev/null differ
diff --git a/Data/assets/wifi_scan_white.png b/Data/assets/wifi_scan_white.png
new file mode 100644
index 00000000..4154e409
Binary files /dev/null and b/Data/assets/wifi_scan_white.png differ
diff --git a/Data/assets/wifi_signal_0.png b/Data/assets/wifi_signal_0.png
deleted file mode 100644
index 964d0ee2..00000000
Binary files a/Data/assets/wifi_signal_0.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_0_locked.png b/Data/assets/wifi_signal_0_locked.png
deleted file mode 100644
index 6c569446..00000000
Binary files a/Data/assets/wifi_signal_0_locked.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_1.png b/Data/assets/wifi_signal_1.png
deleted file mode 100644
index 7799eeda..00000000
Binary files a/Data/assets/wifi_signal_1.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_1_locked.png b/Data/assets/wifi_signal_1_locked.png
deleted file mode 100644
index 7f3759d7..00000000
Binary files a/Data/assets/wifi_signal_1_locked.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_2.png b/Data/assets/wifi_signal_2.png
deleted file mode 100644
index 1da91111..00000000
Binary files a/Data/assets/wifi_signal_2.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_2_locked.png b/Data/assets/wifi_signal_2_locked.png
deleted file mode 100644
index d26417f4..00000000
Binary files a/Data/assets/wifi_signal_2_locked.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_3.png b/Data/assets/wifi_signal_3.png
deleted file mode 100644
index 89ff66b2..00000000
Binary files a/Data/assets/wifi_signal_3.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_3_locked.png b/Data/assets/wifi_signal_3_locked.png
deleted file mode 100644
index 40d4b10a..00000000
Binary files a/Data/assets/wifi_signal_3_locked.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_4.png b/Data/assets/wifi_signal_4.png
deleted file mode 100644
index e5b1b108..00000000
Binary files a/Data/assets/wifi_signal_4.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_4_locked.png b/Data/assets/wifi_signal_4_locked.png
deleted file mode 100644
index c08dfc89..00000000
Binary files a/Data/assets/wifi_signal_4_locked.png and /dev/null differ
diff --git a/Data/assets/wifi_signal_medium_black.png b/Data/assets/wifi_signal_medium_black.png
new file mode 100644
index 00000000..a15156d5
Binary files /dev/null and b/Data/assets/wifi_signal_medium_black.png differ
diff --git a/Data/assets/wifi_signal_medium_white.png b/Data/assets/wifi_signal_medium_white.png
new file mode 100644
index 00000000..dc61b19a
Binary files /dev/null and b/Data/assets/wifi_signal_medium_white.png differ
diff --git a/Data/assets/wifi_signal_strong_black.png b/Data/assets/wifi_signal_strong_black.png
new file mode 100644
index 00000000..8d05a0f3
Binary files /dev/null and b/Data/assets/wifi_signal_strong_black.png differ
diff --git a/Data/assets/wifi_signal_strong_white.png b/Data/assets/wifi_signal_strong_white.png
new file mode 100644
index 00000000..4577100a
Binary files /dev/null and b/Data/assets/wifi_signal_strong_white.png differ
diff --git a/Data/assets/wifi_signal_weak_black.png b/Data/assets/wifi_signal_weak_black.png
new file mode 100644
index 00000000..badd73b7
Binary files /dev/null and b/Data/assets/wifi_signal_weak_black.png differ
diff --git a/Data/assets/wifi_signal_weak_white.png b/Data/assets/wifi_signal_weak_white.png
new file mode 100644
index 00000000..ee9f13e6
Binary files /dev/null and b/Data/assets/wifi_signal_weak_white.png differ
diff --git a/Data/assets_sources/Statusbar Battery.kra b/Data/assets_sources/Statusbar Battery.kra
new file mode 100644
index 00000000..13249f3a
Binary files /dev/null and b/Data/assets_sources/Statusbar Battery.kra differ
diff --git a/Data/assets_sources/Statusbar sdcard.kra b/Data/assets_sources/Statusbar sdcard.kra
new file mode 100644
index 00000000..ca75f74f
Binary files /dev/null and b/Data/assets_sources/Statusbar sdcard.kra differ
diff --git a/Data/assets_sources/wifi_connection_issue.svg b/Data/assets_sources/wifi_connection_issue.svg
deleted file mode 100644
index 0c527912..00000000
--- a/Data/assets_sources/wifi_connection_issue.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_find.svg b/Data/assets_sources/wifi_find.svg
deleted file mode 100644
index 97f271a4..00000000
--- a/Data/assets_sources/wifi_find.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_lock_black.svg b/Data/assets_sources/wifi_lock_black.svg
new file mode 100644
index 00000000..0711d52f
--- /dev/null
+++ b/Data/assets_sources/wifi_lock_black.svg
@@ -0,0 +1,42 @@
+
+
diff --git a/Data/assets_sources/wifi_off.svg b/Data/assets_sources/wifi_off.svg
deleted file mode 100644
index bd0d4cc2..00000000
--- a/Data/assets_sources/wifi_off.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_off_white.svg b/Data/assets_sources/wifi_off_white.svg
new file mode 100644
index 00000000..2fe696b8
--- /dev/null
+++ b/Data/assets_sources/wifi_off_white.svg
@@ -0,0 +1,41 @@
+
+
diff --git a/Data/assets_sources/wifi_perm_scan.svg b/Data/assets_sources/wifi_perm_scan.svg
deleted file mode 100644
index 71708f75..00000000
--- a/Data/assets_sources/wifi_perm_scan.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_scan_white.svg b/Data/assets_sources/wifi_scan_white.svg
new file mode 100644
index 00000000..a3da6b29
--- /dev/null
+++ b/Data/assets_sources/wifi_scan_white.svg
@@ -0,0 +1,41 @@
+
+
diff --git a/Data/assets_sources/wifi_signal_0.svg b/Data/assets_sources/wifi_signal_0.svg
deleted file mode 100644
index 63c9ecfb..00000000
--- a/Data/assets_sources/wifi_signal_0.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_0_lock.svg b/Data/assets_sources/wifi_signal_0_lock.svg
deleted file mode 100644
index 50b38476..00000000
--- a/Data/assets_sources/wifi_signal_0_lock.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_1.svg b/Data/assets_sources/wifi_signal_1.svg
deleted file mode 100644
index 9cc573d1..00000000
--- a/Data/assets_sources/wifi_signal_1.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_1_locked.svg b/Data/assets_sources/wifi_signal_1_locked.svg
deleted file mode 100644
index c8a7e5a9..00000000
--- a/Data/assets_sources/wifi_signal_1_locked.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_2.svg b/Data/assets_sources/wifi_signal_2.svg
deleted file mode 100644
index dee8e30b..00000000
--- a/Data/assets_sources/wifi_signal_2.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_2_locked.svg b/Data/assets_sources/wifi_signal_2_locked.svg
deleted file mode 100644
index 075d61d5..00000000
--- a/Data/assets_sources/wifi_signal_2_locked.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_3.svg b/Data/assets_sources/wifi_signal_3.svg
deleted file mode 100644
index f9709047..00000000
--- a/Data/assets_sources/wifi_signal_3.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_3_locked.svg b/Data/assets_sources/wifi_signal_3_locked.svg
deleted file mode 100644
index 82f7bf33..00000000
--- a/Data/assets_sources/wifi_signal_3_locked.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_4.svg b/Data/assets_sources/wifi_signal_4.svg
deleted file mode 100644
index 92d41ac4..00000000
--- a/Data/assets_sources/wifi_signal_4.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_4_locked.svg b/Data/assets_sources/wifi_signal_4_locked.svg
deleted file mode 100644
index 9e22d11a..00000000
--- a/Data/assets_sources/wifi_signal_4_locked.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_5.svg b/Data/assets_sources/wifi_signal_5.svg
deleted file mode 100644
index 249ab46f..00000000
--- a/Data/assets_sources/wifi_signal_5.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Data/assets_sources/wifi_signal_medium_black.svg b/Data/assets_sources/wifi_signal_medium_black.svg
new file mode 100644
index 00000000..b110e391
--- /dev/null
+++ b/Data/assets_sources/wifi_signal_medium_black.svg
@@ -0,0 +1,50 @@
+
+
diff --git a/Data/assets_sources/wifi_signal_medium_white.svg b/Data/assets_sources/wifi_signal_medium_white.svg
new file mode 100644
index 00000000..fb4692cf
--- /dev/null
+++ b/Data/assets_sources/wifi_signal_medium_white.svg
@@ -0,0 +1,48 @@
+
+
diff --git a/Data/assets_sources/wifi_signal_strong_black.svg b/Data/assets_sources/wifi_signal_strong_black.svg
new file mode 100644
index 00000000..4b4279b0
--- /dev/null
+++ b/Data/assets_sources/wifi_signal_strong_black.svg
@@ -0,0 +1,50 @@
+
+
diff --git a/Data/assets_sources/wifi_signal_strong_white.svg b/Data/assets_sources/wifi_signal_strong_white.svg
new file mode 100644
index 00000000..51b325cb
--- /dev/null
+++ b/Data/assets_sources/wifi_signal_strong_white.svg
@@ -0,0 +1,47 @@
+
+
diff --git a/Data/assets_sources/wifi_signal_weak_black.svg b/Data/assets_sources/wifi_signal_weak_black.svg
new file mode 100644
index 00000000..1890b0a1
--- /dev/null
+++ b/Data/assets_sources/wifi_signal_weak_black.svg
@@ -0,0 +1,50 @@
+
+
diff --git a/Data/assets_sources/wifi_signal_weak_white.svg b/Data/assets_sources/wifi_signal_weak_white.svg
new file mode 100644
index 00000000..2d9db58e
--- /dev/null
+++ b/Data/assets_sources/wifi_signal_weak_white.svg
@@ -0,0 +1,49 @@
+
+
diff --git a/Documentation/ideas.md b/Documentation/ideas.md
index a077fd91..d2364dfd 100644
--- a/Documentation/ideas.md
+++ b/Documentation/ideas.md
@@ -7,8 +7,9 @@
- ESP32 (CYD) runs out of memory when:
- loading splash (even in Files app)
- WiFi is on and navigating back to Desktop
- Suggested mitigation: When no PSRAM is availabl, use simplified desktop buttons
+ Suggested mitigation: When no PSRAM is available, use simplified desktop buttons
- WiFi fails quietly when there isn't enough memory. Add statusbar icon for memory pressure. Show error in WiFi screen (e.g. AlertDialog when SPI is not enabled and available memory is below a certain amount)
+- WiFi details "forget" button should be hidden when WiFi credentials are not stores yet.
# TODOs
- When WiFi is on, but there is no connection, it sort of seems like WiFi is off. Find better icon? Gnome uses a grayed-out 100% connectivity one.
diff --git a/Documentation/pics/screenshot-AppList.png b/Documentation/pics/screenshot-AppList.png
index 76900e52..0dac67e4 100644
Binary files a/Documentation/pics/screenshot-AppList.png and b/Documentation/pics/screenshot-AppList.png differ
diff --git a/Documentation/pics/screenshot-Desktop.png b/Documentation/pics/screenshot-Desktop.png
index f123585c..c565ac8e 100644
Binary files a/Documentation/pics/screenshot-Desktop.png and b/Documentation/pics/screenshot-Desktop.png differ
diff --git a/Documentation/pics/screenshot-Files.png b/Documentation/pics/screenshot-Files.png
index 0e126925..5d7d3e9b 100644
Binary files a/Documentation/pics/screenshot-Files.png and b/Documentation/pics/screenshot-Files.png differ
diff --git a/Documentation/pics/screenshot-HelloWorld.png b/Documentation/pics/screenshot-HelloWorld.png
index 4942beeb..6acd44fa 100644
Binary files a/Documentation/pics/screenshot-HelloWorld.png and b/Documentation/pics/screenshot-HelloWorld.png differ
diff --git a/Documentation/pics/screenshot-Settings.png b/Documentation/pics/screenshot-Settings.png
index bf665858..0a173faa 100644
Binary files a/Documentation/pics/screenshot-Settings.png and b/Documentation/pics/screenshot-Settings.png differ
diff --git a/Documentation/pics/screenshot-WifiManage.png b/Documentation/pics/screenshot-WifiManage.png
index 5d0785ff..919d7724 100644
Binary files a/Documentation/pics/screenshot-WifiManage.png and b/Documentation/pics/screenshot-WifiManage.png differ
diff --git a/Tactility/Source/app/files/Files.cpp b/Tactility/Source/app/files/Files.cpp
index 2a16fb06..1640465c 100644
--- a/Tactility/Source/app/files/Files.cpp
+++ b/Tactility/Source/app/files/Files.cpp
@@ -219,7 +219,7 @@ static void onShow(AppContext& app, lv_obj_t* parent) {
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
lv_obj_t* toolbar = lvgl::toolbar_create(parent, "Files");
- lvgl::toolbar_add_action(toolbar, LV_SYMBOL_UP, &onNavigateUpPressed, nullptr);
+ lvgl::toolbar_add_button_action(toolbar, LV_SYMBOL_UP, &onNavigateUpPressed, nullptr);
data->list = lv_list_create(parent);
lv_obj_set_width(data->list, LV_PCT(100));
diff --git a/Tactility/Source/app/i2cscanner/I2cScanner.cpp b/Tactility/Source/app/i2cscanner/I2cScanner.cpp
index 72884168..7128eb77 100644
--- a/Tactility/Source/app/i2cscanner/I2cScanner.cpp
+++ b/Tactility/Source/app/i2cscanner/I2cScanner.cpp
@@ -162,7 +162,10 @@ static void onHide(AppContext& app) {
bool isRunning = false;
if (data->mutex.acquire(250 / portTICK_PERIOD_MS) == TtStatusOk) {
- isRunning = data->scanTimer->isRunning();
+ auto* timer = data->scanTimer.get();
+ if (timer != nullptr) {
+ isRunning = timer->isRunning();
+ }
data->mutex.release();
} else {
return;
diff --git a/Tactility/Source/app/imageviewer/ImageViewer.cpp b/Tactility/Source/app/imageviewer/ImageViewer.cpp
index a712d9e4..c62780ac 100644
--- a/Tactility/Source/app/imageviewer/ImageViewer.cpp
+++ b/Tactility/Source/app/imageviewer/ImageViewer.cpp
@@ -3,25 +3,39 @@
#include "lvgl.h"
#include "lvgl/Style.h"
#include "lvgl/Toolbar.h"
+#include "StringUtils.h"
namespace tt::app::imageviewer {
+extern const AppManifest manifest;
+
#define TAG "image_viewer"
static void onShow(AppContext& app, lv_obj_t* parent) {
- lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
- lvgl::toolbar_create(parent, app);
-
- lv_obj_t* wrapper = lv_obj_create(parent);
- lv_obj_set_width(wrapper, LV_PCT(100));
- lv_obj_set_flex_grow(wrapper, 1);
- lv_obj_set_flex_flow(wrapper, LV_FLEX_FLOW_COLUMN);
+ auto wrapper = lv_obj_create(parent);
+ lv_obj_set_size(wrapper, LV_PCT(100), LV_PCT(100));
+ lv_obj_set_style_border_width(wrapper, 0, 0);
lvgl::obj_set_style_no_padding(wrapper);
- lvgl::obj_set_style_bg_invisible(wrapper);
- lv_obj_t* image = lv_img_create(wrapper);
+ auto toolbar = lvgl::toolbar_create(wrapper, app);
+ lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0);
+
+ auto* image_wrapper = lv_obj_create(wrapper);
+ lv_obj_align_to(image_wrapper, toolbar, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
+ lv_obj_set_width(image_wrapper, LV_PCT(100));
+ auto parent_height = lv_obj_get_height(wrapper);
+ lv_obj_set_height(image_wrapper, parent_height - TOOLBAR_HEIGHT);
+ lv_obj_set_flex_flow(image_wrapper, LV_FLEX_FLOW_COLUMN);
+ lv_obj_set_flex_align(image_wrapper, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
+ lvgl::obj_set_style_no_padding(image_wrapper);
+ lvgl::obj_set_style_bg_invisible(image_wrapper);
+
+ auto* image = lv_image_create(image_wrapper);
lv_obj_align(image, LV_ALIGN_CENTER, 0, 0);
+ auto* file_label = lv_label_create(wrapper);
+ lv_obj_align_to(file_label, wrapper, LV_ALIGN_BOTTOM_LEFT, 0, 0);
+
std::shared_ptr bundle = app.getParameters();
tt_check(bundle != nullptr, "Parameters not set");
std::string file_argument;
@@ -29,6 +43,10 @@ static void onShow(AppContext& app, lv_obj_t* parent) {
std::string prefixed_path = "A:" + file_argument;
TT_LOG_I(TAG, "Opening %s", prefixed_path.c_str());
lv_img_set_src(image, prefixed_path.c_str());
+ auto path = string::getLastPathSegment(file_argument);
+ lv_label_set_text(file_label, path.c_str());
+ } else {
+ lv_label_set_text(file_label, "File not found");
}
}
diff --git a/Tactility/Source/app/wificonnect/View.cpp b/Tactility/Source/app/wificonnect/View.cpp
index 1e735402..169a40dd 100644
--- a/Tactility/Source/app/wificonnect/View.cpp
+++ b/Tactility/Source/app/wificonnect/View.cpp
@@ -8,6 +8,7 @@
#include "service/wifi/WifiSettings.h"
#include "lvgl/Style.h"
#include "lvgl/Toolbar.h"
+#include "lvgl/Spinner.h"
#include
#include
@@ -97,8 +98,7 @@ void View::createBottomButtons(lv_obj_t* parent) {
lv_obj_align(remember_label, LV_ALIGN_CENTER, 0, 0);
lv_obj_align_to(remember_label, remember_switch, LV_ALIGN_OUT_RIGHT_MID, 4, 0);
- connecting_spinner = lv_spinner_create(button_container);
- lv_obj_set_size(connecting_spinner, 32, 32);
+ connecting_spinner = tt::lvgl::spinner_create(button_container);
lv_obj_align(connecting_spinner, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_add_flag(connecting_spinner, LV_OBJ_FLAG_HIDDEN);
diff --git a/Tactility/Source/app/wifimanage/State.cpp b/Tactility/Source/app/wifimanage/State.cpp
index eb17f52a..2434f61d 100644
--- a/Tactility/Source/app/wifimanage/State.cpp
+++ b/Tactility/Source/app/wifimanage/State.cpp
@@ -6,12 +6,16 @@ namespace tt::app::wifimanage {
void State::setScanning(bool isScanning) {
tt_check(mutex.acquire(TtWaitForever) == TtStatusOk);
scanning = isScanning;
+ scannedAfterRadioOn |= isScanning;
tt_check(mutex.release() == TtStatusOk);
}
void State::setRadioState(service::wifi::WifiRadioState state) {
tt_check(mutex.acquire(TtWaitForever) == TtStatusOk);
radioState = state;
+ if (radioState == service::wifi::WIFI_RADIO_OFF) {
+ scannedAfterRadioOn = false;
+ }
tt_check(mutex.release() == TtStatusOk);
}
diff --git a/Tactility/Source/app/wifimanage/State.h b/Tactility/Source/app/wifimanage/State.h
index 26f9fcd7..33cda253 100644
--- a/Tactility/Source/app/wifimanage/State.h
+++ b/Tactility/Source/app/wifimanage/State.h
@@ -11,7 +11,8 @@ namespace tt::app::wifimanage {
class State {
Mutex mutex = Mutex(Mutex::TypeRecursive);
- bool scanning;
+ bool scanning = false;
+ bool scannedAfterRadioOn = false;
service::wifi::WifiRadioState radioState;
std::vector apRecords;
std::string connectSsid;
@@ -22,6 +23,8 @@ public:
void setScanning(bool isScanning);
bool isScanning() const;
+ bool hasScannedAfterRadioOn() const { return scannedAfterRadioOn; }
+
void setRadioState(service::wifi::WifiRadioState state);
service::wifi::WifiRadioState getRadioState() const;
diff --git a/Tactility/Source/app/wifimanage/View.cpp b/Tactility/Source/app/wifimanage/View.cpp
index 1fd1f0e5..9a6fe69c 100644
--- a/Tactility/Source/app/wifimanage/View.cpp
+++ b/Tactility/Source/app/wifimanage/View.cpp
@@ -2,7 +2,7 @@
#include "WifiManage.h"
#include "Log.h"
-#include "service/statusbar/Statusbar.h"
+#include "Assets.h"
#include "service/wifi/Wifi.h"
#include "lvgl/Style.h"
#include "lvgl/Toolbar.h"
@@ -17,6 +17,16 @@ namespace tt::app::wifimanage {
std::shared_ptr _Nullable optWifiManage();
+const char* getWifiStatusIconForRssi(int rssi) {
+ if (rssi >= -60) {
+ return TT_ASSETS_ICON_WIFI_SIGNAL_STRONG_BLACK;
+ } else if (rssi >= -70) {
+ return TT_ASSETS_ICON_WIFI_SIGNAL_MEDIUM_BLACK;
+ } else {
+ return TT_ASSETS_ICON_WIFI_SIGNAL_WEAK_BLACK;
+ }
+}
+
static void on_enable_switch_changed(lv_event_t* event) {
lv_event_code_t code = lv_event_get_code(event);
auto* enable_switch = static_cast(lv_event_get_target(event));
@@ -97,13 +107,19 @@ void View::createSsidListItem(const service::wifi::WifiApRecord& record, bool is
lv_obj_align(info_label, LV_ALIGN_CENTER, 0, 0);
if (isConnecting) {
- lv_obj_t* connecting_spinner = tt_spinner_create(wrapper);
+ lv_obj_t* connecting_spinner = tt::lvgl::spinner_create(wrapper);
lv_obj_align_to(connecting_spinner, info_wrapper, LV_ALIGN_OUT_LEFT_MID, -8, 0);
} else {
- const char* icon = service::statusbar::getWifiStatusIconForRssi(record.rssi, record.auth_mode != WIFI_AUTH_OPEN);
- lv_obj_t* image = lv_image_create(wrapper);
- lv_image_set_src(image, icon);
- lv_obj_align(image, LV_ALIGN_RIGHT_MID, -50, 0);
+ const char* icon = getWifiStatusIconForRssi(record.rssi);
+ lv_obj_t* rssi_image = lv_image_create(wrapper);
+ lv_image_set_src(rssi_image, icon);
+ lv_obj_align(rssi_image, LV_ALIGN_RIGHT_MID, -42, 0);
+
+ if (record.auth_mode != WIFI_AUTH_OPEN) {
+ lv_obj_t* lock_image = lv_image_create(wrapper);
+ lv_image_set_src(lock_image, TT_ASSETS_ICON_WIFI_LOCK_BLACK);
+ lv_obj_align(lock_image, LV_ALIGN_RIGHT_MID, -62, 0);
+ }
}
}
@@ -152,7 +168,8 @@ void View::updateNetworkList() {
}
}
lv_obj_clear_flag(networks_list, LV_OBJ_FLAG_HIDDEN);
- } else if (state->isScanning()) {
+ } else if (!state->hasScannedAfterRadioOn() || state->isScanning()) {
+ // hasScannedAfterRadioOn() prevents briefly showing "No networks found" when turning radio on.
lv_obj_add_flag(networks_list, LV_OBJ_FLAG_HIDDEN);
} else {
lv_obj_clear_flag(networks_list, LV_OBJ_FLAG_HIDDEN);
diff --git a/Tactility/Source/lvgl/Spacer.h b/Tactility/Source/lvgl/Spacer.h
index 4559b506..8077c36d 100644
--- a/Tactility/Source/lvgl/Spacer.h
+++ b/Tactility/Source/lvgl/Spacer.h
@@ -4,6 +4,7 @@
namespace tt::lvgl {
+[[deprecated("Use margin")]]
lv_obj_t* spacer_create(lv_obj_t* parent, int32_t width, int32_t height);
} // namespace
diff --git a/Tactility/Source/lvgl/Spinner.cpp b/Tactility/Source/lvgl/Spinner.cpp
index 23722094..1b7ee209 100644
--- a/Tactility/Source/lvgl/Spinner.cpp
+++ b/Tactility/Source/lvgl/Spinner.cpp
@@ -1,14 +1,17 @@
#define LV_USE_PRIVATE_API 1 // For actual lv_obj_t declaration
-#include "lvgl.h"
+#include "Assets.h"
#include "CoreDefines.h"
#include "Log.h"
+#include "lvgl.h"
-static void tt_spinner_constructor(const lv_obj_class_t* object_class, lv_obj_t* object);
+namespace tt::lvgl {
+
+static void spinner_constructor(const lv_obj_class_t* object_class, lv_obj_t* object);
const lv_obj_class_t tt_spinner_class = {
.base_class = &lv_image_class,
- .constructor_cb = tt_spinner_constructor,
+ .constructor_cb = spinner_constructor,
.destructor_cb = nullptr,
.event_cb = nullptr,
.user_data = nullptr,
@@ -21,11 +24,11 @@ const lv_obj_class_t tt_spinner_class = {
.theme_inheritable = 0
};
-lv_obj_t* tt_spinner_create(lv_obj_t* parent) {
+lv_obj_t* spinner_create(lv_obj_t* parent) {
lv_obj_t* obj = lv_obj_class_create_obj(&tt_spinner_class, parent);
lv_obj_class_init_obj(obj);
- lv_image_set_src(obj, "A:/assets/spinner.png");
+ lv_image_set_src(obj, TT_ASSETS_UI_SPINNER);
return obj;
}
@@ -39,7 +42,7 @@ static void anim_rotation_callback(void* var, int32_t v) {
lv_obj_set_style_transform_rotation(object, v, 0);
}
-static void tt_spinner_constructor(TT_UNUSED const lv_obj_class_t* object_class, lv_obj_t* object) {
+static void spinner_constructor(TT_UNUSED const lv_obj_class_t* object_class, lv_obj_t* object) {
lv_obj_remove_flag(object, LV_OBJ_FLAG_CLICKABLE);
lv_anim_t a;
@@ -51,3 +54,5 @@ static void tt_spinner_constructor(TT_UNUSED const lv_obj_class_t* object_class,
lv_anim_set_exec_cb(&a, anim_rotation_callback);
lv_anim_start(&a);
}
+
+}
diff --git a/Tactility/Source/lvgl/Spinner.h b/Tactility/Source/lvgl/Spinner.h
index 718005ca..71bd173c 100644
--- a/Tactility/Source/lvgl/Spinner.h
+++ b/Tactility/Source/lvgl/Spinner.h
@@ -1,8 +1,12 @@
#include "lvgl.h"
+namespace tt::lvgl {
+
/**
* Create the Tactility spinner widget
* @param parent pointer to an object, it will be the parent of the new spinner.
* @return the created spinner
*/
-lv_obj_t* tt_spinner_create(lv_obj_t* parent);
+lv_obj_t* spinner_create(lv_obj_t* parent);
+
+}
diff --git a/Tactility/Source/lvgl/Statusbar.cpp b/Tactility/Source/lvgl/Statusbar.cpp
index 6bdd103a..b26dfb69 100644
--- a/Tactility/Source/lvgl/Statusbar.cpp
+++ b/Tactility/Source/lvgl/Statusbar.cpp
@@ -90,8 +90,6 @@ static void statusbar_destructor(TT_UNUSED const lv_obj_class_t* class_p, lv_obj
static void update_icon(lv_obj_t* image, const StatusbarIcon* icon) {
if (icon->image != nullptr && icon->visible && icon->claimed) {
- lv_obj_set_style_image_recolor(image, lv_color_white(), 0);
- lv_obj_set_style_image_recolor_opa(image, 255, 0);
lv_image_set_src(image, icon->image);
lv_obj_remove_flag(image, LV_OBJ_FLAG_HIDDEN);
} else {
diff --git a/Tactility/Source/lvgl/Toolbar.cpp b/Tactility/Source/lvgl/Toolbar.cpp
index 77d9c293..3a22f124 100644
--- a/Tactility/Source/lvgl/Toolbar.cpp
+++ b/Tactility/Source/lvgl/Toolbar.cpp
@@ -16,7 +16,6 @@ typedef struct {
lv_obj_t* close_button;
lv_obj_t* close_button_image;
lv_obj_t* action_container;
- ToolbarAction* action_array[TOOLBAR_ACTION_LIMIT];
uint8_t action_count;
} Toolbar;
@@ -60,30 +59,23 @@ lv_obj_t* toolbar_create(lv_obj_t* parent, const std::string& title) {
lv_obj_center(obj);
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW);
- int32_t title_offset_x = (TOOLBAR_HEIGHT - TOOLBAR_TITLE_FONT_HEIGHT - 8) / 4 * 3;
- int32_t title_offset_y = (TOOLBAR_HEIGHT - TOOLBAR_TITLE_FONT_HEIGHT - 8) / 2;
-
toolbar->close_button = lv_button_create(obj);
lv_obj_set_size(toolbar->close_button, TOOLBAR_HEIGHT - 4, TOOLBAR_HEIGHT - 4);
obj_set_style_no_padding(toolbar->close_button);
toolbar->close_button_image = lv_image_create(toolbar->close_button);
lv_obj_align(toolbar->close_button_image, LV_ALIGN_CENTER, 0, 0);
- // Need spacer to avoid button press glitch animation
- spacer_create(obj, title_offset_x, 1);
-
- lv_obj_t* label_container = lv_obj_create(obj);
- obj_set_style_no_padding(label_container);
- lv_obj_set_style_border_width(label_container, 0, 0);
- lv_obj_set_height(label_container, LV_PCT(100)); // 2% less due to 4px translate (it's not great, but it works)
- lv_obj_set_flex_grow(label_container, 1);
-
- toolbar->title_label = lv_label_create(label_container);
+ toolbar->title_label = lv_label_create(obj);
lv_obj_set_style_text_font(toolbar->title_label, &lv_font_montserrat_18, 0); // TODO replace with size 18
- lv_obj_set_height(toolbar->title_label, TOOLBAR_TITLE_FONT_HEIGHT);
lv_label_set_text(toolbar->title_label, title.c_str());
- lv_obj_set_pos(toolbar->title_label, 0, title_offset_y);
lv_obj_set_style_text_align(toolbar->title_label, LV_TEXT_ALIGN_LEFT, 0);
+ lv_obj_set_flex_grow(toolbar->title_label, 1);
+ int32_t title_offset_x = (TOOLBAR_HEIGHT - TOOLBAR_TITLE_FONT_HEIGHT - 8) / 4 * 3;
+ // Margin top doesn't work
+ lv_obj_set_style_pad_top(toolbar->title_label, title_offset_x, 0);
+ lv_obj_set_style_margin_left(toolbar->title_label, 8, 0);
+ // Hack for margin bug where buttons in flex get rendered more narrowly
+ lv_obj_set_style_margin_right(toolbar->title_label, -8, 0);
toolbar->action_container = lv_obj_create(obj);
lv_obj_set_width(toolbar->action_container, LV_SIZE_CONTENT);
@@ -112,7 +104,7 @@ void toolbar_set_nav_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callb
lv_image_set_src(toolbar->close_button_image, icon); // e.g. LV_SYMBOL_CLOSE
}
-uint8_t toolbar_add_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* user_data) {
+lv_obj_t* toolbar_add_button_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* user_data) {
auto* toolbar = (Toolbar*)obj;
uint8_t id = toolbar->action_count;
tt_check(toolbar->action_count < TOOLBAR_ACTION_LIMIT, "max actions reached");
@@ -126,7 +118,7 @@ uint8_t toolbar_add_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callba
lv_image_set_src(action_button_image, icon);
lv_obj_align(action_button_image, LV_ALIGN_CENTER, 0, 0);
- return id;
+ return action_button;
}
lv_obj_t* toolbar_add_switch_action(lv_obj_t* obj) {
@@ -138,7 +130,7 @@ lv_obj_t* toolbar_add_switch_action(lv_obj_t* obj) {
lv_obj_t* toolbar_add_spinner_action(lv_obj_t* obj) {
auto* toolbar = (Toolbar*)obj;
- return tt_spinner_create(toolbar->action_container);
+ return tt::lvgl::spinner_create(toolbar->action_container);
}
} // namespace
diff --git a/Tactility/Source/lvgl/Toolbar.h b/Tactility/Source/lvgl/Toolbar.h
index d5048cdf..07a5db3c 100644
--- a/Tactility/Source/lvgl/Toolbar.h
+++ b/Tactility/Source/lvgl/Toolbar.h
@@ -6,23 +6,14 @@
namespace tt::lvgl {
#define TOOLBAR_HEIGHT 40
-#define TOOLBAR_ACTION_LIMIT 8
#define TOOLBAR_TITLE_FONT_HEIGHT 18
-
-typedef void(*ToolbarActionCallback)(void* _Nullable context);
-
-typedef struct {
- const char* icon;
- const char* text;
- ToolbarActionCallback callback;
- void* _Nullable callback_context;
-} ToolbarAction;
+#define TOOLBAR_ACTION_LIMIT 4
lv_obj_t* toolbar_create(lv_obj_t* parent, const std::string& title);
lv_obj_t* toolbar_create(lv_obj_t* parent, const app::AppContext& app);
void toolbar_set_title(lv_obj_t* obj, const std::string& title);
void toolbar_set_nav_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* user_data);
-uint8_t toolbar_add_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* user_data);
+lv_obj_t* toolbar_add_button_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* user_data);
lv_obj_t* toolbar_add_switch_action(lv_obj_t* obj);
lv_obj_t* toolbar_add_spinner_action(lv_obj_t* obj);
} // namespace
diff --git a/Tactility/Source/service/statusbar/Statusbar.cpp b/Tactility/Source/service/statusbar/Statusbar.cpp
index 510f3482..53b96eb0 100644
--- a/Tactility/Source/service/statusbar/Statusbar.cpp
+++ b/Tactility/Source/service/statusbar/Statusbar.cpp
@@ -43,35 +43,29 @@ struct ServiceData {
// region wifi
-const char* getWifiStatusIconForRssi(int rssi, bool secured) {
- if (rssi > 0) {
- return TT_ASSETS_ICON_WIFI_CONNECTION_ISSUE;
- } else if (rssi >= -30) {
- return secured ? TT_ASSETS_ICON_WIFI_SIGNAL_4_LOCKED : TT_ASSETS_ICON_WIFI_SIGNAL_4;
- } else if (rssi >= -67) {
- return secured ? TT_ASSETS_ICON_WIFI_SIGNAL_3_LOCKED : TT_ASSETS_ICON_WIFI_SIGNAL_3;
+const char* getWifiStatusIconForRssi(int rssi) {
+ if (rssi >= -60) {
+ return TT_ASSETS_ICON_WIFI_SIGNAL_STRONG_WHITE;
} else if (rssi >= -70) {
- return secured ? TT_ASSETS_ICON_WIFI_SIGNAL_2_LOCKED : TT_ASSETS_ICON_WIFI_SIGNAL_2;
- } else if (rssi >= -80) {
- return secured ? TT_ASSETS_ICON_WIFI_SIGNAL_1_LOCKED : TT_ASSETS_ICON_WIFI_SIGNAL_1;
+ return TT_ASSETS_ICON_WIFI_SIGNAL_MEDIUM_WHITE;
} else {
- return secured ? TT_ASSETS_ICON_WIFI_SIGNAL_0_LOCKED : TT_ASSETS_ICON_WIFI_SIGNAL_0;
+ return TT_ASSETS_ICON_WIFI_SIGNAL_WEAK_WHITE;
}
}
static const char* wifi_get_status_icon(wifi::WifiRadioState state, bool secure) {
int rssi;
switch (state) {
- case wifi::WIFI_RADIO_ON_PENDING:
case wifi::WIFI_RADIO_ON:
+ case wifi::WIFI_RADIO_ON_PENDING:
+ case wifi::WIFI_RADIO_CONNECTION_PENDING:
+ return TT_ASSETS_ICON_WIFI_SCAN_WHITE;
case wifi::WIFI_RADIO_OFF_PENDING:
case wifi::WIFI_RADIO_OFF:
- return TT_ASSETS_ICON_WIFI_OFF;
- case wifi::WIFI_RADIO_CONNECTION_PENDING:
- return TT_ASSETS_ICON_WIFI_FIND;
+ return TT_ASSETS_ICON_WIFI_OFF_WHITE;
case wifi::WIFI_RADIO_CONNECTION_ACTIVE:
rssi = wifi::getRssi();
- return getWifiStatusIconForRssi(rssi, secure);
+ return getWifiStatusIconForRssi(rssi);
default:
tt_crash("not implemented");
}
@@ -132,16 +126,28 @@ static _Nullable const char* power_get_status_icon() {
uint8_t charge = charge_level.valueAsUint8;
- if (charge >= 90) {
+ if (charge >= 95) {
return TT_ASSETS_ICON_POWER_100;
- } else if (charge >= 70) {
- return TT_ASSETS_ICON_POWER_080;
- } else if (charge >= 50) {
- return TT_ASSETS_ICON_POWER_060;
- } else if (charge >= 30) {
- return TT_ASSETS_ICON_POWER_040;
- } else {
- return TT_ASSETS_ICON_POWER_020;
+ } else if (charge >= 85) {
+ return TT_ASSETS_ICON_POWER_90;
+ } else if (charge >= 75) {
+ return TT_ASSETS_ICON_POWER_80;
+ } else if (charge >= 65) {
+ return TT_ASSETS_ICON_POWER_70;
+ } else if (charge >= 55) {
+ return TT_ASSETS_ICON_POWER_60;
+ } else if (charge >= 45) {
+ return TT_ASSETS_ICON_POWER_50;
+ } else if (charge >= 35) {
+ return TT_ASSETS_ICON_POWER_40;
+ } else if (charge >= 25) {
+ return TT_ASSETS_ICON_POWER_30;
+ } else if (charge >= 15) {
+ return TT_ASSETS_ICON_POWER_20;
+ } else if (charge >= 5) {
+ return TT_ASSETS_ICON_POWER_10;
+ } else {
+ return TT_ASSETS_ICON_POWER_0;
}
}
diff --git a/Tactility/Source/service/statusbar/Statusbar.h b/Tactility/Source/service/statusbar/Statusbar.h
deleted file mode 100644
index d3964aa3..00000000
--- a/Tactility/Source/service/statusbar/Statusbar.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-namespace tt::service::statusbar {
-
-/**
- * Return the relevant icon asset from assets.h for the given inputs
- * @param rssi the rssi value
- * @param secured whether the access point is a secured one (as in: not an open one)
- * @return
- */
-const char* getWifiStatusIconForRssi(int rssi, bool secured);
-
-} // namespace
diff --git a/TactilityC/Source/TactilityC/TactilityC.cpp b/TactilityC/Source/TactilityC/TactilityC.cpp
index 8391056f..de14c968 100644
--- a/TactilityC/Source/TactilityC/TactilityC.cpp
+++ b/TactilityC/Source/TactilityC/TactilityC.cpp
@@ -1,5 +1,3 @@
-extern "C" {
-
#ifdef ESP_PLATFORM
#include "elf_symbol.h"
@@ -7,15 +5,20 @@ extern "C" {
#include "app/App.h"
#include "app/SelectionDialog.h"
#include "lvgl/Toolbar.h"
+#include "TactilityC/lvgl/Spinner.h"
#include "lvgl.h"
+extern "C" {
+
const struct esp_elfsym elf_symbols[] {
// Tactility
ESP_ELFSYM_EXPORT(tt_app_selectiondialog_start),
ESP_ELFSYM_EXPORT(tt_set_app_manifest),
ESP_ELFSYM_EXPORT(tt_lvgl_toolbar_create),
ESP_ELFSYM_EXPORT(tt_lvgl_toolbar_create_simple),
+ // tt::lvgl
+ ESP_ELFSYM_EXPORT(tt_lvgl_spinner_create),
// lv_obj
ESP_ELFSYM_EXPORT(lv_obj_add_event_cb),
ESP_ELFSYM_EXPORT(lv_obj_align),
@@ -113,9 +116,6 @@ const struct esp_elfsym elf_symbols[] {
ESP_ELFSYM_EXPORT(lv_list_add_button),
ESP_ELFSYM_EXPORT(lv_list_get_button_text),
ESP_ELFSYM_EXPORT(lv_list_set_button_text),
- // lv_spinner
- ESP_ELFSYM_EXPORT(lv_spinner_create),
- ESP_ELFSYM_EXPORT(lv_spinner_set_anim_params),
// lv_textarea
ESP_ELFSYM_EXPORT(lv_textarea_create),
ESP_ELFSYM_EXPORT(lv_textarea_get_accepted_chars),
@@ -139,11 +139,15 @@ void tt_init_tactility_c() {
elf_set_custom_symbols(elf_symbols);
}
+}
+
#else // Simulator
+extern "C" {
+
void tt_init_tactility_c() {
}
-#endif // ESP_PLATFORM
-
}
+
+#endif // ESP_PLATFORM
diff --git a/TactilityC/Source/TactilityC/lvgl/Spinner.cpp b/TactilityC/Source/TactilityC/lvgl/Spinner.cpp
new file mode 100644
index 00000000..6d7fcdd6
--- /dev/null
+++ b/TactilityC/Source/TactilityC/lvgl/Spinner.cpp
@@ -0,0 +1,10 @@
+#include "Spinner.h"
+#include "lvgl/Spinner.h"
+
+extern "C" {
+
+lv_obj_t* tt_lvgl_spinner_create(lv_obj_t* parent) {
+ return tt::lvgl::spinner_create(parent);
+}
+
+}
diff --git a/TactilityC/Source/TactilityC/lvgl/Spinner.h b/TactilityC/Source/TactilityC/lvgl/Spinner.h
new file mode 100644
index 00000000..e3e3c2e3
--- /dev/null
+++ b/TactilityC/Source/TactilityC/lvgl/Spinner.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "lvgl.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+lv_obj_t* tt_lvgl_spinner_create(lv_obj_t* parent);
+
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file
diff --git a/TactilityCore/Source/StringUtils.cpp b/TactilityCore/Source/StringUtils.cpp
index 5868a389..2316f18f 100644
--- a/TactilityCore/Source/StringUtils.cpp
+++ b/TactilityCore/Source/StringUtils.cpp
@@ -1,6 +1,5 @@
#include "StringUtils.h"
#include
-#include
#include
namespace tt::string {
@@ -29,6 +28,15 @@ bool getPathParent(const char* path, char* output) {
}
}
+std::string getLastPathSegment(const std::string& path) {
+ auto index = path.find_last_of('/');
+ if (index != std::string::npos) {
+ return path.substr(index + 1);
+ } else {
+ return "";
+ }
+}
+
std::vector split(const std::string&input, const std::string&delimiter) {
size_t token_index = 0;
size_t delimiter_index;
diff --git a/TactilityCore/Source/StringUtils.h b/TactilityCore/Source/StringUtils.h
index e2ee8f20..0d2f9555 100644
--- a/TactilityCore/Source/StringUtils.h
+++ b/TactilityCore/Source/StringUtils.h
@@ -23,6 +23,12 @@ int findLastIndex(const char* text, size_t from_index, char find);
*/
bool getPathParent(const char* path, char* output);
+/**
+ * Given a filesystem path as input, get the last segment of a path
+ * @param[in] path input path
+ */
+std::string getLastPathSegment(const std::string& path);
+
/**
* Splits the provided input into separate pieces with delimiter as separator text.
* When the input string is empty, the output list will be empty too.
diff --git a/TactilityHeadless/Source/Assets.h b/TactilityHeadless/Source/Assets.h
index 9e7d2f97..5cb52342 100644
--- a/TactilityHeadless/Source/Assets.h
+++ b/TactilityHeadless/Source/Assets.h
@@ -6,6 +6,9 @@
// Splash
#define TT_ASSETS_BOOT_LOGO TT_ASSET("boot_logo.png")
+// UI
+#define TT_ASSETS_UI_SPINNER TT_ASSET("spinner.png")
+
// App icons
#define TT_ASSETS_APP_ICON_FALLBACK TT_ASSET("app_icon_fallback.png")
#define TT_ASSETS_APP_ICON_FILES TT_ASSET("app_icon_files.png")
@@ -20,24 +23,26 @@
#define TT_ASSETS_ICON_SDCARD_ALERT TT_ASSET("sdcard_alert.png")
// Wifi status
-#define TT_ASSETS_ICON_WIFI_CONNECTION_ISSUE TT_ASSET("wifi_connection_issue.png")
-#define TT_ASSETS_ICON_WIFI_FIND TT_ASSET("wifi_find.png")
-#define TT_ASSETS_ICON_WIFI_OFF TT_ASSET("wifi_off.png")
-#define TT_ASSETS_ICON_WIFI_PERM_SCAN TT_ASSET("wifi_perm_scan.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_0 TT_ASSET("wifi_signal_0.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_0_LOCKED TT_ASSET("wifi_signal_0_locked.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_1 TT_ASSET("wifi_signal_1.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_1_LOCKED TT_ASSET("wifi_signal_1_locked.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_2 TT_ASSET("wifi_signal_2.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_2_LOCKED TT_ASSET("wifi_signal_2_locked.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_3 TT_ASSET("wifi_signal_3.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_3_LOCKED TT_ASSET("wifi_signal_3_locked.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_4 TT_ASSET("wifi_signal_4.png")
-#define TT_ASSETS_ICON_WIFI_SIGNAL_4_LOCKED TT_ASSET("wifi_signal_4_locked.png")
+#define TT_ASSETS_ICON_WIFI_OFF_WHITE TT_ASSET("wifi_off_white.png")
+#define TT_ASSETS_ICON_WIFI_SCAN_WHITE TT_ASSET("wifi_scan_white.png")
+#define TT_ASSETS_ICON_WIFI_SIGNAL_WEAK_WHITE TT_ASSET("wifi_signal_weak_white.png")
+#define TT_ASSETS_ICON_WIFI_SIGNAL_MEDIUM_WHITE TT_ASSET("wifi_signal_medium_white.png")
+#define TT_ASSETS_ICON_WIFI_SIGNAL_STRONG_WHITE TT_ASSET("wifi_signal_strong_white.png")
+// Black (Wifi Manage)
+#define TT_ASSETS_ICON_WIFI_LOCK_BLACK TT_ASSET("wifi_lock_black.png")
+#define TT_ASSETS_ICON_WIFI_SIGNAL_WEAK_BLACK TT_ASSET("wifi_signal_weak_black.png")
+#define TT_ASSETS_ICON_WIFI_SIGNAL_MEDIUM_BLACK TT_ASSET("wifi_signal_medium_black.png")
+#define TT_ASSETS_ICON_WIFI_SIGNAL_STRONG_BLACK TT_ASSET("wifi_signal_strong_black.png")
// Power status
-#define TT_ASSETS_ICON_POWER_020 TT_ASSET("power_020.png")
-#define TT_ASSETS_ICON_POWER_040 TT_ASSET("power_040.png")
-#define TT_ASSETS_ICON_POWER_060 TT_ASSET("power_060.png")
-#define TT_ASSETS_ICON_POWER_080 TT_ASSET("power_080.png")
+#define TT_ASSETS_ICON_POWER_0 TT_ASSET("power_0.png")
+#define TT_ASSETS_ICON_POWER_10 TT_ASSET("power_10.png")
+#define TT_ASSETS_ICON_POWER_20 TT_ASSET("power_20.png")
+#define TT_ASSETS_ICON_POWER_30 TT_ASSET("power_30.png")
+#define TT_ASSETS_ICON_POWER_40 TT_ASSET("power_40.png")
+#define TT_ASSETS_ICON_POWER_50 TT_ASSET("power_50.png")
+#define TT_ASSETS_ICON_POWER_60 TT_ASSET("power_60.png")
+#define TT_ASSETS_ICON_POWER_70 TT_ASSET("power_70.png")
+#define TT_ASSETS_ICON_POWER_80 TT_ASSET("power_80.png")
+#define TT_ASSETS_ICON_POWER_90 TT_ASSET("power_90.png")
#define TT_ASSETS_ICON_POWER_100 TT_ASSET("power_100.png")
diff --git a/sdkconfig.board.lilygo-tdeck b/sdkconfig.board.lilygo-tdeck
index 2e07d39e..ffc26040 100644
--- a/sdkconfig.board.lilygo-tdeck
+++ b/sdkconfig.board.lilygo-tdeck
@@ -9,6 +9,9 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
+CONFIG_LV_USE_MSGBOX=n
+CONFIG_LV_USE_SPINNER=n
+CONFIG_LV_USE_WIN=n
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
diff --git a/sdkconfig.board.m5stack-core2 b/sdkconfig.board.m5stack-core2
index f28c2c09..421268bb 100644
--- a/sdkconfig.board.m5stack-core2
+++ b/sdkconfig.board.m5stack-core2
@@ -9,6 +9,9 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
+CONFIG_LV_USE_MSGBOX=n
+CONFIG_LV_USE_SPINNER=n
+CONFIG_LV_USE_WIN=n
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
diff --git a/sdkconfig.board.m5stack-cores3 b/sdkconfig.board.m5stack-cores3
index ffa7a204..ba2d7f1a 100644
--- a/sdkconfig.board.m5stack-cores3
+++ b/sdkconfig.board.m5stack-cores3
@@ -9,6 +9,9 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
+CONFIG_LV_USE_MSGBOX=n
+CONFIG_LV_USE_SPINNER=n
+CONFIG_LV_USE_WIN=n
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
diff --git a/sdkconfig.board.yellow-board b/sdkconfig.board.yellow-board
index ad464d9e..8e00e31f 100644
--- a/sdkconfig.board.yellow-board
+++ b/sdkconfig.board.yellow-board
@@ -9,6 +9,9 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
+CONFIG_LV_USE_MSGBOX=n
+CONFIG_LV_USE_SPINNER=n
+CONFIG_LV_USE_WIN=n
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
diff --git a/sdkconfig.defaults b/sdkconfig.defaults
index 8dc75001..9722087f 100644
--- a/sdkconfig.defaults
+++ b/sdkconfig.defaults
@@ -9,6 +9,9 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
+CONFIG_LV_USE_MSGBOX=n
+CONFIG_LV_USE_SPINNER=n
+CONFIG_LV_USE_WIN=n
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
diff --git a/sdkconfig.developer b/sdkconfig.developer
index dfe09d6e..ae28f071 100644
--- a/sdkconfig.developer
+++ b/sdkconfig.developer
@@ -1,7 +1,10 @@
CONFIG_STACK_CHECK_STRONG=y
-LV_USE_SYSMON=y
+CONFIG_LV_USE_SYSMON=y
CONFIG_LV_USE_OBSERVER=y
CONFIG_LV_USE_PERF_MONITOR=y
+CONFIG_LV_USE_REFR_DEBUG=y
+CONFIG_LV_USE_LAYER_DEBUG=y
+
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y