<commit_before>package io.khe.kenthackenough;

import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import io.khe.kenthackenough.backend.LiveFeedManager;


public class MainActivity extends ActionBarActivity {
    public LiveFeedManager liveFeedManager;

    private String[] mViewTitles;
    private Fragment[] mViews;
    private DrawerLayout mViewDrawerLayout;
    private ListView mViewDrawerList;
    private ActionBarDrawerToggle mDrawerToggle;

    private int mCurrentView = 0;

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

        mViews = getPanes();


        if (savedInstanceState != null) {
            mCurrentView = savedInstanceState.getInt("active_view");
        }

        setContentView(R.layout.activity_main);


        mViewTitles = getResources().getStringArray(R.array.views);
        mViewDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        mViewDrawerList = (ListView) findViewById(R.id.left_drawer);

        mViewDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.text_list_item, mViewTitles));
        mViewDrawerList.setOnItemClickListener(new ViewDrawerClickListener());

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        Intent intent = getIntent();
        mCurrentView = intent.getIntExtra("view", mCurrentView);

        Log.i(Config.DEBUG_TAG, "main activity loaded and switching to " + mCurrentView);


        selectView(mCurrentView);

        // todo add actual icons here built for purpose
        mDrawerToggle = new ActionBarDrawerToggle(this, mViewDrawerLayout, R.drawable.clover, R.drawable.clover);
        mViewDrawerLayout.setDrawerListener(mDrawerToggle);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
    }

    private Fragment[] getPanes(){
        Fragment[] views  = new Fragment[3];
        views = new Fragment[3];
        views[0] = new DashboardFragment();
        views[1] = new LiveFeedFragment();
        views[2] = new EventsFragment();

        return views;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_dashboard, menu);
        return true;
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        // Sync the toggle state after onRestoreInstanceState has occurred.
        mDrawerToggle.syncState();
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();



        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        if (mDrawerToggle.onOptionsItemSelected(item)) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt("active_view", mCurrentView);
    }
<commit_msg>Remove Code Using Settings Item<commit_after>package io.khe.kenthackenough;

import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import io.khe.kenthackenough.backend.LiveFeedManager;


public class MainActivity extends ActionBarActivity {
    public LiveFeedManager liveFeedManager;

    private String[] mViewTitles;
    private Fragment[] mViews;
    private DrawerLayout mViewDrawerLayout;
    private ListView mViewDrawerList;
    private ActionBarDrawerToggle mDrawerToggle;

    private int mCurrentView = 0;

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

        mViews = getPanes();


        if (savedInstanceState != null) {
            mCurrentView = savedInstanceState.getInt("active_view");
        }

        setContentView(R.layout.activity_main);


        mViewTitles = getResources().getStringArray(R.array.views);
        mViewDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        mViewDrawerList = (ListView) findViewById(R.id.left_drawer);

        mViewDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.text_list_item, mViewTitles));
        mViewDrawerList.setOnItemClickListener(new ViewDrawerClickListener());

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        Intent intent = getIntent();
        mCurrentView = intent.getIntExtra("view", mCurrentView);

        Log.i(Config.DEBUG_TAG, "main activity loaded and switching to " + mCurrentView);


        selectView(mCurrentView);

        // todo add actual icons here built for purpose
        mDrawerToggle = new ActionBarDrawerToggle(this, mViewDrawerLayout, R.drawable.clover, R.drawable.clover);
        mViewDrawerLayout.setDrawerListener(mDrawerToggle);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
    }

    private Fragment[] getPanes(){
        Fragment[] views  = new Fragment[3];
        views = new Fragment[3];
        views[0] = new DashboardFragment();
        views[1] = new LiveFeedFragment();
        views[2] = new EventsFragment();

        return views;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_dashboard, menu);
        return true;
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        // Sync the toggle state after onRestoreInstanceState has occurred.
        mDrawerToggle.syncState();
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        if (mDrawerToggle.onOptionsItemSelected(item)) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt("active_view", mCurrentView);
    }

{'fraction_non_alphanumeric': 0.08835393623942746, 'fraction_numerical': 0.002602472348731295, 'mean_word_length': 3.322834645669291, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3016338', 'n_tokens_mistral': 2174, 'n_tokens_neox': 2066, 'n_words': 479}