<commit_before>package foo.fruitfox.evend;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.TimeZone;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Days;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.GridView;
import android.widget.TextView;
import foo.fruitfox.adapters.EventCalendarAdapter;
import foo.fruitfox.data.TalkData;
import foo.fruitfox.data.UserData;
import foo.fruitfox.helpers.DebugHelper;
import foo.fruitfox.helpers.NetworkHelper;
import foo.fruitfox.helpers.StorageHelper;
import foo.fruitfox.tasks.UserDataWebAPITask;
import foo.fruitfox.tasks.UserDataWebAPITask.AsyncResponseListener;

public class WelcomeActivity extends ActionBarActivity implements
		OnItemClickListener, OnCheckedChangeListener, AsyncResponseListener {

	private GridView eventCalendarGrid;
	private CheckBox accommodationCheck;
	private CheckBox pickupCheck;
	private CheckBox talkCheck;

	private EventCalendarAdapter eventCalendarAdapter;

	private Boolean[] eventDays = null;
	private Boolean needsAccommodation = false;
	private Boolean needsPickup = false;
	private Boolean hasTalk = false;

	private String identifier;
	private UserData userData;

	private String startDateString = "2015-05-23";
	private String endDateString = "2015-06-07";

	private String serverURL;

	private ProgressDialog progDialog;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_welcome);

		accommodationCheck = (CheckBox) findViewById(R.id.accommodationCheck);
		pickupCheck = (CheckBox) findViewById(R.id.pickupCheck);
		talkCheck = (CheckBox) findViewById(R.id.talkCheck);
		eventCalendarGrid = (GridView) findViewById(R.id.eventCalendarGrid);

		identifier = StorageHelper.PreferencesHelper.getIdentifier(this);
		userData = StorageHelper.PreferencesHelper
				.getUserData(this, identifier);

		serverURL = getResources().getString(R.string.server_url);

		initializeLayout();

		initializeListeners();

		initalizeAdapter();

		// getEventDaysUpdate();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.welcome, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}<commit_msg>Added a check in the Welcome Activity to see if the user has finalized the registration, if so then we no longer show the Registration Wizard to the user.<commit_after>package foo.fruitfox.evend;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.TimeZone;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Days;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.GridView;
import android.widget.TextView;
import foo.fruitfox.adapters.EventCalendarAdapter;
import foo.fruitfox.data.TalkData;
import foo.fruitfox.data.UserData;
import foo.fruitfox.helpers.DebugHelper;
import foo.fruitfox.helpers.NetworkHelper;
import foo.fruitfox.helpers.StorageHelper;
import foo.fruitfox.tasks.UserDataWebAPITask;
import foo.fruitfox.tasks.UserDataWebAPITask.AsyncResponseListener;

public class WelcomeActivity extends ActionBarActivity implements
		OnItemClickListener, OnCheckedChangeListener, AsyncResponseListener {

	private GridView eventCalendarGrid;
	private CheckBox accommodationCheck;
	private CheckBox pickupCheck;
	private CheckBox talkCheck;

	private EventCalendarAdapter eventCalendarAdapter;

	private Boolean[] eventDays = null;
	private Boolean needsAccommodation = false;
	private Boolean needsPickup = false;
	private Boolean hasTalk = false;

	private String identifier;
	private UserData userData;

	private String startDateString = "2015-05-23";
	private String endDateString = "2015-06-07";

	private String serverURL;

	private ProgressDialog progDialog;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_welcome);

		accommodationCheck = (CheckBox) findViewById(R.id.accommodationCheck);
		pickupCheck = (CheckBox) findViewById(R.id.pickupCheck);
		talkCheck = (CheckBox) findViewById(R.id.talkCheck);
		eventCalendarGrid = (GridView) findViewById(R.id.eventCalendarGrid);

		identifier = StorageHelper.PreferencesHelper.getIdentifier(this);
		userData = StorageHelper.PreferencesHelper
				.getUserData(this, identifier);

		serverURL = getResources().getString(R.string.server_url);

		initializeLayout();

		initializeListeners();

		initalizeAdapter();

		if (userData.getIsFinalized() == true) {
			Intent intent = new Intent(this, SummaryActivity.class);
			intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
					| Intent.FLAG_ACTIVITY_NEW_TASK);

			startActivity(intent);
			finish();
		}
		// getEventDaysUpdate();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.welcome, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
{'fraction_non_alphanumeric': 0.08813364055299538, 'fraction_numerical': 0.004896313364055299, 'mean_word_length': 5.703667953667954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3012825', 'n_tokens_mistral': 2143, 'n_tokens_neox': 1958, 'n_words': 488}