Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/src/main/java/org/nitri/opentopo/MapFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ class MapFragment : Fragment(), LocationListener, PopupMenu.OnMenuItemClickListe
val gpxVisible = gpxDisplayState != GpxDisplayState.IDLE
menu.findItem(R.id.action_gpx_details).isVisible = gpxVisible
menu.findItem(R.id.action_gpx_zoom).isVisible = gpxVisible
menu.findItem(R.id.action_gpx_remove).isVisible = gpxVisible

listener?.let {
menu.findItem(R.id.action_privacy_settings).isVisible = it.isPrivacyOptionsRequired()
Expand Down Expand Up @@ -956,6 +957,15 @@ class MapFragment : Fragment(), LocationListener, PopupMenu.OnMenuItemClickListe
listener?.let { zoomToBounds(Utils.area(it.getGpx())) }
return true
}
R.id.action_gpx_remove -> {
showGpxDialog {
markerViewModel.markers.value?.forEach {
it.routeWaypoint = false
}
listener?.clearGpx()
}
return true
}
R.id.action_layers -> {
activity?.let {
val anchorView = it.findViewById<View>(R.id.popupAnchorView)
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_action_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
~ Copyright (C) 2026 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">

<path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>

</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
android:title="@string/gpx_zoom"
android:visible="false"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_gpx_remove"
android:icon="@drawable/ic_action_delete"
android:title="@string/gpx_remove"
android:visible="false"
app:showAsAction="never" />
<item
android:id="@+id/action_layers"
android:icon="@drawable/ic_action_layers"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="discard_current_gpx">Die aktuelle GPX wird verworfen.</string>
<string name="gpx_details">GPX Details</string>
<string name="gpx_zoom">Zoom zu GPX</string>
<string name="gpx_remove">GPX entfernen</string>

<string name="location_details">Standortdetails</string>
<string name="label_latitude">Breitengrad:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="discard_current_gpx">El GPX actual será descartado.</string>
<string name="gpx_details">Detalles del GPX</string>
<string name="gpx_zoom">Zoom al GPX</string>
<string name="gpx_remove">Eliminar GPX</string>

<string name="location_details">Detalle de la ubicación</string>
<string name="label_latitude">Latitud:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="discard_current_gpx">Le GPX actuel sera supprimé.</string>
<string name="gpx_details">Détails du GPX</string>
<string name="gpx_zoom">Zoom sur le GPX</string>
<string name="gpx_remove">Supprimer le GPX</string>

<string name="location_details">Détail de la position</string>
<string name="label_latitude">Latitude :</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="discard_current_gpx">Il GPX caricato verrà sostituito</string>
<string name="gpx_details">Dettagli GPX</string>
<string name="gpx_zoom">Centra GPX</string>
<string name="gpx_remove">Rimuovi GPX</string>

<string name="location_details">Dettagli posizione</string>
<string name="label_latitude">Latitudine:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="discard_current_gpx">De huidige GPX wordt verwijderd.</string>
<string name="gpx_details">GPX details</string>
<string name="gpx_zoom">Zoom naar GPX</string>
<string name="gpx_remove">GPX verwijderen</string>

<string name="location_details">Locatie-detail</string>
<string name="label_latitude">Breedtegraad:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<string name="discard_current_gpx">The current GPX will be discarded.</string>
<string name="gpx_details">GPX details</string>
<string name="gpx_zoom">Zoom to GPX</string>
<string name="gpx_remove">Remove GPX</string>

<string name="location_details">Location detail</string>
<string name="label_latitude">Latitude:</string>
Expand Down
Loading