Skip to content

Commit

Permalink
Inform users about the bug in a one-time startup message (#849)
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/de/westnordost/streetcomplete/MainActivity.java
  • Loading branch information
westnordost committed Feb 10, 2018
1 parent b00e12f commit 7b371f4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions app/src/main/java/de/westnordost/streetcomplete/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -206,8 +207,11 @@ public void onServiceDisconnected(ComponentName className)
{
super.onStart();

showUndoFuckupDescriptionOnce();

answersCounter.update();


registerReceiver(locationAvailabilityReceiver, LocationUtil.createLocationAvailabilityIntentFilter());

LocalBroadcastManager localBroadcaster = LocalBroadcastManager.getInstance(this);
Expand All @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/de/westnordost/streetcomplete/Prefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b371f4

Please sign in to comment.