<commit_before>package com.itti7.itimeu;

import android.animation.ObjectAnimator;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Handler;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

public class TimerActivity extends AppCompatActivity {
    private TextView timeText;
    private ProgressBar progressBar;
    private Button stateBttn;

    final boolean STATE_PLAY=true;
    final boolean STATE_STOP=false;
    private boolean state=STATE_STOP;

    Handler handler;
    int progressBarValue = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_timer);
        /*Toolbar init*/
        Toolbar myToolbar = (Toolbar) findViewById(R.id.menu_toolbar);
        setSupportActionBar(myToolbar);

        /*progressBar button init*/
        progressBar = (ProgressBar)findViewById(R.id.progressBar);
        stateBttn = (Button)findViewById(R.id.state_bttn_view);
        stateBttn.setOnClickListener(stateChecker);
        timeText = (TextView)findViewById(R.id.time_txt_view);
        handler = new Handler()
        {
            public void handleMessage(android.os.Message msg)
            {
                if(state)
                {
                    progressBarValue++;
                }
                progressBar.setProgress(progressBarValue);
                timeText.setText(String.valueOf(progressBarValue/60)+":"+String.valueOf(progressBarValue%60));

                handler.sendEmptyMessageDelayed(0, 100);
            }
        };

        handler.sendEmptyMessage(0);
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);
        return true;
    }
    public boolean onOptionsItemSelected(MenuItem item){
        int id = item.getItemId(); //pressed item ID
        if (id == R.id.action_setting) {
                /*Intent passTo  = new Intent(getApplicationContext(),SettingActivity);
                * startActivity(passTo);*/
//            Toast.makeText(this, "setting", Toast.LENGTH_SHORT).show(); // test code
            return true;
        }
        if (id == R.id.action_list) {
            /*Intent passTo  = new Intent(getApplicationContext(),ListActivity);
                * startActivity(passTo);*/
            return true;
        }
        if (id == R.id.action_statistics) {
            /*Intent passTo  = new Intent(getApplicationContext(),StatisticsActivity);
                * startActivity(passTo);*/
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    Button.OnClickListener stateChecker =new View.OnClickListener(){
        @Override
        public void onClick(View v) {
            state=!state;
            if(state==STATE_PLAY){
                stateBttn.setText(R.string.stop);
            }
            else{
                stateBttn.setText(R.string.start);
            }
        }
    };

}<commit_msg>add stop activity to reset<commit_after>package com.itti7.itimeu;

import android.animation.ObjectAnimator;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Handler;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

public class TimerActivity extends AppCompatActivity {
    private TextView timeText;
    private ProgressBar progressBar;
    private Button stateBttn;

    final boolean STATE_PLAY=true;
    final boolean STATE_STOP=false;
    private boolean state=STATE_STOP;

    Handler handler;
    int progressBarValue = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_timer);
        /*Toolbar init*/
        Toolbar myToolbar = (Toolbar) findViewById(R.id.menu_toolbar);
        setSupportActionBar(myToolbar);

        /*progressBar button init*/
        progressBar = (ProgressBar)findViewById(R.id.progressBar);
        stateBttn = (Button)findViewById(R.id.state_bttn_view);
        stateBttn.setOnClickListener(stateChecker);
        timeText = (TextView)findViewById(R.id.time_txt_view);
        handler = new Handler()
        {
            public void handleMessage(android.os.Message msg)
            {
                if(state)
                {
                    progressBarValue++;
                }
                progressBar.setProgress(progressBarValue);
                timeText.setText(String.valueOf(progressBarValue/60)+":"+String.valueOf(progressBarValue%60));

                handler.sendEmptyMessageDelayed(0, 100);
            }
        };

        handler.sendEmptyMessage(0);
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);
        return true;
    }
    public boolean onOptionsItemSelected(MenuItem item){
        int id = item.getItemId(); //pressed item ID
        if (id == R.id.action_setting) {
                /*Intent passTo  = new Intent(getApplicationContext(),SettingActivity);
                * startActivity(passTo);*/
//            Toast.makeText(this, "setting", Toast.LENGTH_SHORT).show(); // test code
            return true;
        }
        if (id == R.id.action_list) {
            /*Intent passTo  = new Intent(getApplicationContext(),ListActivity);
                * startActivity(passTo);*/
            return true;
        }
        if (id == R.id.action_statistics) {
            /*Intent passTo  = new Intent(getApplicationContext(),StatisticsActivity);
                * startActivity(passTo);*/
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    Button.OnClickListener stateChecker =new View.OnClickListener(){
        @Override
        public void onClick(View v) {
            state=!state;
            if(state==STATE_PLAY){
                stateBttn.setText(R.string.stop);
            }
            else{
                progressBarValue=0;
                timeText.setText(R.string.time);
                stateBttn.setText(R.string.start);
            }
        }
    };

}
{'fraction_non_alphanumeric': 0.10046728971962617, 'fraction_numerical': 0.004526869158878504, 'mean_word_length': 2.380552813425469, 'pattern_counts': {'":': 2, '<': 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': '3225584', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1816, 'n_words': 346}