diff --git a/app/src/main/java/de/westnordost/streetcomplete/MainActivity.java b/app/src/main/java/de/westnordost/streetcomplete/MainActivity.java index 4be89aaeeb..bb1f043791 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/MainActivity.java +++ b/app/src/main/java/de/westnordost/streetcomplete/MainActivity.java @@ -2,6 +2,7 @@ import android.animation.ObjectAnimator; import android.support.v4.app.FragmentManager; +import android.net.Uri; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; @@ -206,8 +207,11 @@ public void onServiceDisconnected(ComponentName className) { super.onStart(); + showUndoFuckupDescriptionOnce(); + answersCounter.update(); + registerReceiver(locationAvailabilityReceiver, LocationUtil.createLocationAvailabilityIntentFilter()); LocalBroadcastManager localBroadcaster = LocalBroadcastManager.getInstance(this); @@ -234,6 +238,33 @@ public void onServiceDisconnected(ComponentName className) } } + private void showUndoFuckupDescriptionOnce() + { + boolean hasShown = prefs.getBoolean(Prefs.HAS_SHOWN_UNDO_FUCKUP_WARNING, false); + if(!hasShown) + { + prefs.edit().putBoolean(Prefs.HAS_SHOWN_UNDO_FUCKUP_WARNING, true).apply(); + // only for users which already authenticated (non-new users) + if(prefs.getLong(Prefs.OSM_USER_ID, -1) != -1) + { + new AlertDialogBuilder(this) + .setTitle("Undo feature was broken") + .setMessage("Between Jan 7 and Feb 9 (v3.3 to v4.0-beta1) the undo feature was partly broken: Undoing answers that were already uploaded wasn't actually doing anything! (By default, answers are uploaded immediately.)\n\n" + + "I am terribly sorry about this. It's fixed now, but if you used the app in that period and undid something on your survey, please check that everything is correct!\n\n" + + "If you need assistance, click on \"More info\" or send me an email.") + .setCancelable(false) + .setNeutralButton("More info", (dialog, which) -> + { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, + Uri.parse("https://github.com/westnordost/StreetComplete/issues/852")); + startActivity(browserIntent); + }) + .setPositiveButton("Understood", null) + .show(); + } + } + } + @Override public void onStop() { super.onStop(); diff --git a/app/src/main/java/de/westnordost/streetcomplete/Prefs.java b/app/src/main/java/de/westnordost/streetcomplete/Prefs.java index b4351a775e..3c527a32e0 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/Prefs.java +++ b/app/src/main/java/de/westnordost/streetcomplete/Prefs.java @@ -20,6 +20,8 @@ public class Prefs public static final String QUEST_ORDER = "quests.order"; + public static final String HAS_SHOWN_UNDO_FUCKUP_WARNING = "alert.undo_fuckup_warning"; + public enum Autosync { ON, WIFI, OFF