|
|
@ -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 {
|
|
|
|