<commit_before>package de.fau.amos.virtualledger.android.views.contacts.add;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.fau.amos.virtualledger.R;
import de.fau.amos.virtualledger.android.api.sync.Toaster;
import de.fau.amos.virtualledger.android.dagger.App;
import de.fau.amos.virtualledger.android.data.ContactsDataManager;
import de.fau.amos.virtualledger.android.views.menu.MainMenu;
import de.fau.amos.virtualledger.dtos.Contact;

/**
 * Created by Simon on 08.07.2017.
 */

public class AddContactsActivity extends AppCompatActivity {
    @SuppressWarnings("unused")
    private static final String tag = AddContactsActivity.class.getSimpleName();


    @Inject
    ContactsDataManager contactsDataManager;

    @BindView(R.id.email_addcontacts)
    EditText emailAdr;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ((App) getApplication()).getNetComponent().inject(this);
        setContentView(R.layout.contacts_activity_add);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.button_addContacts_submit)
    void submit() {
        final String email = emailAdr.getText().toString();

        Toaster toaster = new Toaster(getApplicationContext())//
                .pushConceptualErrorMessage("User not found");

        contactsDataManager.add(new Contact(email), toaster);

        Intent intent = new Intent(this, MainMenu.class);
        intent.putExtra(MainMenu.EXTRA_STARTING_FRAGMENT, MainMenu.AppFragment.CONTACTS);
        startActivity(intent);

        finish();
    }

}<commit_msg>On successful add a custom message is displayed to the user<commit_after>package de.fau.amos.virtualledger.android.views.contacts.add;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.fau.amos.virtualledger.R;
import de.fau.amos.virtualledger.android.api.sync.Toaster;
import de.fau.amos.virtualledger.android.dagger.App;
import de.fau.amos.virtualledger.android.data.ContactsDataManager;
import de.fau.amos.virtualledger.android.views.menu.MainMenu;
import de.fau.amos.virtualledger.dtos.Contact;

/**
 * Created by Simon on 08.07.2017.
 */

public class AddContactsActivity extends AppCompatActivity {
    @SuppressWarnings("unused")
    private static final String tag = AddContactsActivity.class.getSimpleName();


    @Inject
    ContactsDataManager contactsDataManager;

    @BindView(R.id.email_addcontacts)
    EditText emailAdr;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ((App) getApplication()).getNetComponent().inject(this);
        setContentView(R.layout.contacts_activity_add);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.button_addContacts_submit)
    void submit() {
        final String email = emailAdr.getText().toString();

        Toaster toaster = new Toaster(getApplicationContext())//
                .pushSuccessMessage(email + " was successfully added").pushTechnicalErrorMessage(
                        "User not found/No connection to server, please try again");

        contactsDataManager.add(new Contact(email), toaster);

        Intent intent = new Intent(this, MainMenu.class);
        intent.putExtra(MainMenu.EXTRA_STARTING_FRAGMENT, MainMenu.AppFragment.CONTACTS);
        startActivity(intent);

        finish();
    }

}
{'fraction_non_alphanumeric': 0.10401267159450897, 'fraction_numerical': 0.004751847940865892, 'mean_word_length': 3.992094861660079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2775109', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1136, 'n_words': 198}