Only new users see the welcome login and graphic

pull/14/head
Sam Bosley 13 years ago
parent 7c364a4ff7
commit e3ef6cde30

@ -30,6 +30,8 @@ import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gtasks.GtasksPreferenceService; import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.notes.NoteMetadata; import com.todoroo.astrid.notes.NoteMetadata;
import com.todoroo.astrid.producteev.sync.ProducteevDataService; import com.todoroo.astrid.producteev.sync.ProducteevDataService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABOptions;
import com.todoroo.astrid.tags.TagCaseMigrator; import com.todoroo.astrid.tags.TagCaseMigrator;
import com.todoroo.astrid.utility.AstridPreferences; import com.todoroo.astrid.utility.AstridPreferences;
@ -69,6 +71,8 @@ public final class UpgradeService {
@Autowired GtasksPreferenceService gtasksPreferenceService; @Autowired GtasksPreferenceService gtasksPreferenceService;
@Autowired ABChooser abChooser;
public UpgradeService() { public UpgradeService() {
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
} }
@ -111,9 +115,10 @@ public final class UpgradeService {
if(from < V3_1_0) if(from < V3_1_0)
new Astrid2To3UpgradeHelper().upgrade3To3_1(context, from); new Astrid2To3UpgradeHelper().upgrade3To3_1(context, from);
if (from <= V3_8_3_1) if (from <= V3_8_3_1) {
new TagCaseMigrator().performTagCaseMigration(); new TagCaseMigrator().performTagCaseMigration();
abChooser.setChoiceForOption(ABOptions.AB_OPTION_FIRST_ACTIVITY, 0);
}
} finally { } finally {
DialogUtilities.dismissDialog((Activity)context, dialog); DialogUtilities.dismissDialog((Activity)context, dialog);
} }

@ -9,7 +9,6 @@ import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager; import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.activity.FilterListActivity; import com.todoroo.astrid.activity.FilterListActivity;
import com.todoroo.astrid.activity.TaskListActivity; import com.todoroo.astrid.activity.TaskListActivity;
import com.todoroo.astrid.service.AstridDependencyInjector; import com.todoroo.astrid.service.AstridDependencyInjector;
@ -21,7 +20,7 @@ import com.todoroo.astrid.utility.AstridPreferences;
public class SplashScreenLauncher extends Activity { public class SplashScreenLauncher extends Activity {
private boolean shouldGoThroughWelcome = false; private boolean isNewUser = false;
private int latestSetVersion = 0; private int latestSetVersion = 0;
@Autowired ABChooser abChooser; @Autowired ABChooser abChooser;
@ -37,9 +36,9 @@ public class SplashScreenLauncher extends Activity {
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
setContentView(R.layout.splash_screen_launcher); setContentView(R.layout.splash_screen_launcher);
latestSetVersion = AstridPreferences.getCurrentVersion(); latestSetVersion = AstridPreferences.getCurrentVersion();
shouldGoThroughWelcome = ((latestSetVersion == 0) || !Preferences.getBoolean(WelcomeLogin.KEY_SHOWED_WELCOME_LOGIN, false)); isNewUser = (latestSetVersion == 0);
ContextManager.setContext(this); ContextManager.setContext(this);
if (latestSetVersion == 0) { if (isNewUser) {
new Thread() { new Thread() {
@Override @Override
public void run() { public void run() {
@ -47,20 +46,23 @@ public class SplashScreenLauncher extends Activity {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
new StartupService().onStartupApplication(SplashScreenLauncher.this); startupServiceAndFinish();
finishAndShowNext();
} }
}); });
} }
}.start(); }.start();
} else { } else {
startupServiceAndFinish();
}
}
private void startupServiceAndFinish() {
new StartupService().onStartupApplication(this); new StartupService().onStartupApplication(this);
finishAndShowNext(); finishAndShowNext();
} }
}
private void finishAndShowNext() { private void finishAndShowNext() {
if (shouldGoThroughWelcome) { if (isNewUser) {
int welcomeLoginChoice = abChooser.getChoiceForOption(ABOptions.AB_OPTION_WELCOME_LOGIN); int welcomeLoginChoice = abChooser.getChoiceForOption(ABOptions.AB_OPTION_WELCOME_LOGIN);
welcomeLoginPath(welcomeLoginChoice); welcomeLoginPath(welcomeLoginChoice);
} else { } else {

Loading…
Cancel
Save