| 1421 | } |
| 1422 | |
| 1423 | bool 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 | |
| 1456 | void DisplayManager_::drawProgressBar(int16_t x, int16_t y, int progress, uint32_t pColor, uint32_t pbColor) |
| 1457 | { |
no test coverage detected