Skip to content

Commit 89bd913

Browse files
committed
Add Top-O-Map donation link
1 parent c6a839c commit 89bd913

8 files changed

Lines changed: 30 additions & 8 deletions

File tree

‎app/src/main/java/org/nitri/opentopo/SettingsActivity.kt‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,20 @@ class SettingsActivity : AppCompatActivity() {
131131
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
132132
setPreferencesFromResource(R.xml.preferences, rootKey)
133133

134-
findPreference<Preference>("support_openmaps")?.apply {
135-
isVisible = BuildConfig.SHOW_DONATE_LINK
136-
setOnPreferenceClickListener {
137-
try {
138-
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://openmaps.fr/donate")))
139-
} catch (_: ActivityNotFoundException) {
140-
Toast.makeText(requireContext(), R.string.no_browser_found, Toast.LENGTH_SHORT).show()
134+
mapOf(
135+
"support_openmaps" to "https://openmaps.fr/donate",
136+
"support_top_o_map" to "https://ko-fi.com/topomap"
137+
).forEach { (key, url) ->
138+
findPreference<Preference>(key)?.apply {
139+
isVisible = BuildConfig.SHOW_DONATE_LINK
140+
setOnPreferenceClickListener {
141+
try {
142+
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
143+
} catch (_: ActivityNotFoundException) {
144+
Toast.makeText(requireContext(), R.string.no_browser_found, Toast.LENGTH_SHORT).show()
145+
}
146+
true
141147
}
142-
true
143148
}
144149
}
145150

‎app/src/main/res/values-de/strings.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,7 @@ Dies kann nicht rückgängig gemacht werden.</string>
177177
<string name="retry">Wiederholen</string>
178178
<string name="support_openmaps">openmaps.fr unterstützen</string>
179179
<string name="support_openmaps_summary">Hilf mit, das Hosting von OpenTopoMap-R zu finanzieren.</string>
180+
<string name="support_top_o_map">Top-O-Map unterstützen</string>
181+
<string name="support_top_o_map_summary">Hilf mit, das Hosting von Top-O-Map zu finanzieren.</string>
180182
<string name="otm_source_migration_notice">Deine OpenTopoMap-Kachelquelle wurde auf Wunsch des Anbieters auf den offiziellen Server umgestellt. OpenTopoMap-R bleibt in den Einstellungen verfügbar.</string>
181183
</resources>

‎app/src/main/res/values-es/strings.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,7 @@ Esto no se puede deshacer.</string>
177177
<string name="retry">Reintentar</string>
178178
<string name="support_openmaps">Apoyar a openmaps.fr</string>
179179
<string name="support_openmaps_summary">Ayuda a financiar el alojamiento de OpenTopoMap-R.</string>
180+
<string name="support_top_o_map">Apoyar a Top-O-Map</string>
181+
<string name="support_top_o_map_summary">Ayuda a financiar el alojamiento de Top-O-Map.</string>
180182
<string name="otm_source_migration_notice">Tu fuente de teselas de OpenTopoMap se ha cambiado al servidor oficial a petición del proveedor. OpenTopoMap-R sigue disponible en Ajustes.</string>
181183
</resources>

‎app/src/main/res/values-fr/strings.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,7 @@ Cette action est irréversible.</string>
177177
<string name="retry">Réessayer</string>
178178
<string name="support_openmaps">Soutenir openmaps.fr</string>
179179
<string name="support_openmaps_summary">Aidez à financer l’hébergement d’OpenTopoMap-R.</string>
180+
<string name="support_top_o_map">Soutenir Top-O-Map</string>
181+
<string name="support_top_o_map_summary">Aidez à financer l’hébergement de Top-O-Map.</string>
180182
<string name="otm_source_migration_notice">Votre source de tuiles OpenTopoMap a été remplacée par le serveur officiel à la demande du fournisseur. OpenTopoMap-R reste disponible dans les paramètres.</string>
181183
</resources>

‎app/src/main/res/values-it/strings.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,7 @@ L\'azione è irreversibile.</string>
177177
<string name="retry">Riprova</string>
178178
<string name="support_openmaps">Sostieni openmaps.fr</string>
179179
<string name="support_openmaps_summary">Aiuta a finanziare l’hosting di OpenTopoMap-R.</string>
180+
<string name="support_top_o_map">Sostieni Top-O-Map</string>
181+
<string name="support_top_o_map_summary">Aiuta a finanziare l’hosting di Top-O-Map.</string>
180182
<string name="otm_source_migration_notice">La sorgente delle tessere OpenTopoMap è stata spostata sul server ufficiale su richiesta del fornitore. OpenTopoMap-R rimane disponibile nelle impostazioni.</string>
181183
</resources>

‎app/src/main/res/values-nl/strings.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,7 @@ Dit kan niet ongedaan worden gemaakt.</string>
177177
<string name="retry">Opnieuw proberen</string>
178178
<string name="support_openmaps">Steun openmaps.fr</string>
179179
<string name="support_openmaps_summary">Help de hosting van OpenTopoMap-R te financieren.</string>
180+
<string name="support_top_o_map">Steun Top-O-Map</string>
181+
<string name="support_top_o_map_summary">Help de hosting van Top-O-Map te financieren.</string>
180182
<string name="otm_source_migration_notice">Je OpenTopoMap-tegelbron is op verzoek van de aanbieder gewijzigd naar de officiële server. OpenTopoMap-R blijft beschikbaar in Instellingen.</string>
181183
</resources>

‎app/src/main/res/values/strings.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,7 @@ This cannot be undone.</string>
190190

191191
<string name="support_openmaps">Support openmaps.fr</string>
192192
<string name="support_openmaps_summary">Help fund OpenTopoMap-R hosting.</string>
193+
<string name="support_top_o_map">Support Top-O-Map</string>
194+
<string name="support_top_o_map_summary">Help fund Top-O-Map hosting.</string>
193195
<string name="otm_source_migration_notice">Your OpenTopoMap tile source has been switched to the official server at the provider’s request. OpenTopoMap-R remains available in Settings.</string>
194196
</resources>

‎app/src/main/res/xml/preferences.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
app:title="@string/support_openmaps"
3838
app:summary="@string/support_openmaps_summary" />
3939

40+
<Preference
41+
app:key="support_top_o_map"
42+
app:title="@string/support_top_o_map"
43+
app:summary="@string/support_top_o_map_summary" />
44+
4045
</PreferenceCategory>
4146

4247
<PreferenceCategory app:title="@string/pref_markers_header">

0 commit comments

Comments
 (0)