Skip to content

prevent android from caching stale UI from tools - #146

Merged
dupontgu merged 1 commit into
mainfrom
fix/stale-ui
Aug 10, 2026
Merged

prevent android from caching stale UI from tools#146
dupontgu merged 1 commit into
mainfrom
fix/stale-ui

Conversation

@dupontgu

@dupontgu dupontgu commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  • prevent weather tool from updating every time a button press occurs

(See comment in EntryPoint.kt below for detailed description of the issue)

…l from updating every time a button press occurs
@dupontgu
dupontgu requested a review from aconanlai August 5, 2026 18:06
)

private suspend fun updateState(transform: (WeatherUiState) -> WeatherUiState) {
withContext(Dispatchers.Main) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These MutableStateFlow can be updated safely from whatever context

// When LightOS moves to an external tool that's already in memory, it shows a system screenshot by default
// because there are no transition animations. here we override that to not show a screenshot (so it shows nothing instead).
// This feels more natural for tools that want to show specific UI immediately when foregrounded.
// You probably want to leave this as "false" unless you're building for alternate devices.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@dupontgu
dupontgu merged commit d0f675b into main Aug 10, 2026
1 check passed
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.

2 participants