Skip to content

Conversation

@JF002
Copy link
Collaborator

@JF002 JF002 commented Sep 2, 2023

Add IsAvailable() to Navigation App

Navigation app now (since #1838) needs 2 images to be loaded from the resources on the external filesystem. This PR adds an enabled field to the Applications struct. This field is true for all applications expect for Navigation which calls Navigation::IsAvailable(). This methods returns true if the 2 files are available in the resources.

The application list disables the application (draws it in grey, disables the touch callback) if the enable flag is not set.

This implementation is similar than the one used by the Watchface Setting app.

Here is the result from the devkit and InfiniSim :

InfiniSim_2023-09-02_161026
image

JF002 added 5 commits August 20, 2023 20:59
The TTF font used by the navigation app is ~20KB and is stored in internal flash memory.
To free this space, the TTF font is now converted in 2 "atlas pictures" (pictures that contain multiple concatenated images) stored in the external flash memory. The navigation app now accesses one of those 2 files and apply an offset to display the desired picture.

The corresponding documentation has also been updated.
Add comments about the layout of the pictures that contain the icon and about the indexing of those icons.
In documentation (buildAndProgram.md), edit the section about the debug compilation mode. Remove the part about removing the Navigation app to free some memory (since it's not relevant anymore) and explain how to selectively build parts of the firmware in Debug mode.
Navigation app now needs 2 images to be loaded from the resources on the external filesystem. This PR adds an 'enabled' field to the Applications struct. This field is true for all applications expect for Navigation which calls Navigation::IsAvailable(). This methods returns true if the 2 files are available in the resources.

The application list disables the application (draws it in grey, disables the touch callback) if the enable flag is not set.
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

Build size and comparison to main:

Section Size Difference
text 376768B -19188B
data 940B -56B
bss 63420B 0B

Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@FintasticMan FintasticMan merged commit 0aead42 into main Sep 2, 2023
@FintasticMan FintasticMan deleted the add-is-available-to-navigation-app branch September 2, 2023 17:43
@FintasticMan FintasticMan added this to the 1.14.0 milestone Sep 18, 2023
Zetabite pushed a commit to Zetabite/InfiniTime that referenced this pull request Nov 12, 2023
Navigation app now needs 2 images to be loaded from the resources on the external filesystem. This PR adds an 'enabled' field to the Applications struct. This field is true for all applications expect for Navigation which calls Navigation::IsAvailable(). This methods returns true if the 2 files are available in the resources.

The application list disables the application (draws it in grey, disables the touch callback) if the enable flag is not set.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request May 25, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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};
      }

As right now only the Navigation app is using this, fix the issue by just
checking the already existing Navigation's IsAvailable method when its icon
is getting added.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request May 27, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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};
      }

As right now only the Navigation app is using this, fix the issue by just
checking the already existing Navigation's IsAvailable method when its icon
is getting added.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request May 29, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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};
      }

As right now only the Navigation app is using this, fix the issue by just
checking the already existing Navigation's IsAvailable method when its icon
is getting added.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request May 29, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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};
      }

As right now only the Navigation app is using this, fix the issue by just
checking the already existing Navigation's IsAvailable method when its icon
is getting added.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request Jun 1, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request Jul 2, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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.
mmind pushed a commit to mmind/InfiniTime that referenced this pull request Jul 2, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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.
mark9064 pushed a commit that referenced this pull request Jul 3, 2025
Commit 0aead42 ("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 63e0c4f ("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.
tmaklin pushed a commit to tmaklin/InfiniTime that referenced this pull request Jul 31, 2025
Commit 0aead42 ("navigation: Add is available (InfiniTimeOrg#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 63e0c4f ("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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants