(Android) Remove more unnecessary files / simplify fileio/Option.java

This commit is contained in:
twinaphex 2012-10-14 02:44:36 +02:00
parent 87cec1a077
commit 1195e92850
4 changed files with 16 additions and 120 deletions

View File

@ -1,93 +0,0 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_retroarch_rruntime */
#ifndef _Included_com_retroarch_rruntime
#define _Included_com_retroarch_rruntime
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_retroarch_rruntime
* Method: load_game
* Signature: (Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1game
(JNIEnv *, jclass, jstring, jint);
/*
* Class: com_retroarch_rruntime
* Method: run_frame
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_retroarch_rruntime_run_1frame
(JNIEnv *, jclass);
/*
* Class: com_retroarch_rruntime
* Method: startup
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_startup
(JNIEnv *, jclass, jstring);
/*
* Class: com_retroarch_rruntime
* Method: deinit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_deinit
(JNIEnv *, jclass);
/*
* Class: com_retroarch_rruntime
* Method: load_state
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_load_1state
(JNIEnv *, jclass);
/*
* Class: com_retroarch_rruntime
* Method: save_state
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_save_1state
(JNIEnv *, jclass);
/*
* Class: com_retroarch_rruntime
* Method: settings_change
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1change
(JNIEnv *, jclass, jint);
/*
* Class: com_retroarch_rruntime
* Method: settings_set_defaults
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_settings_1set_1defaults
(JNIEnv *, jclass);
/*
* Class: com_retroarch_rruntime
* Method: set_window
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_set_window
(JNIEnv *, jclass, jobject, jobject);
/*
* Class: com_retroarch_rruntime
* Method: free_window
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_retroarch_rruntime_free_window
(JNIEnv *, jclass, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -43,7 +43,7 @@ public class FileArrayAdapter extends ArrayAdapter<Option> implements SectionInd
for (int x = 0; x < size; x++) { for (int x = 0; x < size; x++) {
Option o = items.get(x); Option o = items.get(x);
String ch = o.getName().substring(0, 1); String ch = o.name.substring(0, 1);
ch = ch.toUpperCase(); ch = ch.toUpperCase();
@ -82,11 +82,11 @@ public class FileArrayAdapter extends ArrayAdapter<Option> implements SectionInd
if(t1!=null) if(t1!=null)
{ {
t1.setText(o.getName()); t1.setText(o.name);
} }
if(t2!=null) if(t2!=null)
{ {
t2.setText(o.getData()); t2.setText(o.data);
} }
} }

View File

@ -193,13 +193,13 @@ public class FileChooser extends Activity
{ {
int pos = arg0.getPositionForView(arg1); int pos = arg0.getPositionForView(arg1);
Option o = adapter.getItem(pos); Option o = adapter.getItem(pos);
if(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")) if(o.data.equalsIgnoreCase("folder")|| o.data.equalsIgnoreCase("parent directory"))
{ {
if (o.getPath() != null) if (o.path != null)
{ {
currentDir = new File(o.getPath()); currentDir = new File(o.path);
fill(currentDir); fill(currentDir);
_dirStack.push(o.getPath()); _dirStack.push(o.path);
} }
} }
else else
@ -226,11 +226,11 @@ public class FileChooser extends Activity
private void onFileClick(Option o) private void onFileClick(Option o)
{ {
Toast.makeText(this, "Loading: "+o.getName() + "...", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "Loading: "+ o.name + "...", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(); Intent intent=new Intent();
intent.putExtra("PATH", o.getPath()); intent.putExtra("PATH", o.path);
intent.putExtra("NAME", o.getName()); intent.putExtra("NAME", o.name);
setResult(RESULT_OK, intent); setResult(RESULT_OK, intent);
finish(); finish();
} }

View File

@ -2,9 +2,9 @@ package com.retroarch.fileio;
public class Option implements Comparable<Option> public class Option implements Comparable<Option>
{ {
private String name; public String name;
private String data; public String data;
private String path; public String path;
public Option(String n,String d,String p) public Option(String n,String d,String p)
{ {
@ -12,22 +12,11 @@ public class Option implements Comparable<Option>
data = d; data = d;
path = p; path = p;
} }
public String getName()
{
return name;
}
public String getData()
{
return data;
}
public String getPath()
{
return path;
}
public int compareTo(Option o) { public int compareTo(Option o)
{
if(this.name != null) if(this.name != null)
return this.name.toLowerCase().compareTo(o.getName().toLowerCase()); return this.name.toLowerCase().compareTo(o.name.toLowerCase());
else else
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }