<commit_before>package org.worshipsongs.fragment;

import android.app.ActionBar;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TabHost;

import org.worshipsongs.adapter.TabsPagerAdapter;
import org.worshipsongs.worship.R;

/**
 * Created by Seenivasan on 4/5/2015.
 */
public class TabFragment  extends Fragment implements ActionBar.TabListener {

    private TabHost tabHost;
    // Tab titles
    private String[] tabsTitles = {"Songs", "Authors", "Albums"};
    private ViewPager viewPager;
    private TabsPagerAdapter mAdapter;
    private DrawerLayout FragentLayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        FragentLayout = (DrawerLayout) inflater.inflate(R.layout.activity_main_drawer, container, false);
        tabHost=(TabHost)FragentLayout.findViewById(android.R.id.tabhost);
        viewPager = (ViewPager) FragentLayout.findViewById(R.id.pager);
        tabHost.setup();
        setRetainInstance(true);
        for (int i = 0; i < tabsTitles.length; i++) {
            String tabName = tabsTitles[i];
            TabHost.TabSpec spec=tabHost.newTabSpec(tabName);
            spec.setContent(R.id.fakeTabContent);
            spec.setIndicator(tabName);
            tabHost.addTab(spec);
        }
        mAdapter = new TabsPagerAdapter(getChildFragmentManager(), tabsTitles.length);
        viewPager.setAdapter(mAdapter);

        tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
            @Override
            public void onTabChanged(String tabId) {
                for (int i = 0; i < tabsTitles.length; i++) {
                    if (tabId.equals(tabsTitles[i])) {
                        viewPager.setCurrentItem(i);
                        break;
                    }
                }
            }
        });

        viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageSelected(int position) {
                Log.w(this.getClass().getSimpleName(), "Tab page position" +position);
                tabHost.setCurrentTab(position);
            }

            @Override
            public void onPageScrolled(int arg0, float arg1, int arg2) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onPageScrollStateChanged(int arg0) {
                // TODO Auto-generated method stub

            }
        });

        return FragentLayout;
    }

    @Override
    public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    }

    @Override
    public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    }

    @Override
    public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    }
}<commit_msg>#110 Override some methods for to create option menus<commit_after>package org.worshipsongs.fragment;

import android.app.ActionBar;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TabHost;

import org.worshipsongs.adapter.TabsPagerAdapter;
import org.worshipsongs.worship.R;

/**
 * Created by Seenivasan on 4/5/2015.
 */
public class TabFragment  extends Fragment implements ActionBar.TabListener {

    private TabHost tabHost;
    // Tab titles
    private String[] tabsTitles = {"Songs", "Authors", "Albums"};
    private ViewPager viewPager;
    private TabsPagerAdapter mAdapter;
    private DrawerLayout FragentLayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        FragentLayout = (DrawerLayout) inflater.inflate(R.layout.activity_main_drawer, container, false);
        tabHost=(TabHost)FragentLayout.findViewById(android.R.id.tabhost);
        viewPager = (ViewPager) FragentLayout.findViewById(R.id.pager);
        tabHost.setup();
        setRetainInstance(true);
        for (int i = 0; i < tabsTitles.length; i++) {
            String tabName = tabsTitles[i];
            TabHost.TabSpec spec=tabHost.newTabSpec(tabName);
            spec.setContent(R.id.fakeTabContent);
            spec.setIndicator(tabName);
            tabHost.addTab(spec);
        }
        mAdapter = new TabsPagerAdapter(getChildFragmentManager(), tabsTitles.length);
        viewPager.setAdapter(mAdapter);

        tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
            @Override
            public void onTabChanged(String tabId) {
                for (int i = 0; i < tabsTitles.length; i++) {
                    if (tabId.equals(tabsTitles[i])) {
                        viewPager.setCurrentItem(i);
                        break;
                    }
                }
            }
        });

        viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageSelected(int position) {
                Log.w(this.getClass().getSimpleName(), "Tab page position" +position);
                tabHost.setCurrentTab(position);
            }

            @Override
            public void onPageScrolled(int arg0, float arg1, int arg2) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onPageScrollStateChanged(int arg0) {
                // TODO Auto-generated method stub

            }
        });

        return FragentLayout;
    }

    @Override
    public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    }

    @Override
    public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    }

    @Override
    public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {

    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
    {
        inflater.inflate(R.menu.main, menu);
    }

    @Override
    public void onPrepareOptionsMenu(Menu menu) {
        super.onPrepareOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        return super.onOptionsItemSelected(item);
    }
}
{'fraction_non_alphanumeric': 0.08999134698586675, 'fraction_numerical': 0.00475915777329103, 'mean_word_length': 2.587687532333161, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4331089', 'n_tokens_mistral': 2003, 'n_tokens_neox': 1886, 'n_words': 394}