mirror of https://github.com/tasks/tasks
Killed welcome graphic
parent
943e9b6219
commit
8476e387fb
@ -1,64 +0,0 @@
|
|||||||
package com.todoroo.astrid.welcome;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Window;
|
|
||||||
|
|
||||||
import com.timsu.astrid.R;
|
|
||||||
import com.todoroo.andlib.service.Autowired;
|
|
||||||
import com.todoroo.andlib.service.ContextManager;
|
|
||||||
import com.todoroo.andlib.service.DependencyInjectionService;
|
|
||||||
import com.todoroo.astrid.activity.TaskListActivity;
|
|
||||||
import com.todoroo.astrid.service.AstridDependencyInjector;
|
|
||||||
import com.todoroo.astrid.service.StartupService;
|
|
||||||
import com.todoroo.astrid.service.StatisticsService;
|
|
||||||
import com.todoroo.astrid.service.abtesting.ABChooser;
|
|
||||||
import com.todoroo.astrid.utility.AstridPreferences;
|
|
||||||
|
|
||||||
public class SplashScreenLauncher extends Activity {
|
|
||||||
|
|
||||||
@Autowired ABChooser abChooser;
|
|
||||||
|
|
||||||
static {
|
|
||||||
AstridDependencyInjector.initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
DependencyInjectionService.getInstance().inject(this);
|
|
||||||
setContentView(R.layout.splash_screen_launcher);
|
|
||||||
int latestSetVersion = AstridPreferences.getCurrentVersion();
|
|
||||||
boolean isNewUser = (latestSetVersion == 0);
|
|
||||||
ContextManager.setContext(this);
|
|
||||||
new StartupService().onStartupApplication(this);
|
|
||||||
StatisticsService.sessionStart(this);
|
|
||||||
finishAndShowNext(isNewUser);
|
|
||||||
StatisticsService.sessionStop(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void finishAndShowNext(boolean isNewUser) {
|
|
||||||
if (isNewUser) {
|
|
||||||
welcomeLoginPath();
|
|
||||||
} else {
|
|
||||||
mainActivityPath();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void welcomeLoginPath() {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.setClass(this, WelcomeLogin.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void mainActivityPath() {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.setClass(this, TaskListActivity.class); // Go to task list activity
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
package com.todoroo.astrid.welcome;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import com.timsu.astrid.R;
|
|
||||||
import com.todoroo.andlib.service.Autowired;
|
|
||||||
import com.todoroo.andlib.service.ContextManager;
|
|
||||||
import com.todoroo.andlib.service.DependencyInjectionService;
|
|
||||||
import com.todoroo.andlib.utility.AndroidUtilities;
|
|
||||||
import com.todoroo.astrid.actfm.sync.ActFmSyncProvider;
|
|
||||||
import com.todoroo.astrid.activity.Eula;
|
|
||||||
import com.todoroo.astrid.activity.TaskListActivity;
|
|
||||||
import com.todoroo.astrid.service.StartupService;
|
|
||||||
import com.todoroo.astrid.service.StatisticsService;
|
|
||||||
import com.todoroo.astrid.service.abtesting.ABChooser;
|
|
||||||
|
|
||||||
public class WelcomeGraphic extends Activity {
|
|
||||||
|
|
||||||
public static final String KEY_SHOW_EULA = "show_eula"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
public static final String START_SYNC = "start_sync"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
@Autowired ABChooser abChooser;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
ContextManager.setContext(this);
|
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
DependencyInjectionService.getInstance().inject(this);
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
new StartupService().onStartupApplication(this);
|
|
||||||
setContentView(R.layout.welcome_screen);
|
|
||||||
|
|
||||||
if (getIntent().getBooleanExtra(KEY_SHOW_EULA, false))
|
|
||||||
Eula.showEula(this);
|
|
||||||
|
|
||||||
|
|
||||||
final ImageView image = (ImageView)findViewById(R.id.welcome_image);
|
|
||||||
image.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
image.setOnClickListener(null); // Prevent double click
|
|
||||||
new Thread() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
AndroidUtilities.sleepDeep(1000L);
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
finishAndStartNext();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (getIntent().getBooleanExtra(START_SYNC, false))
|
|
||||||
new ActFmSyncProvider().synchronize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPause() {
|
|
||||||
StatisticsService.sessionPause();
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
StatisticsService.sessionStart(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
StatisticsService.sessionStop(this);
|
|
||||||
super.onStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void finishAndStartNext() {
|
|
||||||
Intent nextActivity = getNextIntent();
|
|
||||||
startActivity(nextActivity);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
private Intent getNextIntent() {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.setClass(this, TaskListActivity.class);
|
|
||||||
return intent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue