<commit_before>package org.apache.taverna.mobile.fragments;

import org.apache.taverna.mobile.R;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by rajan on 8/3/16.
 */
public class WorkflowViewpager extends Fragment {

    private final String LOG_TAG = getClass().getSimpleName();

    ViewPager viewPager;
    TabLayout tabLayout;


    public static WorkflowViewpager getInstance(int position) {
        WorkflowViewpager myFragment = new WorkflowViewpager();
        Bundle args = new Bundle();
        args.putInt("position", position);
        myFragment.setArguments(args);
        return myFragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
            savedInstanceState) {
        View workflow_pager = inflater.inflate(R.layout.viewpager_workflow, container, false);

        /**
         * Setting the tool bar in MainActivity for all fragment
         */
        Toolbar toolbar = (Toolbar) workflow_pager.findViewById(R.id.toolbar);
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);

        final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
        ab.setHomeAsUpIndicator(R.drawable.ic_menu);
        ab.setDisplayHomeAsUpEnabled(true);


        viewPager = (ViewPager) workflow_pager.findViewById(R.id.mviewpager);
        final Adapter adapter = new Adapter(getChildFragmentManager());

        /**
         * Dynamically Adding tabs
         * To add the new Tab "Go to res/values/category_id and add new title and category id"
         */
        adapter.addFragment(new WorkflowItemFragment(), getResources().getString(R.string
                .title_explore));
        adapter.addFragment(new FavoriteFragment(), getResources().getString(R.string
                .title_favorite));

        viewPager.setAdapter(adapter);
        viewPager.setOffscreenPageLimit(2);
        tabLayout = (TabLayout) workflow_pager.findViewById(R.id.mtablayout);
        tabLayout.setupWithViewPager(viewPager);

        return workflow_pager;
    }


    @Override<commit_msg>change workflow class<commit_after>package org.apache.taverna.mobile.fragments;

import org.apache.taverna.mobile.R;
import org.apache.taverna.mobile.ui.workflow.WorkflowFragment;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by rajan on 8/3/16.
 */
public class WorkflowViewpager extends Fragment {

    private final String LOG_TAG = getClass().getSimpleName();

    ViewPager viewPager;
    TabLayout tabLayout;


    public static WorkflowViewpager getInstance(int position) {
        WorkflowViewpager myFragment = new WorkflowViewpager();
        Bundle args = new Bundle();
        args.putInt("position", position);
        myFragment.setArguments(args);
        return myFragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
            savedInstanceState) {
        View workflow_pager = inflater.inflate(R.layout.viewpager_workflow, container, false);

        /**
         * Setting the tool bar in MainActivity for all fragment
         */
        Toolbar toolbar = (Toolbar) workflow_pager.findViewById(R.id.toolbar);
        ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);

        final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
        ab.setHomeAsUpIndicator(R.drawable.ic_menu);
        ab.setDisplayHomeAsUpEnabled(true);


        viewPager = (ViewPager) workflow_pager.findViewById(R.id.mviewpager);
        final Adapter adapter = new Adapter(getChildFragmentManager());

        /**
         * Dynamically Adding tabs
         * To add the new Tab "Go to res/values/category_id and add new title and category id"
         */
        adapter.addFragment(new WorkflowFragment(), getResources().getString(R.string
                .title_explore));
        adapter.addFragment(new FavoriteFragment(), getResources().getString(R.string
                .title_favorite));

        viewPager.setAdapter(adapter);
        viewPager.setOffscreenPageLimit(2);
        tabLayout = (TabLayout) workflow_pager.findViewById(R.id.mtablayout);
        tabLayout.setupWithViewPager(viewPager);

        return workflow_pager;
    }


    @Override
{'fraction_non_alphanumeric': 0.09764816556914394, 'fraction_numerical': 0.00451552210724365, 'mean_word_length': 3.4559932942162614, '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': '2499762', 'n_tokens_mistral': 1552, 'n_tokens_neox': 1478, 'n_words': 303}