<commit_before>package net.squanchy.contest;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.view.ViewGroup;
import android.widget.TextView;

import net.squanchy.R;
import net.squanchy.fonts.TypefaceStyleableActivity;
import net.squanchy.speaker.SpeakerDetailsActivity;

public class ContestActivity extends TypefaceStyleableActivity {

    private static final String EXTRA_CHECKPOINT_ID = ContestActivity.class.getCanonicalName() + ".checkpoint_id";

    private ContestService contestService;
    TextView result;

    public static Intent createIntent(Context context, String checkpoint) {
        Intent intent = new Intent(context, SpeakerDetailsActivity.class);
        intent.putExtra(EXTRA_CHECKPOINT_ID, checkpoint);
        return intent;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_contest_summary);
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        result = (TextView) findViewById(R.id.result);

        ContestComponent component = ContestInjector.obtain(this);
        contestService = component.contestService();
    }

    @Override
    protected void onStart() {
        super.onStart();

        Intent intent = getIntent();
        String checkpointId = intent.getStringExtra(EXTRA_CHECKPOINT_ID);

        contestService.updateContest(checkpointId)
                .subscribe(this::updateWith);
    }

    private void updateWith(ContestStandings standings) {
        result.setText("got results");
    }
}<commit_msg>show contest recap in contest activity dialog<commit_after>package net.squanchy.contest;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.Locale;

import net.squanchy.R;
import net.squanchy.fonts.TypefaceStyleableActivity;

import io.reactivex.android.schedulers.AndroidSchedulers;

public class ContestActivity extends TypefaceStyleableActivity {

    private static final String EXTRA_CHECKPOINT_ID = ContestActivity.class.getCanonicalName() + ".checkpoint_id";

    private ContestService contestService;
    private TextView contestResults;

    public static Intent createIntent(Context context, String checkpoint) {
        Intent intent = new Intent(context, ContestActivity.class);
        intent.putExtra(EXTRA_CHECKPOINT_ID, checkpoint);
        return intent;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_contest_summary);
        getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

        contestResults = (TextView) findViewById(R.id.contest_result);

        ContestComponent component = ContestInjector.obtain(this);
        contestService = component.contestService();
    }

    @Override
    protected void onStart() {
        super.onStart();

        Intent intent = getIntent();
        String checkpointId = intent.getStringExtra(EXTRA_CHECKPOINT_ID);

        contestService.addAchievement(checkpointId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(this::updateWith);
    }

    private void updateWith(ContestStandings standings) {
        contestResults.setText(
                String.format(Locale.US, "Checked %1$d out of %2$d stands: \n%3$s",
                        standings.current(),
                        standings.goal(),
                        getContentMessage(standings.current(), standings.goal())));
    }

    private String getContentMessage(int current, int goal) {
        return current == goal ? "Congratulation, you won!" : "Still missing " + (goal - current) + " stands";
    }
}
{'fraction_non_alphanumeric': 0.08886168910648715, 'fraction_numerical': 0.0007343941248470012, 'mean_word_length': 3.637911464245176, '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': '1215659', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1058, 'n_words': 220}