<commit_before>package ajitsingh.com.expensemanager.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import java.util.List;

import ajitsingh.com.expensemanager.R;
import ajitsingh.com.expensemanager.database.ExpenseDatabaseHelper;
import ajitsingh.com.expensemanager.presenter.ExpensePresenter;
import ajitsingh.com.expensemanager.view.ExpenseView;

public class ExpenseFragment extends Fragment implements ExpenseView{
  private ExpenseDatabaseHelper expenseDatabaseHelper;
  private ExpensePresenter expensePresenter;

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    return inflater.inflate(R.layout.new_expense, container, false);
  }

  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    expenseDatabaseHelper = new ExpenseDatabaseHelper(this.getActivity());
    expensePresenter = new ExpensePresenter(expenseDatabaseHelper, this);
    expensePresenter.setExpenseTypes();

    Button addExpenseButton = (Button) getActivity().findViewById(R.id.add_expense);
    addExpenseButton.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        expensePresenter.addExpense();
        getActivity().getActionBar().setSelectedNavigationItem(1);
//        Toast.makeText(getActivity(), R.string.expense_add_successfully, Toast.LENGTH_LONG).show();
      }
    });
  }<commit_msg>uncommenting toast<commit_after>package ajitsingh.com.expensemanager.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import java.util.List;

import ajitsingh.com.expensemanager.R;
import ajitsingh.com.expensemanager.database.ExpenseDatabaseHelper;
import ajitsingh.com.expensemanager.presenter.ExpensePresenter;
import ajitsingh.com.expensemanager.view.ExpenseView;

public class ExpenseFragment extends Fragment implements ExpenseView{
  private ExpenseDatabaseHelper expenseDatabaseHelper;
  private ExpensePresenter expensePresenter;

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    return inflater.inflate(R.layout.new_expense, container, false);
  }

  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    expenseDatabaseHelper = new ExpenseDatabaseHelper(this.getActivity());
    expensePresenter = new ExpensePresenter(expenseDatabaseHelper, this);
    expensePresenter.setExpenseTypes();

    Button addExpenseButton = (Button) getActivity().findViewById(R.id.add_expense);
    addExpenseButton.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        expensePresenter.addExpense();
        Toast.makeText(getActivity(), R.string.expense_add_successfully, Toast.LENGTH_LONG).show();
        getActivity().getActionBar().setSelectedNavigationItem(1);
      }
    });
  }
{'fraction_non_alphanumeric': 0.08958630527817403, 'fraction_numerical': 0.0011412268188302425, 'mean_word_length': 5.768339768339768, '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': '681730', 'n_tokens_mistral': 1001, 'n_tokens_neox': 971, 'n_words': 177}