Skip to content

Commit

Permalink
Merge branch 'always_record_imagery'
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Nov 28, 2024
2 parents 414efd8 + 28b503f commit 6e7c8ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/de/blau/android/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,9 @@ public float strokeWidth(long width) {
*/
public void createCheckpoint(@Nullable Activity activity, int stringId) {
Resources r = activity != null ? activity.getResources() : App.resources();
boolean firstCheckpoint = !getDelegator().getUndo().canUndo();
getDelegator().getUndo().createCheckpoint(r.getString(stringId));
final UndoStorage undo = getDelegator().getUndo();
boolean firstCheckpoint = !undo.canUndo();
undo.createCheckpoint(r.getString(stringId));
getDelegator().recordImagery(map);
if (firstCheckpoint && activity instanceof AppCompatActivity) {
((AppCompatActivity) activity).invalidateOptionsMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ private void moveOuterTags(@NonNull Map<String, String> tags) {
if (!tags.isEmpty()) {
AlertDialog alertDialog = new AlertDialog.Builder(main).setTitle(R.string.move_outer_tags_title).setMessage(R.string.move_outer_tags_message)
.setPositiveButton(R.string.move, (dialog, which) -> {
logic.getUndo().createCheckpoint(main.getString(R.string.undo_action_move_tags));
logic.createCheckpoint(main, R.string.undo_action_move_tags);
RelationUtils.moveOuterTags(App.getDelegator(), relation);
}).setNeutralButton(R.string.leave_as_is, null).create();
alertDialog.setOnDismissListener(dialog -> finishMode.run());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/de/blau/android/osm/MergeAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ public List<Result> mergeSimplePolygons(@NonNull de.blau.android.Map map) throws
try {
delegator.lock();
delegator.getUndo().createCheckpoint(map.getContext().getString(R.string.undo_action_move_tags));
delegator.recordImagery(map);
} finally {
delegator.unlock();
}
Expand Down

0 comments on commit 6e7c8ea

Please sign in to comment.