Skip to content

[Quality Q1] WearOS - Show offline indicator next to time text#5036

Open
sztomek wants to merge 12 commits intomainfrom
feat/wearos-offline-indicator
Open

[Quality Q1] WearOS - Show offline indicator next to time text#5036
sztomek wants to merge 12 commits intomainfrom
feat/wearos-offline-indicator

Conversation

@sztomek
Copy link
Contributor

@sztomek sztomek commented Feb 25, 2026

Description

This is a breakup task of the monstrous PR #4969
We now display an offline icon next to the time on most of the watch screens when the device is offline.
We dismiss this view when the user scrolls (horizontally) to the Now playing or Up next screens.

Fixes PCDROID-468

Testing Instructions

  1. Build and install the wear app
  2. Log in
  3. Go airplane mode
  4. Launch or open app again
  5. Notice the offline indicator

Screenshots or Screencast

Screenshot_20260221_162803

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@sztomek sztomek added this to the 8.7 milestone Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 20:28
@sztomek sztomek requested a review from a team as a code owner February 25, 2026 20:28
@sztomek sztomek requested review from MiSikora and removed request for a team February 25, 2026 20:28
@sztomek sztomek added [Type] Feature Adding a new feature. [Area] Wear OS watch app labels Feb 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an offline indicator icon next to the time text on WearOS screens when the device is disconnected from WiFi or cellular networks. The indicator is conditionally hidden when users navigate to certain screens (Now Playing and Up Next pages in the pager).

Changes:

  • Introduces a new TimeTextWithConnectivity composable that displays a cloud-off icon when offline
  • Implements global time text management through CompositionLocal to control visibility across screens
  • Updates ConnectivityStateManager to optimistically assume connection on startup

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
TimeTextWithConnectivity.kt New composable that shows offline indicator icon next to system time when disconnected
MainActivity.kt Implements global time text management using CompositionLocalProvider and controls visibility based on navigation
NowPlayingPager.kt Adds LocalSetTimeTextVisible composition local and hides time text on pages 1-2 using lifecycle-aware flow collection
ConnectivityStateManager.kt Changes initial connection state from false to true to prevent false offline indicator flash on startup
EffectsScreen.kt, NotificationScreen.kt, ConnectivityNotificationOverlay.kt, LoginWithPhoneScreen.kt Consistently hide default TimeText using timeText = {} pattern
ic_cloud_off.xml Adds vector drawable icon for offline indicator

Copilot AI review requested due to automatic review settings February 27, 2026 10:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

scope = coroutineScope,
started = SharingStarted.Eagerly,
initialValue = false,
initialValue = true,
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

initialValue = true makes isConnected emit true immediately even when the current networkStatus indicates no Wi‑Fi/Cell, which can momentarily show an incorrect “online” state and will break the existing ConnectivityStateManagerTest expectations (they currently assert the first emission is false when no networks are available). Consider keeping initialValue = false or deriving the initial value from the current network status so the first emission is accurate.

Suggested change
initialValue = true,
initialValue = false,

Copilot uses AI. Check for mistakes.
Comment on lines +56 to +57
painter = painterResource(IR.drawable.ic_cloud_off),
contentDescription = stringResource(LR.string.offline_icon_content_description),
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

For accessibility, the content description string "Offline icon" describes the UI element rather than the state it conveys. Consider changing it to something that communicates meaning to screen readers (e.g., "Offline" / "No internet connection").

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Wear OS watch app [Type] Feature Adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants