<commit_before>package test.demo.gyniu.v2ex;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

/**
 * Created by uiprj on 17-5-10.
 */
public class SigninActivity extends AppCompatActivity implements View.OnClickListener{

    private EditText mUserName;
    private EditText mUserPasswd;
    private Button mButton;
    private TextView mForget;
    private TextView mOrSignup;

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

        mUserName = (EditText) findViewById(R.id.username);
        mUserPasswd = (EditText) findViewById(R.id.passwd);
        mButton = (Button) findViewById(R.id.signin);
        mForget = (TextView) findViewById(R.id.forget);
        mForget.setOnClickListener(this);
        mOrSignup = (TextView) findViewById(R.id.orSignup);

        //bottom color text link
        String str1 = getResources().getString(R.string.str_no_accout);
        String str2 = getResources().getString(R.string.str_signup);
        SpannableString ss = new SpannableString(str2);

        CustomClickableSpan clickSpan = new CustomClickableSpan(this, str2);
        ss.setSpan(clickSpan, 0, str2.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        mOrSignup.setText(str1);
        mOrSignup.append(" ");
        mOrSignup.append(ss);
        mOrSignup.setMovementMethod(LinkMovementMethod.getInstance());
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.forget) {
            Toast.makeText(this, "forget?", Toast.LENGTH_SHORT).show();
        }
    }

    class CustomClickableSpan extends ClickableSpan {
        private Context context;
        private String text;

        public CustomClickableSpan(Context context,String text)
        {
            this.context = context;
            this.text = text;
        }

        public void updateDrawState(TextPaint ds) {
            ds.setColor(context.getResources().getColor(R.color.colorOrange1));
        }

        @Override
        public void onClick(View widget) {
            widget.setBackground(null);
            Toast.makeText(context, "Sign up", Toast.LENGTH_SHORT).show();
        }
    }
}
<commit_msg>remove unused code<commit_after>package test.demo.gyniu.v2ex;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

/**
 * Created by uiprj on 17-5-10.
 */
public class SigninActivity extends AppCompatActivity implements View.OnClickListener{

    private EditText mUserName;
    private EditText mUserPasswd;
    private Button mButton;
    private TextView mForget;
    private TextView mOrSignup;

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

        mUserName = (EditText) findViewById(R.id.username);
        mUserPasswd = (EditText) findViewById(R.id.passwd);
        mButton = (Button) findViewById(R.id.signin);
        mForget = (TextView) findViewById(R.id.forget);
        mForget.setOnClickListener(this);
        mOrSignup = (TextView) findViewById(R.id.orSignup);

        //bottom color text link
        String str1 = getResources().getString(R.string.str_no_accout);
        String str2 = getResources().getString(R.string.str_signup);
        SpannableString ss = new SpannableString(str2);

        CustomClickableSpan clickSpan = new CustomClickableSpan(this, str2);
        ss.setSpan(clickSpan, 0, str2.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        mOrSignup.setText(str1);
        mOrSignup.append(" ");
        mOrSignup.append(ss);
        mOrSignup.setMovementMethod(LinkMovementMethod.getInstance());
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.forget) {
            Toast.makeText(this, "forget?", Toast.LENGTH_SHORT).show();
        }
    }

    class CustomClickableSpan extends ClickableSpan {
        private Context context;
        private String text;

        public CustomClickableSpan(Context context,String text)
        {
            this.context = context;
            this.text = text;
        }

        public void updateDrawState(TextPaint ds) {
            ds.setColor(context.getResources().getColor(R.color.colorOrange1));
        }

        @Override
        public void onClick(View widget) {
            Toast.makeText(context, "Sign up", Toast.LENGTH_SHORT).show();
        }
    }
}

{'fraction_non_alphanumeric': 0.10131332082551595, 'fraction_numerical': 0.005816135084427768, 'mean_word_length': 3.1293570875290473, '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': '3432961', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1538, 'n_words': 305}