[android] Update connection failure dialog cancellation behavior

- Update the connection failure dialog in the world download view based on reviewers' feedback.

Signed-off-by: NoelClick <dev@noel.click>
This commit is contained in:
NoelClick
2025-12-17 20:41:26 -08:00
committed by jeanbaptisteC
parent 2b630964d0
commit 8cd1b41cd2
4 changed files with 24 additions and 8 deletions

View File

@@ -450,12 +450,16 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
.setTitle(titleId)
.setMessage(messageId)
.setCancelable(true)
.setOnCancelListener((dialog) -> setAction(PAUSE))
.setOnCancelListener((dialog) -> setAction(RESUME))
.setPositiveButton(R.string.try_again,
(dialog, which) -> {
setAction(TRY_AGAIN);
onTryAgainClicked();
})
.setNegativeButton(R.string.cancel,
(dialog, which) -> {
setAction(RESUME);
})
.setOnDismissListener(dialog -> mAlertDialog = null)
.show();
}

View File

@@ -44,6 +44,7 @@
<string name="pref_left_button" translatable="false">LeftButton</string>
<string name="pref_power" translatable="false">pref_power</string>
<string name="pref_custom_map_download_url" translatable="false">CustomMapDownloadUrl</string>
<string name="pref_advanced" translatable="false">pref_advanced</string>
<string name="notification_ticker_ltr" translatable="false">%1$s: %2$s</string>
<string name="notification_ticker_rtl" translatable="false">%2$s :%1$s</string>

View File

@@ -966,6 +966,8 @@
<string name="offline_explanation_title">Offline Maps</string>
<string name="offline_explanation_text">A map needs to be downloaded to view and navigate the area.\nDownload maps for areas you want to travel.</string>
<string name="list_description_empty">Edit the list to add a description</string>
<!-- Settings: Advanced group -->
<string name="advanced">Advanced</string>
<!-- Custom Download URL -->
<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>

View File

@@ -144,7 +144,8 @@
</intent>
</PreferenceScreen>
</androidx.preference.PreferenceCategory>
<PreferenceCategory
<PreferenceCategory
android:key="@string/pref_power"
android:title="@string/power_management"
android:order="4">
@@ -190,7 +191,8 @@
android:defaultValue="true"
android:widgetLayout="@layout/preference_switch"
android:order="5"/>
</PreferenceCategory>
</PreferenceCategory>
<androidx.preference.PreferenceCategory
android:key="@string/pref_privacy"
android:title="@string/privacy"
@@ -212,11 +214,18 @@
android:defaultValue="true"
android:widgetLayout="@layout/preference_switch"
android:order="2"/>
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:key="@string/pref_advanced"
android:title="@string/advanced"
android:order="6">
<Preference
android:key="@string/pref_custom_map_download_url"
android:title="@string/download_resources_custom_url_title"
app:icon="@drawable/ic_cloud_download"
android:order="3" />
android:order="1" />
</androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen>