feature: weather and location text labels on the wallpaper#14
Merged
Conversation
The renderer draws an optional two-line overlay above everything else: the current condition with the temperature ("Rain · 10°") and the place name beneath it, bottom-center where the near scenery plane lends contrast. Three new settings drive it — show weather (default on), show location (default off), and a °C/°F choice. The place name reuses the manual city label, or a platform-Geocoder reverse lookup in device-location mode, cached per fix; label settings are captured before the refresh throttle so toggling them applies without waiting out the interval.
Also rewords the one comment that assumed the wallpaper lives on the lock screen — it serves the home screen just as well.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bottom-center was wrong on both counts: the scenery's silhouettes are the busiest part of the frame rather than a clean backdrop for text, and below them a launcher's dock and the lock screen's shortcuts own a whole band, not just the very bottom edge — the location line landed behind the dock icons. The top of the sky is the only region free of all of it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 74 |
| Duplication | 6 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
The overlay can sit under whatever a launcher or lock screen decides to draw, so it must be opt-in: both toggles now default to off and the labels appear only when the user asks for them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draws an optional text overlay on the wallpaper: the current condition with the temperature, and the place name beneath it.
What you get
Partly cloudy · 26°, from a new WMO-code → label table (weatherLabelFor) plus the temperature already in every snapshot. Unknown code → the bare temperature, no invented text.Seoul, South Korea, smaller and dimmer below it. Manual mode reuses the city label you picked; device mode reverse-geocodes the fix through the platformGeocoder(no new dependency, no API key, no extra permission), cached per fix. A failed lookup hides only that line and retries next refresh.Placement
Top of the sky, just under the status bar, drawn last so no weather obscures it.
The first attempt put it bottom-center, which was wrong twice over and both were caught on-device: the scenery's silhouettes are the busiest part of the frame rather than a clean backdrop for text, and a launcher's dock plus the lock screen's shortcuts own a whole band down there, not just the bottom edge — the location line ended up behind the dock icons. The top band is the only region free of the dock, the shortcuts, the fingerprint sensor and the silhouettes. The sun/moon shares it, so the text keeps a shadow and draws over.
Plumbing
SceneParamsgainsoverlayLabels: OverlayLabels?(null = no text pass at all).WeatherSceneProvidercaptures the three settings before the refresh throttle — same pattern asbackdropScene; they're display choices, not weather, so toggling them applies without waiting out the interval. The debug scene cycler leaves labels off, so a fake thunderstorm never gets labelled "Clear sky".Also rewords the one comment in the repo that assumed this wallpaper only lives on the lock screen — it serves the home screen just as well.
Testing
TDD throughout, red verified before every implementation. 61 tests, 0 failures (
./gradlew :app:testDebugUnitTest --rerun). New coverage: the WMO label table + unknown codes; Celsius/Fahrenheit conversion, rounding and unknown-unit fallback; settings round-trip; and nine provider tests — labels reach the params, unknown-code fallback, both toggles off → no overlay, manual label used without geocoding, device fix geocoded, failed geocode hides only the location, geocode cached per fix, unit change applies mid-throttle, and enabling the location label mid-interval geocodes the cached fix without refetching weather.Verified on the emulator across the Beach, Metropolis and Mountains sceneries.
🤖 Generated with Claude Code