mirror of
https://github.com/pawelorzech/SunZones.git
synced 2026-01-29 19:54:26 +00:00
Translate all 17 user-visible strings into Chinese, Hindi, Spanish, French, Arabic, Bengali, Portuguese, Russian, Urdu, Indonesian, German, Japanese, Nigerian Pidgin, Marathi, Telugu, Turkish, Tamil and Vietnamese. RTL support confirmed for Arabic and Urdu.
72 lines
3 KiB
Markdown
72 lines
3 KiB
Markdown
# 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
|
|
|
|
<p align="center">
|
|
<img src="screenshots/sunset.png" width="250" alt="Warsaw at sunset" />
|
|
<img src="screenshots/midday.png" width="250" alt="Adeje at midday" />
|
|
<img src="screenshots/night.png" width="250" alt="Warsaw at night" />
|
|
</p>
|
|
|
|
## 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](https://github.com/shred/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.
|
|
|
|
```bash
|
|
export JAVA_HOME="/opt/homebrew/Cellar/openjdk@17/17.0.18/libexec/openjdk.jdk/Contents/Home"
|
|
./gradlew assembleDebug
|
|
```
|
|
|
|
## License
|
|
|
|
[MIT](LICENSE) -- Pawel Orzech
|