Commit Graph

326 Commits

Author SHA1 Message Date
Daniel Shokouhi
39b19b7fc3
Add padding to refresh interval to avoid text getting cut off (#4119) 2024-01-06 01:18:19 +00:00
Joris Pelgröm
62414e4cd5
Migrate BuildConfig to Gradle Build Files (#4049)
- Addresses the following warning: The option setting 'android.defaults.buildfeatures.buildconfig=true' is deprecated. Each module uses the BuildConfig class so it's added everywhere.
2023-12-15 12:46:48 -05:00
Steffen Klee
e0731c9c79
Add Wear OS TLS client certificate authentication (TLS CCA) support (#3924)
* Add Wear OS TLS client certificate authentication (TLS CCA) support

Wear OS does not currently allow the user to install certificates to the
system-wide KeyChain for TLS CCA support. This commit adds support for
using certificates from the app-specific Android KeyStore with UI for
setting up a certificate during the Wear OS onboarding process.
The manual step in the onboarding process is required since we cannot
transmit certificates of the Android KeyChain because they are not
extractable.

In particular, this commit adds the following changes:
* KeyStoreImpl as an additional KeyChainRepository interface
  implementation for loading and storing keys to the application's
  KeyStore. TLSHelper uses KeyStoreImpl as a fallback key manager.
* UI for selecting a certificate file with GET_CONTENT intent during
  Wear OS onboarding in OnboardingActivity if it is detected that the
  Home Assistant may require TLS CCA. The UI includes a password check
  for the PKCS12 container.
* During onboarding the app sends the raw PKCS12 data to Wear OS
  together with the container password. The connection is assumed to be
  encrypted and trusted so that no additional encryption is necessary.

* Move PKCS12 password check to lifecycle scope

* Remove redundant try-catch when loading PKCS12

* Simplify MobileAppIntegrationView layout code
2023-12-13 15:19:54 -05:00
Joseph Abbey
6b56bc579a
mobile_app_notification_cleared for wearos (#4035)
* mobile_app_notification_cleared for wearos

* Fix imports

* Remove database id extra

* Fix whitespace

* Reformatted imports and added the receiver to the manifest

* Move `handleDeleteIntent` to common
2023-12-13 14:45:46 -05:00
Joris Pelgröm
7d76bb4b51
Update tiles logged out state to prevent cut off overflow, shortcuts tile label (#3975)
Update tiles logged out state to prevent cut off overflow

 - Limit length of logged out state string to prevent text cut off and shorten strings to help with translations
 - Fix inconsistent shortcuts tile name
2023-10-28 11:15:22 -04:00
Joris Pelgröm
73c928d6e4
Update shortcut tile add/remove + destroy handling (#3974)
- Updates the shortcut tile's handling of add/remove event + destroying the service, just like the camera tile, to prevent the service scope being cancelled while the app is still storing tile added/removed
 - (this service already didn't overwrite existing tile data when onTileAddEvent was called again)
2023-10-28 11:14:55 -04:00
Joris Pelgröm
607833d4c7
Update launcher icon, Play Store feature graphic (#3960)
* Update launcher icon, Play Store feature graphic

 - Update launcher icon to better match other Android app launcher icon sizes
 - Update Play Store feature graphic to new version

* Cannot deduplicate this launcher icon on Wear

* ktlint
2023-10-20 17:47:26 -04:00
Daniel Shokouhi
e10ec793d4
Show sensor state in secondary label in Wear OS sensor UI (#3959)
* Show sensor state in secondary label in Wear OS sensor UI

* Review comments

* Remove runBlocking in previews and invert label check to match phone
2023-10-20 17:46:41 -04:00
Joris Pelgröm
cda25479d6
Add clear_notification support to Wear OS (#3956)
- Move the clear_notification command to common extensions and add support in the Wear OS app
2023-10-20 17:45:48 -04:00
Joris Pelgröm
a94c90e5aa
Improve camera tile add/remove event handling (#3954)
- If there is already a camera tile with the ID of the tile in `onTileAddEvent` stored in the database, don't overwrite it with a new blank tile as the user configuration might be lost.
 - Run add/remove event code blocking to prevent the system immediately destroying the service and as a result cancelling the work to save tile data in the database. Without the blocking code I could semi-reliably get it to destroy the service within several milliseconds of adding/removing, often preventing the database code from running.
2023-10-20 17:45:15 -04:00
Joris Pelgröm
26c6bcd282
Fix icon button sizes (#3918)
* Fix icon button sizes

* Merge fixes
2023-10-06 18:38:09 +00:00
Joris Pelgröm
65863148fc
Update entity button with toggle styling to match M3 components (#3923)
Update entity button styling to match M3 components
2023-10-06 18:08:22 +00:00
Daniel Shokouhi
2a597602f1
Fix detail pane after material 3 migration, add additional previews (#3920) 2023-10-06 12:56:48 -04:00
Daniel Shokouhi
709ca07e8c
Shorten some settings strings (#3921)
* Shorten some settings strings

* Remove unused string
2023-10-06 16:51:32 +00:00
Joris Pelgröm
f2e9541264
Fix Picker rotary input on some devices and update design (#3919) 2023-10-06 11:38:40 -04:00
Daniel Shokouhi
f23a6cb046
Update Chip and ToggleChip to Button and ToggleButton except for WearToggleChip (#3917)
* Update complication config screen to m3 components

* Clean up some code so its resuable

* Review comments and bump library

* Migrate more screens

* Review comments

* Tweak some colors

* Use consistent button container color

* Remove unnecessary font color

* Tweak Button disabled color to match ToggleButton

* Update a couple more chips and a preview

* Use in app color default
2023-10-06 11:37:17 -04:00
Daniel Shokouhi
d7a08d3b08
Update manual onboarding screens to prevent the button from overlapping elements (#3909)
* Update manual onboarding screen to prevent the button from overlapping elements

* Limit to 2 lines of text

* Switch to ScrollView

* Add padding for round devices

* Review comments
2023-10-05 09:58:08 -04:00
Daniel Shokouhi
d3a1f318f8
Begin migrating Wear OS components to Material 3 (#3904)
* First commit of migrating Wear OS components to Material 3

* Tweak more colors, fix some variables, use switches and bold more text

* More clean up

* Fix color in default chip

* Clean up unused code
2023-10-05 09:57:41 -04:00
Márton Maráz
2641422e50
Add NFC state sensor (#3905)
* Add first draft for NFC sensor

* Rename NfcSensorManager.nfcSensor to nfcStateSensor

* Move NfcSensorManager to the common module

* Add BroadcastReceiver subscription to NfcAdapter.ACTION_ADAPTER_STATE_CHANGED in both the app and wear modules

* Remove TODO comments

* Change updateType to INTENT

* Convert simple methods to expression body

* Change mdi:nfc to mdi:nfc-variant

* Fix docs URL

* Reword NFC sensor manager according to the PR suggestions
2023-10-05 09:57:33 -04:00
Daniel Shokouhi
49cc4aa7d3
Use recommended splash screen library for Wear OS (#3908)
* Use recommended splash screen library for Wear OS

* More tweaks per recommendations

* Add splash screen to Assist

* Add splash screen for Assist

* Use mipmap instead of drawable
2023-10-02 18:24:39 -04:00
Daniel Shokouhi
f9c7bceac0
Switch to Wear Device specific preview (#3906) 2023-10-02 18:23:48 -04:00
Joris Pelgröm
ae3248ca4d
Update Wear more details screen to prevent cut off (#3899) 2023-09-29 22:47:36 -04:00
Daniel Shokouhi
a15f7b3bc4
Add missing scroll bar to remaining screens (#3895)
* Add missing scroll bar to remaining screens

* Add Scaffold to ThemeLazyColumn

* Remove unneeded variable

* Remove nested scaffold
2023-09-29 08:29:56 -04:00
Joris Pelgröm
2f777a1379
ListHeader: fix text cut off (#3898)
ListHeader: set overflow, limit lines based on font size

 - Set overflow for ListHeader to ellipsis instead of cutting of text
 - Set the maximum number of lines for ListHeader based on the font size
 - Center text in the list header for nicer appearance in case of multiple ines
2023-09-28 17:40:39 -04:00
Joris Pelgröm
4a4cc31b97
Update icon (#3888)
* Update icon

 - Replace old icon with the new icon
 - Update app primary color to new blue tint
 - Deduplicate resources

* Update feature graphic

* Decouple app icon color from main color
2023-09-28 17:38:48 -04:00
Joris Pelgröm
43cc4d4a73
Fix rotary input after first screen & for picker (#3881)
- The recent switch to Horologist modifiers for rotary input broke after the first screen because of manual focus requesting, and the refresh interval picker in general so also switch that to a Horologist modifier.
2023-09-20 19:42:20 -04:00
Dubzer
20f87c810b
Add smooth scrolling for rotary input (#3876) 2023-09-19 15:39:25 -04:00
Joris Pelgröm
3915ec6d8f
Automatically fix broken registrations/webhooks (#3875) 2023-09-19 15:38:50 -04:00
Joris Pelgröm
2c20baf0f5
Add camera tile to Wear OS (#3870)
* [WIP] Prepare camera snapshot tile

* Deduplicate refresh views

* Get/save tile config in the database

* Deduplicate haptic click, add to camera refresh

* [WIP] Camera tile settings UI

 - Create UI to set camera tile settings
 - Reuse shortcut tile settings activity as a general tile settings activity

* Rename camera snapshot tile to camera tile

* Cleanup: camera entities selection, empty state, preview image

 - On initial load also create a list of camera entities to make it possible to select them without showing up elsewhere in the app
 - Add text to empty state instructing the user to set a camera
 - Update tile preview images

* Fix logged out state on missing tile config

* Force tile update on login

* Scale bitmap to fit inside screen size

 - Scale the received image to a bitmap that does not exceed the screen size to ensure timely refreshes and prevent parcels that are too big
2023-09-17 16:57:33 -04:00
Daniel Shokouhi
90bf7369e2
Clean up some left over code after update to getIcon (#3827) 2023-08-31 19:53:10 -04:00
Daniel Shokouhi
bb58a578dd
Use unavailable and unknown states consistently when dealing with sensors and entities (#3821)
* Use unavailable and unknown states consistently when dealing with sensors and entities

* Update more sensors

* Remove unused import
2023-08-28 17:43:25 -04:00
Daniel Shokouhi
6c2e555e57
Various changes to entity usage (#3816)
* Various changes to entity usage

* Remove unneeded code

* String fixes

* Remove redundant string
2023-08-26 16:53:31 -04:00
Joris Pelgröm
cde8dc9ee9
More dependency bumps (#3815) 2023-08-26 16:42:20 -04:00
Joris Pelgröm
fb71b9c788
Update to Kotlin 1.9/Compose 1.5/Compose Wear 1.2/AGP 8.1.1 (#3814)
- Update to Kotlin 1.9
 - Update to Compose 1.5 and Compose Wear 1.2, both depend on and are required for Kotlin 1.9. Compose Wear includes lazy classes moving to a different package so updated imports.
 - Update to AGP 8.1.1 to remove compatibility warning
 - Update Navigation Compose to 2.7.1 as it uses Compose 1.5 internally
 - Update Accompanist to 0.32 as it uses Compose 1.5 internally
 - Switch Room to KSP instead of kapt because this (latest stable) release doesn't work with Kotlin 1.9 otherwise. As a result, we no longer need to specifically enable incremental compilation.
2023-08-24 14:51:29 -04:00
Daniel Shokouhi
1bdbd3f2ce
Android Auto: Set icon color when entity is considered in an active state (#3805)
* Android Auto: Set icon color when entity is considered in an active state

* Add link to frontend code for determing active state

* Add lawn_mower domain and a check on supported colored domains

* Split up isActive and state colored domains

* Update map screen
2023-08-24 14:43:10 -04:00
Joris Pelgröm
7f14582909
Add 'toggle' tap action to entity state widget (#3798)
* [WIP] Widget tap action: toggle entity

* Add feedback on press and failure

* Share code for pressing on entities

* Align cover press action

 - Toggle will stop if possible when opening/closing if supported so prefer toggle instead of open/close

* Toggle by default if supported

 - Set the default tap action for supported entities to toggle instead of refresh

* Update widget description
2023-08-19 19:24:44 +00:00
Joris Pelgröm
01326db427
Discard notifications when not registered to prevent crash (#3784)
* Discard notifications when not registered to prevent crash

* Add same check to Wear
2023-08-11 19:22:29 +00:00
Joris Pelgröm
cea54d6895
Stop TTS playback on new Assist pipeline run (#3778) 2023-08-11 11:31:17 -04:00
Daniel Shokouhi
256835a380
Add update sensors notification command to Wear OS (#3774) 2023-08-10 13:55:54 -04:00
Joris Pelgröm
add1955901
Assist last used: remember STT and record proactively (before connected) (#3755)
Assist last used: remember STT and record before connected

 - For the last used pipeline for Assist, remember whether or not it supports STT input, and if it does start recording proactively/as soon as possible to avoid missing voice input while doing network checks.
 - Fix potential wrong server while sending voice data.
 - Fix voice input remaining active after getting an error response.
2023-08-04 10:59:27 -04:00
Justin Bassett
b0deb6de77
Migrate deploys to Fastlane (#3745)
* Migrate deploys to Fastlane

* Couple minor fixes to onPush.yml

* Copy paste is hard
2023-08-01 11:08:12 -04:00
Justin Bassett
1a6c2b94d2
Initial work on migrating plugins to catalogs. (#3737)
* Initial work on migrating plugins to catalogs.

* Remove Enterprise Build profiling since we really don't use it.

* Use a common Java Version and sdk versions.

* ktlint

* Review comments.
2023-07-31 20:35:39 -04:00
Joris Pelgröm
670b17e76c
Apply various IDE code quality suggestions (#3734) 2023-07-31 15:17:42 -04:00
Joris Pelgröm
0800e9b402
Allow selecting unavailable entities for complications/tiles (#3733)
Fix: allow selecting unavailable entities for complications/tiles

 - It should be possible to choose an unavailable entity for display on a complication or tile, as you can with favorites, and even entities that are available now can become unavailable later
2023-07-31 15:15:31 -04:00
Márton Maráz
a8a7363317
Implement support for multiple Shortcut Tiles on Wear OS (#3697)
* Extract JSONArray -> List<String> conversion to extension fun

* Refactor navigation around Shortcuts Tile settings

* Add ShortcutsTileId enum class

* Introduce multiple ShortcutTile subclasses and modify settings UI and storage to support multiple Tiles

* Check if correct ShortcutsTileId is passed as parameter to BaseShortcutTile

* Update TileUpdateRequester usages to account for multiple Tiles

* Add entity count to Shortcut Tile list in Settings

* Fix ktlint errors

* Fix more ktlint errors

* Extract string resource

* Add MULTI_INSTANCES_SUPPORTED to ShortcutsTile to be able to use any number of Tiles

* Refresh the list of Shortcut Tiles in the Settings without needing to restart the app

* Remove test logs

* Update androidx.wear.tiles:tiles to the latest version which doesn't yet require API 34 compileSdk version

* Fix crash when the preference's value is "{}"

* Fix crash when key String is "null" and converting to Int

* Rename placeholder variable name

* Add a comment explaining why to save the tiles in a getter

* Return emptyList() directly for clarity

* Remove icons from "Shortcut tile #n" entries in Settings

* Pass emptyList instead of using the non-null assertion operator to prevent NPEs in edge cases

* Refactor getTileShortcuts and getAllTileShortcuts in WearPrefsRepositoryImpl.
Make the code more readable and understandable, and reduce code duplication.

* Make it explicit that intKey is only intended to be null if stringKey == "null"

* Rename getTileShortcuts to getTileShortcutsAndSaveTileId and make it save the tileId not only when there's a null key in the map, but also when the tileId is not yet in the map. This way, actual Tiles and the tileId keys will be more in sync.

* Handle adding Shortcuts Tile immediately after updating the app to a new version which introduces support for multiple Shortcuts Tiles.

* Show message in the Settings when there are no Shortcuts tiles added yet.

* Refine message in the Settings when there are no Shortcuts tiles added yet

* WIP: ConfigShortcutsTile action

* Update comments about Wear OS versions

* Finalize ConfigShortcutsTile feature by applying @jpelgrom's suggestion to OpenShortcutTileSettingsActivity

* Only wrap the code in runCatching which is expected to throw an Exception under normal circumstances, when the pref value needs to be migrated from the old format.

* Call getTileShortcutsAndSaveTileId in OpenShortcutTileSettingsActivity

* Remove unnecessary stuff
2023-07-31 15:14:01 -04:00
Justin Bassett
ba3170362e
First Steps into making Gradle Catalogs (#3724)
* First Steps into making Gradle Catalogs

* Rename a couple dependencies.

* Downgrade compose compiler since it'll take more to bump the kotlin version apparently.

* Code review comments.

* Refactoring these are painful.

* Now I know my ABC, next time wont you sing with me....
2023-07-29 11:11:08 -04:00
Daniel Shokouhi
54836c8db2
Bump some project dependencies (#3718) 2023-07-27 15:42:50 -04:00
Sebastian Lövdahl
3db34ec408
Show measurement unit in Wear OS complication (#3703)
* Show measurement unit in Wear OS complication

* Extend existing `friendlyState` method

* Make showing unit configurable (defaulting to false)

* Feedback fixes
2023-07-25 14:37:31 -04:00
Joris Pelgröm
32cfa31d86
Update/replace deprecations and unused code in wear module (#3699) 2023-07-24 10:29:42 -04:00
Joris Pelgröm
e4f697fc3b
Resume Assist voice input on new intent (as assistant app/brought to front) (#3692)
* Resume Assist voice input on new intent (as assistant app/brought to front)

* Use constants for android.intent.action.ASSIST

 - android.intent.action.VOICE_ASSIST is marked as internal
2023-07-21 14:11:57 -04:00