<commit_before>package link.standen.michael.slideshow;

import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;

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

import de.cketti.library.changelog.ChangeLog;
import link.standen.michael.slideshow.dialog.ControlsDialog;
import link.standen.michael.slideshow.model.FileItem;

/**
 * Slideshow base activity.
 */
public abstract class BaseActivity extends AppCompatActivity {

	String currentPath;
	List<FileItem> fileList = new ArrayList<>();
	private Dialog changeLog;

	static final String STATE_PATH = "path";

	private static final String CHANGE_LOG_CSS = "body { padding: 0.8em; } " +
			"h1 { margin-left: 0px; font-size: 1.2em; } " +
			"ul { padding-left: 1.2em; } " +
			"li { margin-left: 0px; }";
	private static final String DEFAULT_LANGUAGE = new Locale("en").getLanguage();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// Check whether we're recreating a previously destroyed instance
		if (savedInstanceState != null) {
			// Restore value of members from saved state
			currentPath = savedInstanceState.getString(STATE_PATH);
		} else {
			// Probably initialize members with default values for a new instance
			currentPath = "NewPath";
		}
	}

	@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_main, menu);
		return true;
	}

	/**
	 * Handle options menu
	 */
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();

		if (id == android.R.id.home) {
			// Do the same thing as the back button.
			onBackPressed();
			return true;
		} else if (id == R.id.action_settings) {<commit_msg>Minor fixes to state saving #114<commit_after>package link.standen.michael.slideshow;

import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;

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

import de.cketti.library.changelog.ChangeLog;
import link.standen.michael.slideshow.dialog.ControlsDialog;
import link.standen.michael.slideshow.model.FileItem;

/**
 * Slideshow base activity.
 */
public abstract class BaseActivity extends AppCompatActivity {

	String currentPath;
	List<FileItem> fileList = new ArrayList<>();
	private Dialog changeLog;

	static final String STATE_PATH = "pathState";

	private static final String CHANGE_LOG_CSS = "body { padding: 0.8em; } " +
			"h1 { margin-left: 0px; font-size: 1.2em; } " +
			"ul { padding-left: 1.2em; } " +
			"li { margin-left: 0px; }";
	private static final String DEFAULT_LANGUAGE = new Locale("en").getLanguage();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// Check whether we're recreating a previously destroyed instance
		if (savedInstanceState != null) {
			// Restore value of members from saved state
			currentPath = savedInstanceState.getString(STATE_PATH);
		} else {
			// Probably initialize members with default values for a new instance
			currentPath = Environment.getExternalStorageDirectory().getAbsolutePath();
		}
	}

	@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_main, menu);
		return true;
	}

	/**
	 * Handle options menu
	 */
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		int id = item.getItemId();

		if (id == android.R.id.home) {
			// Do the same thing as the back button.
			onBackPressed();
			return true;
		} else if (id == R.id.action_settings) {
{'fraction_non_alphanumeric': 0.10625, 'fraction_numerical': 0.005324074074074074, 'mean_word_length': 4.483502538071066, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4670011', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1281, 'n_words': 357}