MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / switchToApp

Method switchToApp

src/DisplayManager.cpp:1423–1454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1421}
1422
1423bool DisplayManager_::switchToApp(const char *json)
1424{
1425 DynamicJsonDocument doc(512);
1426 DeserializationError error = deserializeJson(doc, json);
1427 if (error)
1428 {
1429 doc.clear();
1430 return false;
1431 }
1432
1433 String name = doc["name"].as<String>();
1434 bool fast = doc["fast"] | false;
1435 doc.clear();
1436 int index = findAppIndexByName(name);
1437 if (index > -1)
1438 {
1439 if (fast)
1440 {
1441 ui->switchToApp(index);
1442 return true;
1443 }
1444 else
1445 {
1446 ui->transitionToApp(index);
1447 return true;
1448 }
1449 }
1450 else
1451 {
1452 return false;
1453 }
1454}
1455
1456void DisplayManager_::drawProgressBar(int16_t x, int16_t y, int progress, uint32_t pColor, uint32_t pbColor)
1457{

Callers 3

processMqttMessageFunction · 0.45
forceNextAppMethod · 0.45
addHandlerFunction · 0.45

Calls 3

findAppIndexByNameFunction · 0.85
transitionToAppMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected