[REFACTOR] Moved the requiresApiKey
to service enum
#308
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.
This pull request includes changes to refactor how the
requiresApiKey
property is managed within theWeatherForecastService
class and its usage across the codebase. The main goal is to simplify the handling of API key requirements by moving therequiresApiKey
property directly into theWeatherForecastService
enum.Refactoring API key requirement handling:
data-model/src/main/java/dev/hossain/weatheralert/datamodel/WeatherForecastService.kt
: AddedrequiresApiKey
property to theWeatherForecastService
enum and set default values for each service. [1] [2]app/src/main/java/dev/hossain/weatheralert/ui/UiExtensions.kt
: Removed therequiresApiKey
property fromWeatherServiceConfig
data class and updated theserviceConfig
function to reflect this change. [1] [2] [3] [4] [5]app/src/main/java/dev/hossain/weatheralert/ui/settings/UserSettingsScreen.kt
: Updated theUserSettingsScreen
function to use the newrequiresApiKey
property fromWeatherForecastService
.