Update the providers system

This commit is contained in:
Tommaso Berlose 2020-10-11 22:05:20 +02:00
parent 2c81c7cfd2
commit 364198ef08
4 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@ -96,6 +96,10 @@ class WeatherProviderActivity : AppCompatActivity() {
if (provider == Constants.WeatherProvider.WEATHER_GOV) {
it.text = getString(R.string.us_only_message)
}
if (provider == Constants.WeatherProvider.YR) {
it.text = getString(R.string.celsius_only_message)
}
}
.clicked(R.id.action_configure) {
BottomSheetWeatherProviderSettings(this) {
@ -106,7 +110,6 @@ class WeatherProviderActivity : AppCompatActivity() {
}.show()
}
.visibility(R.id.action_configure, if (/*WeatherHelper.isKeyRequired(provider) && */provider.value == Preferences.weatherProvider) View.VISIBLE else View.GONE)
.visibility(R.id.info_container, if (WeatherHelper.isKeyRequired(provider) || provider == Constants.WeatherProvider.WEATHER_GOV) View.VISIBLE else View.GONE)
.with<TextView>(R.id.provider_error) {
if (Preferences.weatherProviderError != "" && Preferences.weatherProviderError != "-") {
it.text = Preferences.weatherProviderError

View File

@ -152,6 +152,7 @@
<string name="weather_provider_error_generic">Errore, verifica la configurazione del provider meteo.</string>
<string name="api_key_required_message">Account richiesto</string>
<string name="us_only_message">Solo US</string>
<string name="celsius_only_message">Solo Celsius</string>
<string name="weather_select_a_provider">Scegli provider</string>
<string name="weather_provider_activity_subtitle">Scegli un provider meteo.\nAlcuni provider richiedono la creazione di un account personale, ma è grauito e permette di avere migliori prestazioni.</string>

View File

@ -164,6 +164,7 @@
<string name="weather_provider_error_generic">Something went wrong, check the weather provider config.</string>
<string name="api_key_required_message">Account required</string>
<string name="us_only_message">US Only</string>
<string name="celsius_only_message">Metric Units Only</string>
<string name="weather_select_a_provider">Select a provider</string>
<string name="weather_provider_activity_subtitle">Select a weather provider from the list.\nA few providers need a free personal account,\nbut they\'re usually more accurate.</string>