[android] Improve custom map server dialog UX

Signed-off-by: NoelClick <dev@noel.click>
This commit is contained in:
NoelClick
2025-12-03 00:12:17 -08:00
committed by jeanbaptisteC
parent 82d2932ba0
commit 76ecd8209e
6 changed files with 104 additions and 37 deletions

View File

@@ -11,6 +11,18 @@
android:layout_height="match_parent"
android:layout_above="@+id/button_container"
android:layout_gravity="center">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_advanced"
style="@style/Widget.Material3.Button.IconButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon="@drawable/ic_settings"
app:iconTint="?colorOnSurface"
android:contentDescription="@string/download_resources_custom_url_title"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_margin="@dimen/margin_half" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -6,15 +6,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_advanced"
style="@style/MwmWidget.M3.Button.Secondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginEnd="@dimen/margin_base_plus"
android:text="@string/download_resources_advanced"
android:textAppearance="@style/MwmTextAppearance.Body2"/>
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/chb_download_country"
android:layout_width="wrap_content"

View File

@@ -5,6 +5,10 @@
android:id="@+id/til_custom_map_server"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/margin_base"
android:paddingEnd="@dimen/margin_base"
android:paddingTop="@dimen/margin_base"
android:paddingBottom="@dimen/margin_half"
android:hint="@string/download_resources_custom_url_title"
app:placeholderText="@string/download_resources_custom_url_hint">
@@ -12,8 +16,6 @@
android:id="@+id/edit_custom_map_server"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:inputType="textUri"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>

View File

@@ -974,5 +974,6 @@
<string name="download_resources_custom_url_title">Custom Map Server</string>
<string name="download_resources_custom_url_message">Override the default map download server used for map downloads. Leave empty to use CoMaps default server.</string>
<string name="download_resources_custom_url_hint">https://maps.comaps.app/</string>
<string name="download_resources_custom_url_summary_none">Not set</string>
<string name="download_resources_custom_url_error_scheme">Please enter a full URL starting with http:// or https:// and ending with /.</string>
</resources>

View File

@@ -212,14 +212,11 @@
android:defaultValue="true"
android:widgetLayout="@layout/preference_switch"
android:order="2"/>
<EditTextPreference
android:key="@string/pref_custom_map_download_url"
android:title="@string/pref_custom_map_download_url_title"
android:summary="@string/pref_custom_map_download_url_summary"
android:inputType="textUri"
android:singleLine="true"
app:placeholderText="@string/pref_custom_map_download_url_hint"
android:order="3"/>
<Preference
android:key="@string/pref_custom_map_download_url"
android:title="@string/pref_custom_map_download_url_title"
android:summary="@string/pref_custom_map_download_url_summary"
android:order="3" />
</androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen>