Skip to content

Commit 999f9ac

Browse files
committed
Move support links to own section
1 parent 89bd913 commit 999f9ac

8 files changed

Lines changed: 25 additions & 11 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import androidx.lifecycle.lifecycleScope
5151
import androidx.lifecycle.setViewTreeLifecycleOwner
5252
import androidx.lifecycle.setViewTreeViewModelStoreOwner
5353
import androidx.preference.Preference
54+
import androidx.preference.PreferenceCategory
5455
import androidx.preference.PreferenceFragmentCompat
5556
import androidx.preference.PreferenceManager
5657
import androidx.savedstate.setViewTreeSavedStateRegistryOwner
@@ -131,12 +132,14 @@ class SettingsActivity : AppCompatActivity() {
131132
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
132133
setPreferencesFromResource(R.xml.preferences, rootKey)
133134

135+
findPreference<PreferenceCategory>("support_map_providers")?.isVisible =
136+
BuildConfig.SHOW_DONATE_LINK
137+
134138
mapOf(
135139
"support_openmaps" to "https://openmaps.fr/donate",
136140
"support_top_o_map" to "https://ko-fi.com/topomap"
137141
).forEach { (key, url) ->
138142
findPreference<Preference>(key)?.apply {
139-
isVisible = BuildConfig.SHOW_DONATE_LINK
140143
setOnPreferenceClickListener {
141144
try {
142145
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Dies kann nicht rückgängig gemacht werden.</string>
175175
<string name="unable_to_search_places">Orte konnten nicht gesucht werden</string>
176176
<string name="unable_to_calculate_route">Route konnte nicht berechnet werden</string>
177177
<string name="retry">Wiederholen</string>
178+
<string name="support_map_providers">Kartenanbieter unterstützen</string>
178179
<string name="support_openmaps">openmaps.fr unterstützen</string>
179180
<string name="support_openmaps_summary">Hilf mit, das Hosting von OpenTopoMap-R zu finanzieren.</string>
180181
<string name="support_top_o_map">Top-O-Map unterstützen</string>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Esto no se puede deshacer.</string>
175175
<string name="unable_to_search_places">No se pudieron buscar lugares</string>
176176
<string name="unable_to_calculate_route">No se pudo calcular la ruta</string>
177177
<string name="retry">Reintentar</string>
178+
<string name="support_map_providers">Apoyar a los proveedores de mapas</string>
178179
<string name="support_openmaps">Apoyar a openmaps.fr</string>
179180
<string name="support_openmaps_summary">Ayuda a financiar el alojamiento de OpenTopoMap-R.</string>
180181
<string name="support_top_o_map">Apoyar a Top-O-Map</string>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Cette action est irréversible.</string>
175175
<string name="unable_to_search_places">Impossible de rechercher des lieux</string>
176176
<string name="unable_to_calculate_route">Impossible de calculer l\'itinéraire</string>
177177
<string name="retry">Réessayer</string>
178+
<string name="support_map_providers">Soutenir les fournisseurs de cartes</string>
178179
<string name="support_openmaps">Soutenir openmaps.fr</string>
179180
<string name="support_openmaps_summary">Aidez à financer l’hébergement d’OpenTopoMap-R.</string>
180181
<string name="support_top_o_map">Soutenir Top-O-Map</string>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ L\'azione è irreversibile.</string>
175175
<string name="unable_to_search_places">Impossibile cercare i luoghi</string>
176176
<string name="unable_to_calculate_route">Impossibile calcolare il percorso</string>
177177
<string name="retry">Riprova</string>
178+
<string name="support_map_providers">Sostieni i fornitori di mappe</string>
178179
<string name="support_openmaps">Sostieni openmaps.fr</string>
179180
<string name="support_openmaps_summary">Aiuta a finanziare l’hosting di OpenTopoMap-R.</string>
180181
<string name="support_top_o_map">Sostieni Top-O-Map</string>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Dit kan niet ongedaan worden gemaakt.</string>
175175
<string name="unable_to_search_places">Kan geen plaatsen zoeken</string>
176176
<string name="unable_to_calculate_route">Kan route niet berekenen</string>
177177
<string name="retry">Opnieuw proberen</string>
178+
<string name="support_map_providers">Steun kaartaanbieders</string>
178179
<string name="support_openmaps">Steun openmaps.fr</string>
179180
<string name="support_openmaps_summary">Help de hosting van OpenTopoMap-R te financieren.</string>
180181
<string name="support_top_o_map">Steun Top-O-Map</string>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ This cannot be undone.</string>
188188
<string name="unable_to_calculate_route">Unable to calculate route</string>
189189
<string name="retry">Retry</string>
190190

191+
<string name="support_map_providers">Support map providers</string>
191192
<string name="support_openmaps">Support openmaps.fr</string>
192193
<string name="support_openmaps_summary">Help fund OpenTopoMap-R hosting.</string>
193194
<string name="support_top_o_map">Support Top-O-Map</string>

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@
3232
app:defaultValue="opentopomap"
3333
app:useSimpleSummaryProvider="true" />
3434

35-
<Preference
36-
app:key="support_openmaps"
37-
app:title="@string/support_openmaps"
38-
app:summary="@string/support_openmaps_summary" />
39-
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-
4535
</PreferenceCategory>
4636

4737
<PreferenceCategory app:title="@string/pref_markers_header">
@@ -117,4 +107,19 @@
117107
android:visible="false" />
118108
</PreferenceCategory>
119109

110+
<PreferenceCategory
111+
app:key="support_map_providers"
112+
app:title="@string/support_map_providers">
113+
114+
<Preference
115+
app:key="support_openmaps"
116+
app:title="@string/support_openmaps"
117+
app:summary="@string/support_openmaps_summary" />
118+
119+
<Preference
120+
app:key="support_top_o_map"
121+
app:title="@string/support_top_o_map"
122+
app:summary="@string/support_top_o_map_summary" />
123+
</PreferenceCategory>
124+
120125
</PreferenceScreen>

0 commit comments

Comments
 (0)