<commit_before>package com.rohitbhoompally.elements.cdtdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.rohitbhoompally.elements.circularcdt.CDTCircular;
import com.rohitbhoompally.elements.circularcdt.CircularTimer;

public class MainActivity extends Activity {
	static CircularTimer ct;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		ct = (CircularTimer) findViewById(R.id.c_timer);
		ct.registerListener(new CDTCircular() {

			@Override
			public void onTick(long millis) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onFinish() {
				// TODO Auto-generated method stub

			}
		});
		final Button btn = (Button) findViewById(R.id.start);
		final LinearLayout btnWrapper = (LinearLayout) findViewById(R.id.btn_wrapper);
		final Button stopBtn = (Button) findViewById(R.id.stop);
		final Button restartBtn = (Button) findViewById(R.id.restart);
		Button resetBtn = (Button) findViewById(R.id.reset);
		btn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.startTimer();

				// Hide start button
				btn.setVisibility(View.GONE);
				btnWrapper.setVisibility(View.VISIBLE);
			}
		});

		// new CDTCircular() {
		//
		// @Override
		// public void onTick(long millis) {
		// // TODO Auto-generated method stub
		//
		// }
		//
		// @Override
		// public void onFinish() {
		// // Reset all states
		// stopBtn.setVisibility(View.VISIBLE);
		// restartBtn.setVisibility(View.GONE);
		// btn.setVisibility(View.VISIBLE);
		// btnWrapper.setVisibility(View.GONE);
		// }
		// };

		stopBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.stopTimer();

				// Switch stop and restart
				stopBtn.setVisibility(View.GONE);
				restartBtn.setVisibility(View.VISIBLE);
			}
		});

		restartBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.restartTimer();

				// Switch stop and restart
				stopBtn.setVisibility(View.VISIBLE);
				restartBtn.setVisibility(View.GONE);
			}
		});

		resetBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.resetTimer();

				// Switch stop and restart
				stopBtn.setVisibility(View.VISIBLE);
				restartBtn.setVisibility(View.GONE);

				// Show start button
				btn.setVisibility(View.VISIBLE);
				btnWrapper.setVisibility(View.GONE);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {

		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;<commit_msg>Capturing onFinish event to reset views.<commit_after>package com.rohitbhoompally.elements.cdtdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.rohitbhoompally.elements.circularcdt.CDTCircular;
import com.rohitbhoompally.elements.circularcdt.CircularTimer;

public class MainActivity extends Activity {
	static CircularTimer ct;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		ct = (CircularTimer) findViewById(R.id.c_timer);
		final Button btn = (Button) findViewById(R.id.start);
		final LinearLayout btnWrapper = (LinearLayout) findViewById(R.id.btn_wrapper);
		final Button stopBtn = (Button) findViewById(R.id.stop);
		final Button restartBtn = (Button) findViewById(R.id.restart);
		Button resetBtn = (Button) findViewById(R.id.reset);
		btn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.startTimer();

				// Hide start button
				btn.setVisibility(View.GONE);
				btnWrapper.setVisibility(View.VISIBLE);
			}
		});

		stopBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.stopTimer();

				// Switch stop and restart
				stopBtn.setVisibility(View.GONE);
				restartBtn.setVisibility(View.VISIBLE);
			}
		});

		restartBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.restartTimer();

				// Switch stop and restart
				stopBtn.setVisibility(View.VISIBLE);
				restartBtn.setVisibility(View.GONE);
			}
		});

		resetBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ct.resetTimer();

				// Switch stop and restart
				stopBtn.setVisibility(View.VISIBLE);
				restartBtn.setVisibility(View.GONE);

				// Show start button
				btn.setVisibility(View.VISIBLE);
				btnWrapper.setVisibility(View.GONE);
			}
		});

		ct.registerListener(new CDTCircular() {

			@Override
			public void onTick(long millis) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onFinish() {
				// TODO Auto-generated method stub

				// Switch stop and restart
				stopBtn.setVisibility(View.VISIBLE);
				restartBtn.setVisibility(View.GONE);

				// Show start button
				btn.setVisibility(View.VISIBLE);
				btnWrapper.setVisibility(View.GONE);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {

		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
{'fraction_non_alphanumeric': 0.1125311203319502, 'fraction_numerical': 0.0, 'mean_word_length': 3.624712202609363, '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': '5999484', 'n_tokens_mistral': 2211, 'n_tokens_neox': 1794, 'n_words': 399}