Revert "Fix first start screen after permission"

This reverts commit 4bd5b46e20.
This commit is contained in:
Alexey Kulish 2016-03-24 16:45:09 +03:00
parent 4bd5b46e20
commit e98835d617
2 changed files with 1 additions and 27 deletions

View file

@ -83,7 +83,6 @@ public class AppInitializer implements IProgress {
private static final String VECTOR_INDEXES_CHECK = "VECTOR_INDEXES_CHECK"; //$NON-NLS-1$ private static final String VECTOR_INDEXES_CHECK = "VECTOR_INDEXES_CHECK"; //$NON-NLS-1$
private static final String VERSION_INSTALLED = "VERSION_INSTALLED"; //$NON-NLS-1$ private static final String VERSION_INSTALLED = "VERSION_INSTALLED"; //$NON-NLS-1$
private static final String EXCEPTION_FILE_SIZE = "EXCEPTION_FS"; //$NON-NLS-1$ private static final String EXCEPTION_FILE_SIZE = "EXCEPTION_FS"; //$NON-NLS-1$
public static final String FIRST_USAGE_FRAGMENT_DONE = "FIRST_USAGE_FRAGMENT_DONE"; //$NON-NLS-1$
public static final String LATEST_CHANGES_URL = "http://osmand.net/blog?id=osmand-2-3-released"; public static final String LATEST_CHANGES_URL = "http://osmand.net/blog?id=osmand-2-3-released";
// public static final String LATEST_CHANGES_URL = null; // not enough to read // public static final String LATEST_CHANGES_URL = null; // not enough to read
@ -94,7 +93,6 @@ public class AppInitializer implements IProgress {
private boolean initSettings = false; private boolean initSettings = false;
private boolean firstTime; private boolean firstTime;
private boolean firstUsageFragmentDone;
private boolean activityChangesShowed = false; private boolean activityChangesShowed = false;
private boolean appVersionChanged; private boolean appVersionChanged;
private int prevAppVersion; private int prevAppVersion;
@ -170,7 +168,6 @@ public class AppInitializer implements IProgress {
startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit(); startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit();
appVersionChanged = true; appVersionChanged = true;
} }
firstUsageFragmentDone = startPrefs.contains(FIRST_USAGE_FRAGMENT_DONE);
initSettings = true; initSettings = true;
} }
@ -191,28 +188,9 @@ public class AppInitializer implements IProgress {
public void resetFirstTimeRun() { public void resetFirstTimeRun() {
if(startPrefs != null) { if(startPrefs != null) {
startPrefs.edit().remove(FIRST_TIME_APP_RUN).commit(); startPrefs.edit().remove(FIRST_TIME_APP_RUN).commit();
resetFirstUsageFragmentDone();
} }
} }
public void setFirstUsageFragmentDone() {
if(startPrefs != null) {
startPrefs.edit().putBoolean(FIRST_USAGE_FRAGMENT_DONE, true).commit();
firstUsageFragmentDone = true;
}
}
public void resetFirstUsageFragmentDone() {
if(startPrefs != null) {
startPrefs.edit().remove(FIRST_USAGE_FRAGMENT_DONE).commit();
firstUsageFragmentDone = false;
}
}
public boolean isFirstUsageFragmentDone() {
return firstUsageFragmentDone;
}
public boolean isFirstTime() { public boolean isFirstTime() {
initVariables(); initVariables();
return firstTime; return firstTime;

View file

@ -289,12 +289,11 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents,
} }
mapView.refreshMap(true); mapView.refreshMap(true);
if (!getMyApplication().getAppInitializer().isFirstUsageFragmentDone() && FirstUsageFragment.SHOW) { if (getMyApplication().getAppInitializer().isFirstTime() && FirstUsageFragment.SHOW) {
FirstUsageFragment.SHOW = false; FirstUsageFragment.SHOW = false;
getSupportFragmentManager().beginTransaction() getSupportFragmentManager().beginTransaction()
.add(R.id.fragmentContainer, new FirstUsageFragment(), .add(R.id.fragmentContainer, new FirstUsageFragment(),
FirstUsageFragment.TAG).commit(); FirstUsageFragment.TAG).commit();
app.getAppInitializer().setFirstUsageFragmentDone();
} }
mapActions.updateDrawerMenu(); mapActions.updateDrawerMenu();
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
@ -617,9 +616,6 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents,
} }
} else { } else {
if (permissionGranted) { if (permissionGranted) {
if (app.getAppInitializer().isFirstTime()) {
app.getAppInitializer().resetFirstUsageFragmentDone();
}
restartApp(); restartApp();
} else if (getSupportFragmentManager().findFragmentByTag(DataStoragePlaceDialogFragment.TAG) == null) { } else if (getSupportFragmentManager().findFragmentByTag(DataStoragePlaceDialogFragment.TAG) == null) {
DataStoragePlaceDialogFragment.showInstance(getSupportFragmentManager(), true); DataStoragePlaceDialogFragment.showInstance(getSupportFragmentManager(), true);