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.
Fixes #90
This pull request includes several changes to the weather alert application, focusing on adding new API functionality, improving user preferences management, and enhancing the user interface for API key handling. The most important changes include adding a new API endpoint for weather overview, updating the preferences manager to handle user-provided API keys, and modifying the user interface to prompt users to add their own API keys when necessary.
API Enhancements:
WeatherOverview
data class and a new API endpointgetWeatherOverview
to validate API keys. (app/src/main/java/dev/hossain/weatheralert/api/ApiModel.kt
,app/src/main/java/dev/hossain/weatheralert/api/WeatherApi.kt
) [1] [2]Preferences Management:
PreferencesManager
to store and retrieve user-provided API keys usingDataStore
. (app/src/main/java/dev/hossain/weatheralert/data/PreferencesManager.kt
,app/src/main/java/dev/hossain/weatheralert/data/UserPreferences.kt
) [1] [2] [3]User Interface:
AlertSettingsScreen
to includeSnackbarData
and navigate toBringYourOwnApiKeyScreen
when prompting users to add their own API keys. (app/src/main/java/dev/hossain/weatheralert/ui/addalert/AlertSettingsScreen.kt
) [1] [2] [3] [4] [5]Repository Changes:
isValidApiKey
method inWeatherRepository
to validate API keys by sending a basic API request. (app/src/main/java/dev/hossain/weatheralert/data/WeatherRepository.kt
) [1] [2]Miscellaneous:
SnackbarData
data class to handle snackbar messages with optional actions. (app/src/main/java/dev/hossain/weatheralert/data/Models.kt
)