mirror of
https://github.com/pawelorzech/SunZones.git
synced 2026-01-29 19:54:26 +00:00
Sunrise, sunset & daylight tracker for multiple locations. Animated sun/moon arcs, time-of-day gradients, yearly daylight chart. Kotlin + Jetpack Compose + Material 3.
| .idea | ||
| app | ||
| build/reports/problems | ||
| gradle | ||
| screenshots | ||
| .gitattributes | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| local.properties | ||
| README.md | ||
| settings.gradle.kts | ||
SunZones
Track sunrise, sunset and daylight across multiple locations around the world. A minimal, single-screen Android app with time-aware gradient backgrounds, animated sun/moon arcs, and a yearly daylight chart.
Screenshots
Features
- Multi-location tracking -- swipe between saved locations to see real-time sun and moon data
- Sunrise & sunset times with day/night length and countdown to next sunrise
- Animated sun/moon arc -- a visual progress indicator showing where the sun (or moon) is in its path across the sky
- Moon phase & illumination -- current lunar phase emoji and illumination percentage
- Time-of-day gradients -- card backgrounds shift dynamically through sunrise, morning, midday, afternoon, sunset, twilight and night palettes
- Yearly daylight chart -- scrollable month-by-month visualization of day length and sunrise/sunset distribution
- Timezone-aware -- each location stores its own IANA timezone, so times are always correct regardless of where your device is
- Search or GPS -- add locations by city name search or use your current position
- 20 languages -- English, Polish, Chinese, Hindi, Spanish, French, Arabic, Bengali, Portuguese, Russian, Urdu, Indonesian, German, Japanese, Nigerian Pidgin, Marathi, Telugu, Turkish, Tamil, Vietnamese
Architecture
Clean MVVM, single-activity Jetpack Compose app with Hilt dependency injection.
Room DB (Flow)
-> LocationDao -> LocationRepository -> GetLocationsUseCase
-> CalculateSunTimesUseCase -> SunLocation (UI model)
-> MainViewModel (StateFlow) -> Compose UI
| Layer | Responsibility |
|---|---|
data/local |
Room entity, DAO, database |
data/repository |
Thin DAO wrapper, current-location replacement logic |
domain/usecase |
Sun/moon calculations via commons-suncalc, yearly daylight aggregation |
domain/model |
SunLocation (computed fields), MonthDaylight (chart data) |
ui/main |
HorizontalPager of SunCard composables, 60-second auto-refresh |
ui/addlocation |
Geocoder search + GPS, timezone resolution via Android ICU |
di |
Hilt module providing Room, DAO, Geocoder, FusedLocationProviderClient |
Tech stack
| Language | Kotlin |
| UI | Jetpack Compose, Material 3 |
| DI | Hilt |
| Database | Room |
| Sun/moon math | commons-suncalc 3.11 |
| Location | Google Play Services FusedLocationProviderClient |
| Geocoding | Android Geocoder |
| Timezone lookup | android.icu.util.TimeZone (built-in) |
| Min SDK | 26 (Android 8.0) |
| Target SDK | 35 (Android 15) |
Build
Requires Java 17 and the Android SDK.
export JAVA_HOME="/opt/homebrew/Cellar/openjdk@17/17.0.18/libexec/openjdk.jdk/Contents/Home"
./gradlew assembleDebug
License
MIT -- Pawel Orzech