<commit_before>package com.example.yeelin.projects.betweenus.activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.MenuItem;

import com.example.yeelin.projects.betweenus.R;
import com.example.yeelin.projects.betweenus.fragment.InvitationFragment;
import com.example.yeelin.projects.betweenus.fragment.LocationEntryFragment;

import java.util.ArrayList;
import java.util.Locale;

/**
 * Created by ninjakiki on 7/24/15.
 */
public class InvitationActivity
        extends BaseActivity
        implements InvitationFragment.InvitationFragmentListener {
    //logcat
    private static final String TAG = InvitationActivity.class.getCanonicalName();

    //intent extras
    private static final String EXTRA_SELECTED_IDS = InvitationActivity.class.getSimpleName() + ".selectedIds";

    //sms and email
    private static final String URI_SMSTO = "smsto:";
    private static final String URI_MAILTO = "mailto:";
    private static final String EXTRA_SMS_BODY = "sms_body";
    //request codes
    private static final int REQUEST_CODE_COMPOSE_TEXT = 100;
    private static final int REQUEST_CODE_COMPOSE_EMAIL = 110;

    /**
     * Builds the appropriate intent to start this activity
     * @param selectedItemIds
     * @return
     */
    public static Intent buildIntent(Context context, ArrayList<String> selectedItemIds) {
        Intent intent = new Intent(context, InvitationActivity.class);
        //put extras
        intent.putStringArrayListExtra(EXTRA_SELECTED_IDS, selectedItemIds);
        return intent;
    }

    /**
     * Creates the activity
     * @param savedInstanceState
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_invitation);

        //setup tool bar
        setupToolbar(R.id.invitation_toolbar, true);

        //read intent
        Intent intent = getIntent();
        ArrayList<String> selectedItemIds = intent.getStringArrayListExtra(EXTRA_SELECTED_IDS);

        //check if fragment exists and instantiate if it doesn't
        if (savedInstanceState == null) {
            Fragment invitationFragment = getSupportFragmentManager().findFragmentById(R.id.invitation_fragmentContainer);
            if (invitationFragment == null) {
                getSupportFragmentManager()
                        .beginTransaction()
                        .add(R.id.invitation_fragmentContainer, InvitationFragment.newInstance(selectedItemIds))
                        .commit();
            }
        }
        else {
            Log.d(TAG, "onCreate: Saved instance state is not null");
        }
    }

    /**
     * Handles user selection of menu options
     * @param item
     * @return
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.home:
                navigateUpToParentActivity(this);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }<commit_msg>Changed R.id.home to android.id.home to make up navigation work properly<commit_after>package com.example.yeelin.projects.betweenus.activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.MenuItem;

import com.example.yeelin.projects.betweenus.R;
import com.example.yeelin.projects.betweenus.fragment.InvitationFragment;
import com.example.yeelin.projects.betweenus.fragment.LocationEntryFragment;

import java.util.ArrayList;
import java.util.Locale;

/**
 * Created by ninjakiki on 7/24/15.
 */
public class InvitationActivity
        extends BaseActivity
        implements InvitationFragment.InvitationFragmentListener {
    //logcat
    private static final String TAG = InvitationActivity.class.getCanonicalName();

    //intent extras
    private static final String EXTRA_SELECTED_IDS = InvitationActivity.class.getSimpleName() + ".selectedIds";

    //sms and email
    private static final String URI_SMSTO = "smsto:";
    private static final String URI_MAILTO = "mailto:";
    private static final String EXTRA_SMS_BODY = "sms_body";
    //request codes
    private static final int REQUEST_CODE_COMPOSE_TEXT = 100;
    private static final int REQUEST_CODE_COMPOSE_EMAIL = 110;

    /**
     * Builds the appropriate intent to start this activity
     * @param selectedItemIds
     * @return
     */
    public static Intent buildIntent(Context context, ArrayList<String> selectedItemIds) {
        Intent intent = new Intent(context, InvitationActivity.class);
        //put extras
        intent.putStringArrayListExtra(EXTRA_SELECTED_IDS, selectedItemIds);
        return intent;
    }

    /**
     * Creates the activity
     * @param savedInstanceState
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_invitation);

        //setup tool bar
        setupToolbar(R.id.invitation_toolbar, true);

        //read intent
        Intent intent = getIntent();
        ArrayList<String> selectedItemIds = intent.getStringArrayListExtra(EXTRA_SELECTED_IDS);

        //check if fragment exists and instantiate if it doesn't
        if (savedInstanceState == null) {
            Fragment invitationFragment = getSupportFragmentManager().findFragmentById(R.id.invitation_fragmentContainer);
            if (invitationFragment == null) {
                getSupportFragmentManager()
                        .beginTransaction()
                        .add(R.id.invitation_fragmentContainer, InvitationFragment.newInstance(selectedItemIds))
                        .commit();
            }
        }
        else {
            Log.d(TAG, "onCreate: Saved instance state is not null");
        }
    }

    /**
     * Handles user selection of menu options
     * @param item
     * @return
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                Log.d(TAG, "onOptionsItemSelected: Navigating up to parent activity");
                navigateUpToParentActivity(this);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
{'fraction_non_alphanumeric': 0.08396598846037048, 'fraction_numerical': 0.0036440935317339812, 'mean_word_length': 2.740488358886996, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1923278', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1689, 'n_words': 414}