Modify the Paxcount display logic to show the string if either `ble` or `wifi` is not zero, rather than requiring both to be non-zero.
Signed-off-by: James Rich <james.a.rich@gmail.com>
* feat: Show alert notifications and override silent mode
This commit adds support for showing alert notifications with high priority and the ability to override silent mode to ensure they are delivered to the user.
The changes include:
- Adding `showAlertNotification` function which overrides silent mode and configures a custom volume, shows a notification with high priority.
- Creating a new notification channel for alerts.
- Adding the alert app port number to the list of remembered data types.
- Modifying `rememberDataPacket` to check for alert app messages and show alert notification.
* Add notification policy access permission and DND override for alerts
This commit adds the `ACCESS_NOTIFICATION_POLICY` permission to the manifest and requests this permission from the user. It also adds a check for notification policy access in the MainActivity, and if it's not granted, shows a rationale dialog.
Additionally, the commit adds a notification override to the `showAlertNotification` function in `MeshServiceNotifications` to temporarily disable DND for alert notifications and restore the original ringer settings afterwards.
* Refactor: Enhance Android Notification and DND Handling
- **Notification Channel Improvements:**
- Added `notificationLightColor` for better customization.
- Set `enableLights` and `enableVibration` in the alert channel.
- Use `alert.mp3` sound for alert channel.
- **DND Permission Request:**
- Introduced a new permission request flow for Do Not Disturb (DND) access.
- Show a rationale dialog before requesting permission.
- Persist if rationale was shown to avoid re-prompting.
- Added a `notificationPolicyAccessLauncher` to handle the permission request result.
- **Critical Alert Text**
- Added critical alert text in strings.
- Used critical alert text if the alert message is empty.
- **Other Changes**
- Removed unused imports and constants.
- Updated snackbar to support action.
* Refactor alert notification logic
- Change `notificationLightColor` to be lazy initialized.
- Update alert notification to use `CATEGORY_ALARM`.
- Use `dataPacket.alert` instead of `dataPacket.text` for alert content.
- Add `alert` property to `DataPacket` to handle alert messages.
* Set notification light color back to blue.
* Request notification permissions on grant
The app now checks for notification policy access after notification permissions are granted.
* make detekt happy
* updates dnd dialog text
* Refactor notification channel creation and critical alerts
- Initialize notification channels on service creation.
- Remove `ACCESS_NOTIFICATION_POLICY` permission.
- Modify the logic for requesting "Do Not Disturb" override permission to align with channel settings.
- Add new string resources for Alerts Channel Settings.
- Update wording for critical alert DND override.
- Update DND override request flow.
- Create notification channels on the service creation using `initChannels`.
- Adjust logic to check for "Do Not Disturb" override permission to align with notification channel settings.
- Ensure notification channels are created only if they do not already exist.
* refactor: Update DnD dialog with instructions for Samsung
- Renamed "Alerts Channel Settings" to "Channel Settings".
- Added Samsung-specific instructions and a link to Samsung's support page for Do Not Disturb mode in the alerts dialog.
- Updated the dialog to display Samsung-specific instructions when on a Samsung device.
* Refactor critical alerts instructions
- Updated the critical alerts instructions to include a link to Samsung's support page directly within the alert dialog.
- Removed the separate "Samsung Instructions" string and incorporated the information into the main instruction text, improving clarity and reducing redundancy.
- Made improvements to the UI.
* Add confirmation dialog for changing to router role
Introduced a confirmation dialog that will be shown when changing the device role to "router".
The confirmation dialog includes links to the "Device Role Documentation" and "Choosing The Right Device Role" blog post.
The user must check a checkbox to confirm.
* Update router role handling
Modified the handling of the router role in `DeviceConfigItemList.kt` to avoid returning prematurely from the `onItemSelected` lambda. This ensures that the role is updated properly when a user selects the "ROUTER" role.
* removes konami code check, remove testing code
* Refactor router role confirmation text
- Moves the router role confirmation text to strings.xml.
- Updates to use `AnnotatedString.fromHtml` instead of `buildAnnotatedString` and `withLink`.
- Changes from hard-coded strings to string resources.
Modified NodeDetail.kt to replace direct comparisons with 0f or 0 for sensor values with corresponding has*() functions.
This change improves code readability by clearly indicating the presence or absence of sensor data.
* Remove unused SoftwareUpdateService code and commented out service reg in manifest
* Remove unused methods that had unnecessary version checks
* Regenerate baseline to remove detekt issues that are no longer present
* feat: Introduce Version Catalog for Dependency Management
This commit introduces a version catalog via `libs.versions.toml` to centralize and manage project dependencies. It replaces the previous hardcoded dependency versions in `app/build.gradle` with references to the version catalog. This change enhances maintainability and organization by centralizing dependency management.
- Added `gradle/libs.versions.toml` to define dependencies and their versions.
- Updated `app/build.gradle` to utilize dependencies from the version catalog.
* chore: migrate plugins to version catalog
* chore: sort lines in `libs.versions.toml`
-Sorts `versions`, `dependencies`, and `plugins` references alphabetically.
* feat: pin ZXing Core dependency
* Suppressed warning about updating zxing-core to avoid confusion.
* Added a note to avoid updating zxing-core.
* refactor: Enforce consistent `implementation()` calls in `build.gradle`
- Ensures all library dependencies are called with `implementation(libs.xxx)` instead of `implementation libs.xxx` in `build.gradle`.
* feat: use version catalog bundles
- Updated dependencies in the app build.gradle to use bundles where possible.
* fix: fix ui test dependency declarations
* chore: comments for clarity
* fix: remove material3 from this PR
Fixes#1561
* Add large font preview
* Adjust default min size such that the filter input will accomodate larger fonts. Also, align the dropdown icon and use body1 typography for input text
* Add license and newline to fix detekt issues
* Changed the humidity color on the graph to the same blue used for current in the power graph.
* Refactor: Centralized the blue used in both the Env and Pow metrics in CommonCharts.kt.
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Add dependency to KotlinX immutable collections
* Build a Compose-stable UI state vs using a database model. Move appropriate mapping logic for converting database model -> UI state into the view model. Introduce animations to new log placement and automated scroll.
* Center the top card row vertically
* Move log message generation into separate method
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Implement initial support for adding and removing nodes from favorites
* Make favorite nodes' names show up bold in the node list
* Forgot to add this here when I was fixing the previous merge conflicts. Whoops!
* Make detekt happy
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Refactor: We can draw the horizontal lines for the graphs independent of min and max entries.
* Added navigation to the PowerMetrics log with a skeleton screen.
* Drew channel 1 voltage.
* Refactor: Assigned colors for the data within the enum instead of a list-ordinal combo.
* Plotted Ch1 current line.
* Refactor: Did not need the parameters being used to get the desired ui in the TimeLabels composable.
* Added a row to help distinguish between units.
* Refactor: MetricsTimeSelector.kt to SlidingSelector.kt; the new version allows for generic options.
* Added a sliding selector to choose between power channels and changed the legend data to instead display current and voltage.
* We now plot the line for which the user has selected a power channel option.
* Don't need the current line to be dotted anymore.
* Don't think we need to display an info dialog for voltage and current.
* Wrote card to display the power channel data entries.
* detekt
* Refactor: current color change to accommodate the themes better
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Filter out emojis from text when finding initials
* Confirm non-English non-emoji unicde isn't filtered
* Remove unused example unit test
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>