<commit_before>package com.brendanzhao.simplecalculator;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

/**
 * This represents the main activity for the calculator app.
 * @author <NAME>
 */
public class PortraitCalcActivity extends Activity {

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

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.portrait_calc, menu);
		return true;
	}
}
<commit_msg>Buttons type to screen.<commit_after>package com.brendanzhao.simplecalculator;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**
 * This represents the main activity for the calculator app.
 * @author <NAME>
 */
public class PortraitCalcActivity extends Activity implements OnClickListener {

	/**
	 * Represents the value entered before an operator was tapped.
	 */
	private TextView bufferedCalculation;
	
	/**
	 * Represents the value currently being typed.
	 */
	private TextView currentCalculation;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.portrait_layout);
		
		bufferedCalculation = (TextView) findViewById(R.id.bufferedcalculation);
		currentCalculation = (TextView) findViewById(R.id.currentcalculation);
		initializeButtons();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.portrait_calc, menu);
		return true;
	}
	
	/**
	 * Sets the on click listeners of every button on the keypad.
	 */
	private void initializeButtons() {
		findViewById(R.id.zero).setOnClickListener(this);
		findViewById(R.id.one).setOnClickListener(this);
		findViewById(R.id.two).setOnClickListener(this);
		findViewById(R.id.three).setOnClickListener(this);
		findViewById(R.id.four).setOnClickListener(this);
		findViewById(R.id.five).setOnClickListener(this);
		findViewById(R.id.six).setOnClickListener(this);
		findViewById(R.id.seven).setOnClickListener(this);
		findViewById(R.id.eight).setOnClickListener(this);
		findViewById(R.id.nine).setOnClickListener(this);
		findViewById(R.id.add).setOnClickListener(this);
		findViewById(R.id.subtract).setOnClickListener(this);
		findViewById(R.id.multiply).setOnClickListener(this);
		findViewById(R.id.divide).setOnClickListener(this);
		findViewById(R.id.squareroot).setOnClickListener(this);
		findViewById(R.id.negative).setOnClickListener(this);
		findViewById(R.id.decimal).setOnClickListener(this);
		findViewById(R.id.equals).setOnClickListener(this);
		findViewById(R.id.clear).setOnClickListener(this);
	}

	@Override
	public void onClick(View button) {
		
		String buttonPressed = ((Button) button).getText().toString();
	
		switch (button.getId()) {
		case R.id.zero:
		case R.id.one:
		case R.id.two:
		case R.id.three:
		case R.id.four:
		case R.id.five:
		case R.id.six:
		case R.id.seven:
		case R.id.eight:
		case R.id.nine:
		case R.id.decimal:
			if (currentCalculation.getText() == "0")
				currentCalculation.setText(buttonPressed);
			else 
				currentCalculation.append(buttonPressed);
			break;
		default:
			break;
		}
	}
}

{'fraction_non_alphanumeric': 0.11278814489571899, 'fraction_numerical': 0.00027442371020856203, 'mean_word_length': 4.11938202247191, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3434910', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1057, 'n_words': 224}