Connect weather.gov api

This commit is contained in:
Tommaso Berlose
2020-10-05 19:07:52 +02:00
parent e9c0cdd61c
commit bd4869540b
12 changed files with 216 additions and 32 deletions

View File

@ -92,6 +92,8 @@
android:clickable="false"
android:id="@+id/weather_provider_inner"
android:textDirection="locale"
android:textStyle="bold"
android:cursorVisible="false"
android:fontFamily="@font/google_sans"
android:gravity="center_vertical|start" />
</com.google.android.material.textfield.TextInputLayout>
@ -151,8 +153,9 @@
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:gravity="start"
android:id="@+id/info_title"
android:textAlignment="viewStart"
android:text="This weather provider needs\nan API key to work correctly."/>
android:text="@string/weather_provider_info_open_weather_title"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -160,22 +163,28 @@
android:textSize="16sp"
android:layout_marginTop="12dp"
android:gravity="start"
android:id="@+id/info_subtitle"
android:textAlignment="viewStart"
android:text="Please, open the provider website, create a personal account and copy here the default key."/>
android:text="@string/weather_provider_info_open_weather_subtitle"/>
<com.google.android.material.button.MaterialButton
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:textColor="@color/colorAccent"
android:letterSpacing="0"
android:clickable="true"
android:focusable="true"
android:layout_marginTop="8dp"
android:textSize="15sp"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
android:layout_marginTop="16dp"
android:layout_marginStart="-8dp"
android:textSize="14sp"
android:gravity="center_vertical|end"
app:strokeColor="@color/colorAccent"
android:textAlignment="viewEnd"
app:iconTint="@color/colorAccent"
app:icon="@drawable/round_chevron_right"
app:iconGravity="end"
app:iconSize="20dp"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:textAllCaps="false"
android:id="@+id/action_open_provider"
android:text="@string/action_open_provider"/>
</LinearLayout>

View File

@ -175,7 +175,7 @@
android:id="@+id/weather_provider_error"
android:textColor="@color/errorColorText"
android:letterSpacing="0"
android:fontFamily="@font/google_sans"
android:fontFamily="@font/google_sans_bold"
android:textStyle="bold"
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
app:textAllCaps="false" />
@ -245,7 +245,7 @@
android:id="@+id/weather_provider_location_error"
android:textColor="@color/errorColorText"
android:letterSpacing="0"
android:fontFamily="@font/google_sans"
android:fontFamily="@font/google_sans_bold"
android:textStyle="bold"
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
app:textAllCaps="false" />
@ -254,7 +254,7 @@
android:layout_height="wrap_content"
android:id="@+id/background_location_warning"
android:paddingStart="64dp"
android:paddingEnd="16dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView

View File

@ -30,5 +30,6 @@
<color name="errorColorText">#E93B3B</color>
<color name="warningColorText">#FB8C00</color>
<color name="disabledButtonBackground">#efefef</color>
<color name="success">#43A047</color>
</resources>

View File

@ -129,6 +129,7 @@
<string name="settings_weather_icon_pack_default">Icon pack %d</string>
<string name="background_location_warning">We will collect location data to update the weather information even when the app is closed or not in use.\nWe will not use these data otherwise.</string>
<string name="settings_weather_provider_api">Weather provider</string>
<string name="settings_weather_provider_open_weather">Open Weather Map</string>
<string name="settings_weather_provider_weatherbit">Weatherbit.io</string>
<string name="settings_weather_provider_foreca">Foreca.com</string>
@ -140,6 +141,7 @@
<string name="settings_weather_provider_weather_ca">Weather.gc.ca (Canada)</string>
<string name="settings_weather_provider_bom">BOM (Australia)\nPowered by Australia\'s national weather</string>
<string name="settings_weather_provider_meteofrance">Meteofrance.com (France)</string>
<string name="action_open_provider_open_weather">Open openweathermap.com</string>
<string name="action_open_provider_weatherbit">Open weatherbit.io</string>
<string name="action_open_provider_foreca">Open foreca.com</string>
@ -152,6 +154,36 @@
<string name="action_open_provider_bom">Open bom.gov.au</string>
<string name="action_open_provider_meteofrance">Open meteofrance.com</string>
<string name="weather_provider_info_open_weather_title">This weather provider needs\nan API key to work correctly.</string>
<string name="weather_provider_info_weatherbit_title">Weatherbit.io</string>
<string name="weather_provider_info_foreca_title">Foreca.com</string>
<string name="weather_provider_info_here_title">Here.com</string>
<string name="weather_provider_info_accuweather_title">Accuweather.com</string>
<string name="weather_provider_info_weather_gov_title">This weather provider works only\nfor locations inside the US.</string>
<string name="weather_provider_info_yr_title">YR.no/Met.no\nPowered by Meteorological Institute</string>
<string name="weather_provider_info_smhi_title">Smhi.se (Swedish)\nPowered by Swedish Meteorological</string>
<string name="weather_provider_info_weather_ca_title">Weather.gc.ca (Canada)</string>
<string name="weather_provider_info_bom_title">BOM (Australia)\nPowered by Australia\'s national weather</string>
<string name="weather_provider_info_meteofrance_title">Meteofrance.com (France)</string>
<string name="weather_provider_info_open_weather_subtitle">Please, open the provider website, create a personal account and copy here the default key.</string>
<string name="weather_provider_info_weatherbit_subtitle">Weatherbit.io</string>
<string name="weather_provider_info_foreca_subtitle">Foreca.com</string>
<string name="weather_provider_info_here_subtitle">Here.com</string>
<string name="weather_provider_info_accuweather_subtitle">Accuweather.com</string>
<string name="weather_provider_info_weather_gov_subtitle" />
<string name="weather_provider_info_yr_subtitle">YR.no/Met.no\nPowered by Meteorological Institute</string>
<string name="weather_provider_info_smhi_subtitle">Smhi.se (Swedish)\nPowered by Swedish Meteorological</string>
<string name="weather_provider_info_weather_ca_subtitle">Weather.gc.ca (Canada)</string>
<string name="weather_provider_info_bom_subtitle">BOM (Australia)\nPowered by Australia\'s national weather</string>
<string name="weather_provider_info_meteofrance_subtitle">Meteofrance.com (France)</string>
<string name="weather_provider_error_missing_key">The weather provider that you\'ve selected requires an API key.</string>
<string name="weather_provider_error_wrong_location">The current location is not supported.</string>
<string name="weather_provider_error_missing_location">Please select a valid location.</string>
<string name="weather_provider_error_expired_key">It seems that your API key has expired.</string>
<string name="weather_provider_error_misconfigured">The weather provider is wrongly configured.</string>
<!-- Clock -->
<string name="settings_clock_title">Clock</string>
<string name="settings_clock_app_title">Tap on clock opens</string>