<commit_before>package com.example.johnson_849323.steamrpg;

import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

import java.util.ArrayList;


public class MainActivity extends ActionBarActivity {

    Enemy enemy;
    Player player = new Player();
    int damage = 5;

    private ListView mDrawerList;
    private DrawerLayout mDrawerLayout;
    private ArrayAdapter<String> mAdapter;
    private ActionBarDrawerToggle mDrawerToggle;
    private String mActivityTitle;

    private ProgressBar mProgress;
    private ProgressBar mProgress2;
    private ProgressBar mProgress3;
    private ProgressBar mProgress4;
    private ProgressBar mProgress5;
    private ProgressBar mProgress6;
    private ProgressBar mProgress7;

    public int shooting = 276;
    public int driving = 97;
    public int strategy = 342;
    public int survival = 222;
    public int puzzle = 73;
    public Context c;

    ArrayList<Enemy> enemies = new ArrayList();



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        AdView mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);

        mDrawerList = (ListView)findViewById(R.id.navList);

        enemies.add(new Enemy(50,12));
        enemies.add(new Enemy(75,24));

        enemy = enemies.get(0);

        mProgress2 = (ProgressBar) findViewById(R.id.enemy_health);
        mProgress2.setMax(enemy.getHealth());

        update();

        mDrawerList = (ListView)findViewById(R.id.navList);
        mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
        mActivityTitle = getTitle().toString();

        addDrawerItems();
        setupDrawer();

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

    private void addDrawerItems() {
        String[] osArray = { "Home", "Shooting", "Windows", "OS X", "Linux" };
        mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, osArray);
        mDrawerList.setAdapter(mAdapter);


        mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                //Toast.makeText(MainActivity.this, "Time for an upgrade!", Toast.LENGTH_SHORT).show();
                if(position == 0){
                    Toast.makeText(MainActivity.this, "0", Toast.LENGTH_SHORT).show();
                    shooting();
                }

                if(position == 1){
                    Toast.makeText(MainActivity.this, "1", Toast.LENGTH_SHORT).show();
                    shooting();
                }
            }
        });
    }
    public void home(){
        Intent intent = new Intent(this , MainActivity.class);
        startActivity(intent);
    }

    public void shooting(){
        Intent intent = new Intent(this , shooting.class);
        startActivity(intent);
    }<commit_msg>Should be packaged with last commit<commit_after>package com.example.johnson_849323.steamrpg;

import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

import java.util.ArrayList;


public class MainActivity extends ActionBarActivity {

    Enemy enemy;
    Player player = new Player();
    int damage = 5;

    private ListView mDrawerList;
    private DrawerLayout mDrawerLayout;
    private ArrayAdapter<String> mAdapter;
    private ActionBarDrawerToggle mDrawerToggle;
    private String mActivityTitle;

    private ProgressBar mProgress;
    private ProgressBar mProgress2;
    private ProgressBar mProgress3;
    private ProgressBar mProgress4;
    private ProgressBar mProgress5;
    private ProgressBar mProgress6;
    private ProgressBar mProgress7;

    public int shooting = 276;
    public int driving = 97;
    public int strategy = 342;
    public int survival = 222;
    public int puzzle = 73;
    public Context c;

    ArrayList<Enemy> enemies = new ArrayList();
    SharedPreferences sharedPref;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        AdView mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);

        Context context = MainActivity.this;
        sharedPref = context.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);

        int defaultValue = 100;
        shooting = sharedPref.getInt(getString(R.string.shooting_saved), defaultValue);



        mDrawerList = (ListView)findViewById(R.id.navList);

        enemies.add(new Enemy(50,12));
        enemies.add(new Enemy(75,24));

        enemy = enemies.get(0);

        mProgress2 = (ProgressBar) findViewById(R.id.enemy_health);
        mProgress2.setMax(enemy.getHealth());

        update();

        mDrawerList = (ListView)findViewById(R.id.navList);
        mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
        mActivityTitle = getTitle().toString();

        addDrawerItems();
        setupDrawer();

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

    private void levelCommit(){
        SharedPreferences.Editor editor = sharedPref.edit();
        editor.putInt(getString(R.string.shooting_saved), shooting);
        editor.commit();
    }

    private void addDrawerItems() {
        String[] osArray = { "Home", "Shooting", "Driving", "Strategy", "Survival" };
        mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, osArray);
        mDrawerList.setAdapter(mAdapter);


        mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                //Toast.makeText(MainActivity.this, "Time for an upgrade!", Toast.LENGTH_SHORT).show();
                if(position == 0){
                    Toast.makeText(MainActivity.this, "0", Toast.LENGTH_SHORT).show();
                    shooting();
                }

                if(position == 1){
                    Toast.makeText(MainActivity.this, "1", Toast.LENGTH_SHORT).show();
                    shooting();
                }
            }
        });
    }
    public void home(){
        Intent intent = new Intent(this , MainActivity.class);
        startActivity(intent);
    }

    public void shooting(){
        Intent intent = new Intent(this , shooting.class);
        startActivity(intent);
        levelCommit();
    }
{'fraction_non_alphanumeric': 0.10096440052387189, 'fraction_numerical': 0.011072746755566139, 'mean_word_length': 3.1257367387033397, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '830722', 'n_tokens_mistral': 2436, 'n_tokens_neox': 2285, 'n_words': 494}