<commit_before>package org.libreoffice.ui;

import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.io.IOException;

import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import android.widget.Toast;

public class LibreOfficeUIActivity extends Activity implements OnNavigationListener {
    private String tag = "file_manager";
    private File homeDirectory;//make final?
	private File currentDirectory;
	private String filter = "";
	private String[] filters = {"all",".odt",".ods",".odp"};
	private int filterMode = FileUtilities.ALL;
	FileFilter fileFilter;
	FilenameFilter filenameFilter;
	private String[] fileNames;
	private File[] filePaths;
	
	private String currentDirectoryKey = "CURRENT_DIRECTORY";
	private String filterModeKey = "FILTER_MODE";
	
	GridView gv;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.file_grid);
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayShowTitleEnabled(false);//This should show current directory if anything
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
        SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.file_view_modes,
                android.R.layout.simple_spinner_dropdown_item);
        actionBar.setListNavigationCallbacks(mSpinnerAdapter, this);
			
        
        homeDirectory  = new File(Environment.getExternalStorageDirectory(),"LibreOffice");
        Intent i = this.getIntent();
        if( i.hasExtra( currentDirectoryKey ) ){
        	//This isn't what I think it is. It's not a full path<commit_msg>Make sure homeDirectory exists<commit_after>package org.libreoffice.ui;

import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.io.IOException;

import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import android.widget.Toast;

public class LibreOfficeUIActivity extends Activity implements OnNavigationListener {
    private String tag = "file_manager";
    private File homeDirectory;//make final?
	private File currentDirectory;
	private String filter = "";
	private String[] filters = {"all",".odt",".ods",".odp"};
	private int filterMode = FileUtilities.ALL;
	FileFilter fileFilter;
	FilenameFilter filenameFilter;
	private String[] fileNames;
	private File[] filePaths;
	
	private String currentDirectoryKey = "CURRENT_DIRECTORY";
	private String filterModeKey = "FILTER_MODE";
	
	GridView gv;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.file_grid);
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayShowTitleEnabled(false);//This should show current directory if anything
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
        SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.file_view_modes,
                android.R.layout.simple_spinner_dropdown_item);
        actionBar.setListNavigationCallbacks(mSpinnerAdapter, this);
			
        
        homeDirectory  = new File(Environment.getExternalStorageDirectory(),"LibreOffice");
        homeDirectory.mkdirs();
        Intent i = this.getIntent();
        if( i.hasExtra( currentDirectoryKey ) ){
        	//This isn't what I think it is. It's not a full path
{'fraction_non_alphanumeric': 0.09058502830782135, 'fraction_numerical': 0.0, 'mean_word_length': 4.788834951456311, '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': '5401900', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1274, 'n_words': 305}