diff --git a/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java b/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java index 688483e..32d399d 100644 --- a/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java +++ b/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java @@ -212,6 +212,7 @@ foundLocations = new ArrayList<>(); currentPosition = new Marker(mapView); + currentPosition.setInfoWindow(new ModernInfoWindow(mapView)); currentPosition.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER); currentPosition.setTitle(getString(R.string.osm_marker_title)); currentPosition.setIcon(res.getDrawable(R.drawable.ic_currency_96, null)); diff --git a/app/src/main/java/de/apps4ics/mountainnavigation/ModernInfoWindow.java b/app/src/main/java/de/apps4ics/mountainnavigation/ModernInfoWindow.java new file mode 100644 index 0000000..a8f73d9 --- /dev/null +++ b/app/src/main/java/de/apps4ics/mountainnavigation/ModernInfoWindow.java @@ -0,0 +1,41 @@ +/** + * This file is part of MountainNavigation. + * + * MountainNavigation is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MountainNavigation is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MountainNavigation. If not, see . + * + * @copyright Copyright (c) 2016 Vinzenz Rosenkanz + * + * @author Vinzenz Rosenkranz + */ + +package de.apps4ics.mountainnavigation; + +import android.view.View; +import android.widget.Button; + +import org.osmdroid.bonuspack.overlays.MarkerInfoWindow; +import org.osmdroid.views.MapView; + +public class ModernInfoWindow extends MarkerInfoWindow { + public ModernInfoWindow(final MapView mapView) { + super(R.layout.overlay_custom_bubble, mapView); + Button editBtn = (Button) mView.findViewById(R.id.edit_poi_btn); + editBtn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + MainActivity.Toaster("Edit!", v.getContext()); + } + }); + } +} diff --git a/app/src/main/res/drawable-hdpi/ic_map_editing_96.png b/app/src/main/res/drawable-hdpi/ic_map_editing_96.png new file mode 100644 index 0000000..e273928 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/ic_map_editing_96.png Binary files differ diff --git a/app/src/main/res/drawable-mdpi/ic_map_editing_96.png b/app/src/main/res/drawable-mdpi/ic_map_editing_96.png new file mode 100644 index 0000000..95f3f96 --- /dev/null +++ b/app/src/main/res/drawable-mdpi/ic_map_editing_96.png Binary files differ diff --git a/app/src/main/res/drawable-xhdpi/ic_map_editing_96.png b/app/src/main/res/drawable-xhdpi/ic_map_editing_96.png new file mode 100644 index 0000000..d329421 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/ic_map_editing_96.png Binary files differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_map_editing_96.png b/app/src/main/res/drawable-xxhdpi/ic_map_editing_96.png new file mode 100644 index 0000000..0be6a87 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/ic_map_editing_96.png Binary files differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_map_editing_96.png b/app/src/main/res/drawable-xxxhdpi/ic_map_editing_96.png new file mode 100644 index 0000000..1b1b887 --- /dev/null +++ b/app/src/main/res/drawable-xxxhdpi/ic_map_editing_96.png Binary files differ diff --git a/app/src/main/res/layout/overlay_custom_bubble.xml b/app/src/main/res/layout/overlay_custom_bubble.xml new file mode 100644 index 0000000..d11fb8c --- /dev/null +++ b/app/src/main/res/layout/overlay_custom_bubble.xml @@ -0,0 +1,73 @@ + + + + + + + +