<commit_before>package in.testpress.testpress.ui;

import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import in.testpress.testpress.R;

import com.astuetz.PagerSlidingTabStrip;
import com.viewpagerindicator.TitlePageIndicator;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Fragment which houses the View pager.
 */
public class CarouselFragment extends Fragment {

    @InjectView(R.id.tpi_header)
    protected PagerSlidingTabStrip indicator;

    @InjectView(R.id.vp_pages)
    protected ViewPager pager;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_carousel, container, false);
    }

    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        ButterKnife.inject(this, getView());

        pager.setAdapter(new TestpressPagerAdapter(getResources(), getChildFragmentManager()));
        indicator.setViewPager(pager);
        indicator.setIndicatorColor(getResources().getColor(R.color.primary));
        Bundle data = getArguments();
        if (data != null) {
            pager.setCurrentItem(Integer.parseInt(data.getString("currentItem")));
        } else {
            pager.setCurrentItem(0);<commit_msg>Fixes #8<commit_after>package in.testpress.testpress.ui;

import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import in.testpress.testpress.R;

import com.astuetz.PagerSlidingTabStrip;
import com.viewpagerindicator.TitlePageIndicator;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Fragment which houses the View pager.
 */
public class CarouselFragment extends Fragment {

    @InjectView(R.id.tpi_header)
    protected PagerSlidingTabStrip indicator;

    @InjectView(R.id.vp_pages)
    protected ViewPager pager;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_carousel, container, false);
    }

    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        ButterKnife.inject(this, getView());

        pager.setAdapter(new TestpressPagerAdapter(getResources(), getChildFragmentManager()));
        indicator.setViewPager(pager);
        indicator.setIndicatorColor(getResources().getColor(R.color.primary));
        Bundle data = getArguments();
        String currentItem = null;
        if(data != null) {
            currentItem = data.getString("currentItem");
        }
        if (currentItem != null) {
            pager.setCurrentItem(Integer.parseInt(currentItem));
        } else {
            pager.setCurrentItem(0);
{'fraction_non_alphanumeric': 0.09766892888757746, 'fraction_numerical': 0.0026556506344054295, 'mean_word_length': 4.1676829268292686, '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': '1115397', 'n_tokens_mistral': 1005, 'n_tokens_neox': 987, 'n_words': 177}