Update the provider activity
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/settings_weather_provider_api_key_title"
|
||||
android:text="@string/settings_weather_provider_api"
|
||||
android:gravity="center"
|
||||
style="@style/AnotherWidget.Main.Title"/>
|
||||
<TextView
|
||||
@ -41,6 +41,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/action_save"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="16dp"
|
||||
@ -63,6 +64,45 @@
|
||||
android:orientation="horizontal"
|
||||
android:descendantFocusability="beforeDescendants"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center_vertical">
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/weather_provider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textCapWords"
|
||||
android:textStyle="bold"
|
||||
android:nextFocusUp="@id/api_key"
|
||||
android:nextFocusLeft="@id/api_key"
|
||||
android:gravity="center_vertical|start"
|
||||
android:textColor="@color/colorPrimaryText"
|
||||
app:boxBackgroundColor="@color/colorPrimary"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:hintTextColor="@color/colorPrimary"
|
||||
android:hint="@string/settings_weather_provider_api"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:textAlignment="viewStart"
|
||||
android:textDirection="locale"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="viewStart"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:id="@+id/weather_provider_inner"
|
||||
android:textDirection="locale"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:gravity="center_vertical|start" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:descendantFocusability="beforeDescendants"
|
||||
android:focusable="true"
|
||||
android:paddingTop="16dp"
|
||||
android:id="@+id/api_key_container"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center_vertical">
|
||||
@ -79,7 +119,7 @@
|
||||
app:boxBackgroundColor="@color/colorPrimary"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:hintTextColor="@color/colorAccent"
|
||||
android:hint="@string/api_key_hint"
|
||||
android:hint="@string/settings_weather_provider_api_key_title"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:textAlignment="viewStart"
|
||||
android:textDirection="locale"
|
||||
@ -89,87 +129,56 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="viewStart"
|
||||
android:textDirection="locale"
|
||||
android:id="@+id/api_key_inner"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:gravity="center_vertical|start" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:background="@color/disabledButtonBackground" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_title_1"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Subtitle"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_subtitle_1"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_title_2"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Subtitle"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_subtitle_2"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_title_3"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Subtitle"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_subtitle_3"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Subtitle"
|
||||
android:textSize="16sp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="@string/api_key_info_all_set"/>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:letterSpacing="0"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="start|center_vertical"
|
||||
android:textAlignment="viewStart"
|
||||
android:layout_marginStart="-8dp"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
android:textAllCaps="false"
|
||||
android:id="@+id/action_open_provider"
|
||||
android:text="@string/action_open_provider"/>
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/info_container">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:background="@color/disabledButtonBackground" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="This weather provider needs\nan API key to work correctly."/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Main.Subtitle"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:text="Please, open the provider website, create a personal account and copy here the default key."/>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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_marginStart="-8dp"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
android:textAllCaps="false"
|
||||
android:id="@+id/action_open_provider"
|
||||
android:text="@string/action_open_provider"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
@ -162,52 +162,22 @@
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/action_weather_provider_api_key"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/round_vpn_key"
|
||||
app:tint="@color/colorPrimaryText"/>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AnotherWidget.Settings.Title"
|
||||
android:text="@string/settings_weather_provider_api_key_title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/label_weather_provider_api_key"
|
||||
style="@style/AnotherWidget.Settings.Subtitle"/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/api_key_alert_icon"
|
||||
android:src="@drawable/round_error"
|
||||
app:tint="@color/errorColorText"/>
|
||||
</LinearLayout>
|
||||
android:duplicateParentState="true"
|
||||
android:textSize="14sp"
|
||||
android:paddingStart="64dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/weather_provider_error"
|
||||
android:textColor="@color/errorColorText"
|
||||
android:letterSpacing="0"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
|
||||
app:textAllCaps="false" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -262,6 +232,22 @@
|
||||
android:text="@string/action_grant_permission"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:duplicateParentState="true"
|
||||
android:textSize="14sp"
|
||||
android:paddingStart="64dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/weather_provider_location_error"
|
||||
android:textColor="@color/errorColorText"
|
||||
android:letterSpacing="0"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
|
||||
app:textAllCaps="false" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -130,6 +130,17 @@
|
||||
<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>
|
||||
<string name="action_open_provider_here">Open here.com</string>
|
||||
<string name="action_open_provider_accuweather">Open Accuweather.com</string>
|
||||
<string name="action_open_provider_weather_gov">Open Weather.gov</string>
|
||||
<string name="action_open_provider_yr">Open yr.no</string>
|
||||
<string name="action_open_provider_smhi">Open smhi.se</string>
|
||||
<string name="action_open_provider_weather_ca">Open weather.gc.ca</string>
|
||||
<string name="action_open_provider_bom">Open bom.gov.au</string>
|
||||
<string name="action_open_provider_meteofrance">Open meteofrance.com</string>
|
||||
|
||||
<!-- Clock -->
|
||||
<string name="settings_clock_title">Clock</string>
|
||||
|
Reference in New Issue
Block a user