aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/EditWaypointActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/EditWaypointActivity.java')
-rw-r--r--main/src/cgeo/geocaching/EditWaypointActivity.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/EditWaypointActivity.java b/main/src/cgeo/geocaching/EditWaypointActivity.java
index 55de0a6..0eeb0d7 100644
--- a/main/src/cgeo/geocaching/EditWaypointActivity.java
+++ b/main/src/cgeo/geocaching/EditWaypointActivity.java
@@ -1,6 +1,6 @@
package cgeo.geocaching;
-import cgeo.geocaching.activity.AbstractActivity;
+import cgeo.geocaching.activity.AbstractActionBarActivity;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.connector.IConnector;
import cgeo.geocaching.enumerations.CacheType;
@@ -48,7 +48,7 @@ import java.util.EnumSet;
import java.util.List;
@EActivity
-public class EditWaypointActivity extends AbstractActivity {
+public class EditWaypointActivity extends AbstractActionBarActivity implements CoordinatesInputDialog.CoordinateUpdate {
private static final ArrayList<WaypointType> POSSIBLE_WAYPOINT_TYPES = new ArrayList<WaypointType>(WaypointType.ALL_TYPES_EXCEPT_OWN_AND_ORIGINAL);
@ViewById(R.id.buttonLatitude) protected Button buttonLat;
@@ -294,17 +294,18 @@ public class EditWaypointActivity extends AbstractActivity {
// button text is blank when creating new waypoint
}
Geocache cache = DataStore.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS);
- CoordinatesInputDialog coordsDialog = new CoordinatesInputDialog(EditWaypointActivity.this, cache, gp, app.currentGeo());
+ CoordinatesInputDialog coordsDialog = CoordinatesInputDialog.getInstance(cache, gp, app.currentGeo());
coordsDialog.setCancelable(true);
- coordsDialog.setOnCoordinateUpdate(new CoordinatesInputDialog.CoordinateUpdate() {
- @Override
- public void update(final Geopoint gp) {
- buttonLat.setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE));
- buttonLon.setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE));
- }
- });
- coordsDialog.show();
+ coordsDialog.show(getSupportFragmentManager(),"wpeditdialog");
}
+
+
+ }
+
+ @Override
+ public void updateCoordinates(Geopoint gp) {
+ buttonLat.setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE));
+ buttonLon.setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE));
}
public static final int SUCCESS = 0;
@@ -442,7 +443,7 @@ public class EditWaypointActivity extends AbstractActivity {
if (!StaticMapsProvider.hasAllStaticMapsForWaypoint(geocode, waypoint)) {
StaticMapsProvider.removeWpStaticMaps(oldWaypoint, geocode);
if (Settings.isStoreOfflineWpMaps()) {
- StaticMapsProvider.storeWaypointStaticMap(cache, waypoint, false);
+ StaticMapsProvider.storeWaypointStaticMap(cache, waypoint).subscribe();
}
}
if (modifyLocal.isChecked() || modifyBoth.isChecked()) {