<commit_before>package org.mercycorps.translationcards.activity.addTranslation;

import org.mercycorps.translationcards.R;
import org.mercycorps.translationcards.activity.TranslationsActivity;

import butterknife.OnClick;

public class GetStartedActivity extends AddTranslationActivity {

    @Override
    public void inflateView() {
        setContentView(R.layout.activity_get_started);
    }

    @Override
    public void setBitmapsForActivity(){
        setBitmap(R.id.get_started_image, R.drawable.get_started_image);
    }

    @OnClick(R.id.get_started_button)
    public void getStartedButtonClick(){
        startNextActivity(GetStartedActivity.this, EnterSourcePhraseActivity.class);
    }

    @OnClick(R.id.get_started_back)
    public void getStartedBackButtonClicked(){
        startNextActivity(GetStartedActivity.this, TranslationsActivity.class);
    }

}<commit_msg>Pat/Nat fix bug when record audio clicked, not asking for permissions<commit_after>package org.mercycorps.translationcards.activity.addTranslation;

import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;

import org.mercycorps.translationcards.R;
import org.mercycorps.translationcards.activity.TranslationsActivity;

import butterknife.OnClick;

public class GetStartedActivity extends AddTranslationActivity {

    private static final int PERMISSIONS_REQUEST_RECORD_AUDIO = 0;

    @Override
    public void inflateView() {
        setContentView(R.layout.activity_get_started);
    }

    @Override
    public void setBitmapsForActivity() {
        setBitmap(R.id.get_started_image, R.drawable.get_started_image);
    }

    @OnClick(R.id.get_started_button)
    public void getStartedButtonClick() {
        if (checkRecordingPermission()) {
            startNextActivity(GetStartedActivity.this, EnterSourcePhraseActivity.class);
        } else {
            ActivityCompat.requestPermissions(GetStartedActivity.this, new String[]{Manifest.permission.RECORD_AUDIO}, PERMISSIONS_REQUEST_RECORD_AUDIO);
        }
    }

    @OnClick(R.id.get_started_back)
    public void getStartedBackButtonClicked() {
        startNextActivity(GetStartedActivity.this, TranslationsActivity.class);
    }

    private boolean checkRecordingPermission() {
        if (Build.VERSION.SDK_INT < 23) {
            return true;
        }
        return ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED;
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            startNextActivity(GetStartedActivity.this, EnterSourcePhraseActivity.class);
        } else {
            startNextActivity(GetStartedActivity.this, TranslationsActivity.class);
        }
    }

}
{'fraction_non_alphanumeric': 0.0841683366733467, 'fraction_numerical': 0.002338009352037408, 'mean_word_length': 4.137221269296741, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2282438', 'n_tokens_mistral': 883, 'n_tokens_neox': 845, 'n_words': 136}