How lylio/kotlinweatherapp works
BasicWeatherApp is an Android weather app: users can view current conditions and forecasts for their device location or search for a city. The documented and sampled flow runs from app navigation into a screen and its ViewModel, through use cases and repositories, to OpenWeatherMap; weather responses then supply the UI. The graph also preserves forecast presentation, location access, data models, and dependency wiring. Source excerpts confirm key calls; some unsampled ViewModel and location connections are shown only where the README documents the layered architecture.
Main entry points: HomeViewModel.kt Home ViewModel · components Weather cards · WeatherRepositoryImpl.kt Weather repository · NavGraph.kt App navigation
Components 22
App and presentation
- Main activity
app/src/main/java/com/botsheloramela/basicweatherapp/MainActivity.kt - App navigation
app/src/main/java/com/botsheloramela/basicweatherapp/navigation/NavGraph.kt - Home screen
app/src/main/java/com/botsheloramela/basicweatherapp/ui/views/HomeView.kt - Forecast screen
app/src/main/java/com/botsheloramela/basicweatherapp/ui/views/ForecastView.kt - Home ViewModel
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/HomeViewModel.kt - Forecast ViewModel
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/ForecastViewModel.kt
Weather domain
- Device location
app/src/main/java/com/botsheloramela/basicweatherapp/domain/usecase/GetDeviceLocationUseCase.kt - Current weather use cases
app/src/main/java/com/botsheloramela/basicweatherapp/domain/usecase/GetCurrentWeatherUseCase.kt - City search use case
app/src/main/java/com/botsheloramela/basicweatherapp/domain/usecase/GetCurrentWeatherByCityUseCase.kt - Forecast use case
app/src/main/java/com/botsheloramela/basicweatherapp/domain/usecase/GetWeatherForecastUseCase.kt
Data and services
- Location repository
app/src/main/java/com/botsheloramela/basicweatherapp/data/repository/LocationRepositoryImpl.kt - Weather repository
app/src/main/java/com/botsheloramela/basicweatherapp/data/repository/WeatherRepositoryImpl.kt - Weather API client
app/src/main/java/com/botsheloramela/basicweatherapp/data/remote/WeatherApi.kt - Dependency wiring
app/src/main/java/com/botsheloramela/basicweatherapp/di/AppModule.kt - Location wiring
app/src/main/java/com/botsheloramela/basicweatherapp/di/LocationModule.kt
Models and presentation support
- Weather response models
app/src/main/java/com/botsheloramela/basicweatherapp/data/model - Weather cards
app/src/main/java/com/botsheloramela/basicweatherapp/ui/components - Date and time helpers
app/src/main/java/com/botsheloramela/basicweatherapp/utils/DateTimeUtils.kt - Weather display mapping
app/src/main/java/com/botsheloramela/basicweatherapp/utils/WeatherUtils.kt - Color theme
app/src/main/java/com/botsheloramela/basicweatherapp/ui/theme/Color.kt
Other components
- Weather user
- OpenWeatherMap
Connections 26
- Weather user → Main activity: opens app
README.md - Main activity → App navigation: shows navigation
app/src/main/java/com/botsheloramela/basicweatherapp/MainActivity.kt - App navigation → Home screen: routes to
app/src/main/java/com/botsheloramela/basicweatherapp/navigation/NavGraph.kt - App navigation → Forecast screen: routes to
app/src/main/java/com/botsheloramela/basicweatherapp/navigation/NavGraph.kt - Home screen → Home ViewModel: requests weather
app/src/main/java/com/botsheloramela/basicweatherapp/ui/views/HomeView.kt - Forecast screen → Forecast ViewModel: observes state
app/src/main/java/com/botsheloramela/basicweatherapp/ui/views/ForecastView.kt - Home ViewModel → Device location: gets location
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/HomeViewModel.kt - Home ViewModel → Current weather use cases: fetches conditions
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/HomeViewModel.kt - Home ViewModel → City search use case: searches city
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/HomeViewModel.kt - Home ViewModel → Forecast use case: fetches forecast
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/HomeViewModel.kt - Forecast ViewModel → Forecast use case: requests forecast
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/ForecastViewModel.kt - Device location → Location repository: gets device location
- Current weather use cases → Weather repository: requests conditions
- City search use case → Weather repository: requests city data
- Forecast use case → Weather repository: requests forecast
app/src/main/java/com/botsheloramela/basicweatherapp/domain/usecase/GetWeatherForecastUseCase.kt - Weather repository → Weather API client: calls endpoints
app/src/main/java/com/botsheloramela/basicweatherapp/data/repository/WeatherRepositoryImpl.kt - Weather API client → OpenWeatherMap: fetches weather
app/src/main/java/com/botsheloramela/basicweatherapp/data/remote/WeatherApi.kt - Dependency wiring → Weather repository: binds implementation
app/src/main/java/com/botsheloramela/basicweatherapp/di/AppModule.kt - Location wiring → Location repository: binds implementation
app/src/main/java/com/botsheloramela/basicweatherapp/di/LocationModule.kt - Home screen → Weather cards: renders weather
app/src/main/java/com/botsheloramela/basicweatherapp/ui/views/HomeView.kt - Forecast screen → Weather cards: renders forecast
app/src/main/java/com/botsheloramela/basicweatherapp/ui/views/ForecastView.kt - Weather cards → Date and time helpers: formats dates
app/src/main/java/com/botsheloramela/basicweatherapp/ui/components/FiveDayWeatherForecastCard.kt - Weather cards → Weather display mapping: maps weather icons
app/src/main/java/com/botsheloramela/basicweatherapp/ui/components/FiveDayWeatherForecastCard.kt - Weather cards → Color theme: uses colors
app/src/main/java/com/botsheloramela/basicweatherapp/ui/components/MainWeatherCard.kt - Weather API client → Weather response models: decodes responses
app/src/main/java/com/botsheloramela/basicweatherapp/data/remote/WeatherApi.kt - Home ViewModel → Weather response models: processes weather data
app/src/main/java/com/botsheloramela/basicweatherapp/ui/viewmodel/HomeViewModel.kt