navigation: fix greying out the app icon if not enabled
Commit 0aead42fdf51 ("navigation: Add is available (#1847)") added the ability to draw the app icon in grey and in a disabled state when some prerequisits were not met. Only the Navigation app was using this mechanism due to its icons being stored in the external memory and possibly missing.
Commit 63e0c4f4efb0 ("Application selection at build time") broke this by always setting the state as true: for (const auto& userApp : userApps) { apps[i++] = Screens::Tile::Applications {userApp.icon, userApp.app, true}; }
Fix this by creating an isAvailable() strcuture in the app classes, similar to how the Watchfaces handle the same problem of checking availability.
Build size and comparison to main:
| Section | Size | Difference |
|---|---|---|
| text | 379204B | 224B |
| data | 944B | 0B |
| bss | 22536B | 0B |
Fixing it for just one App feels wrong for me. Would you be interested in implementing the same behavior as done with the Watchfaces?
Having a default isAvailable function returning true, and override it for Apps that need it. In our case just Navigation
@NeroBurner sure, I can do that :-) .
I stumbled upon that thing while doing the other navigation stuff and InfiniSim not showing the flags, but also did not have a grasp on how the whole thing works.
So you're definitly right, doing that only for Navigation does not scale :-) and also thanks for pointing out how things should look correctly.
Hopefully that is what you had in mind :-) ... Follows now how the Wachfaces look