<commit_before>package io.github.project_travel_mate.login;

import android.Manifest;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.afollestad.materialdialogs.MaterialDialog;
import com.dd.processbutton.FlatButton;

import butterknife.BindView;
import butterknife.ButterKnife;
import io.github.project_travel_mate.MainActivity;
import io.github.project_travel_mate.R;

import static utils.Constants.USER_ID;
import static utils.Constants.USER_NAME;
import static utils.Constants.USER_NUMBER;

/**
 * Initiates login
 */
public class LoginActivity extends AppCompatActivity implements View.OnClickListener, LoginView {

    @BindView(R.id.signup)
    TextView        signup;
    @BindView(R.id.login)
    TextView        login;
    @BindView(R.id.signup_layout)
    LinearLayout    sig;
    @BindView(R.id.loginlayout)
    LinearLayout    log;
    @BindView(R.id.input_num_login)
    EditText        num_login;
    @BindView(R.id.input_pass_login)
    EditText        pass_login;
    @BindView(R.id.input_num_signup)
    EditText        num_signup;
    @BindView(R.id.input_pass_signup)
    EditText        pass_signup;
    @BindView(R.id.input_name_signup)
    EditText        name;
    @BindView(R.id.ok_login)
    FlatButton      ok_login;
    @BindView(R.id.ok_signup)
    FlatButton      ok_signup;

    private SharedPreferences   sharedPreferences;
    private MaterialDialog      dialog;
    private Handler             mhandler;

    private final LoginPresenter loginPresenter = new LoginPresenter();

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

        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        loginPresenter.bind(this);
        ButterKnife.bind(this);

        // Initialization
        mhandler = new Handler(Looper.getMainLooper());
        sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

        // Get runtime permissions for Android M
        getRunTimePermissions();

        // If user is already logged in, open MainActivity
        checkUserSession();

        signup.setOnClickListener(this);
        login.setOnClickListener(this);
        ok_login.setOnClickListener(this);
        ok_signup.setOnClickListener(this);
    }

    @Override
    protected void onDestroy() {
        loginPresenter.unbind();
        super.onDestroy();
    }<commit_msg>hide toolbar on LoginActivity change status bar color to black on LoginActivity (programatically)<commit_after>package io.github.project_travel_mate.login;

import android.Manifest;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.afollestad.materialdialogs.MaterialDialog;
import com.dd.processbutton.FlatButton;

import butterknife.BindView;
import butterknife.ButterKnife;
import io.github.project_travel_mate.MainActivity;
import io.github.project_travel_mate.R;

import static utils.Constants.USER_ID;
import static utils.Constants.USER_NAME;
import static utils.Constants.USER_NUMBER;

/**
 * Initiates login
 */
public class LoginActivity extends AppCompatActivity implements View.OnClickListener, LoginView {

    @BindView(R.id.signup)
    TextView        signup;
    @BindView(R.id.login)
    TextView        login;
    @BindView(R.id.signup_layout)
    LinearLayout    sig;
    @BindView(R.id.loginlayout)
    LinearLayout    log;
    @BindView(R.id.input_num_login)
    EditText        num_login;
    @BindView(R.id.input_pass_login)
    EditText        pass_login;
    @BindView(R.id.input_num_signup)
    EditText        num_signup;
    @BindView(R.id.input_pass_signup)
    EditText        pass_signup;
    @BindView(R.id.input_name_signup)
    EditText        name;
    @BindView(R.id.ok_login)
    FlatButton      ok_login;
    @BindView(R.id.ok_signup)
    FlatButton      ok_signup;

    private SharedPreferences   sharedPreferences;
    private MaterialDialog      dialog;
    private Handler             mhandler;

    private final LoginPresenter loginPresenter = new LoginPresenter();

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

        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().hide();

        Window window = this.getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.setStatusBarColor(ContextCompat.getColor(this, R.color.black));

        loginPresenter.bind(this);
        ButterKnife.bind(this);

        // Initialization
        mhandler = new Handler(Looper.getMainLooper());
        sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

        // Get runtime permissions for Android M
        getRunTimePermissions();

        // If user is already logged in, open MainActivity
        checkUserSession();

        signup.setOnClickListener(this);
        login.setOnClickListener(this);
        ok_login.setOnClickListener(this);
        ok_signup.setOnClickListener(this);
    }

    @Override
    protected void onDestroy() {
        loginPresenter.unbind();
        super.onDestroy();
    }
{'fraction_non_alphanumeric': 0.08677494199535962, 'fraction_numerical': 0.0009280742459396752, 'mean_word_length': 3.5760792639773533, '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': '4943432', 'n_tokens_mistral': 1904, 'n_tokens_neox': 1842, 'n_words': 344}