(Android Java) Split ModuleWrapper class off into separate .java file

This commit is contained in:
twinaphex 2013-08-12 05:19:39 +02:00
parent f17fd23ad0
commit b142cae10a
2 changed files with 41 additions and 35 deletions

View File

@ -0,0 +1,41 @@
package org.retroarch.browser;
import java.io.File;
import java.io.IOException;
import android.content.Context;
import android.graphics.drawable.Drawable;
class ModuleWrapper implements IconAdapterItem {
public final File file;
private ConfigFile config;
public ModuleWrapper(Context aContext, File aFile, ConfigFile config) throws IOException {
file = aFile;
this.config = config;
}
@Override
public boolean isEnabled() {
return true;
}
@Override
public String getText() {
String stripped = file.getName().replace(".so", "");
if (config.keyExists(stripped)) {
return config.getString(stripped);
} else
return stripped;
}
@Override
public int getIconResourceId() {
return 0;
}
@Override
public Drawable getIconDrawable() {
return null;
}
}

View File

@ -17,44 +17,9 @@ import android.util.Log;
import android.view.*;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.inputmethod.*;
import android.graphics.drawable.*;
// JELLY_BEAN_MR1 = 17
class ModuleWrapper implements IconAdapterItem {
public final File file;
private ConfigFile config;
public ModuleWrapper(Context aContext, File aFile, ConfigFile config) throws IOException {
file = aFile;
this.config = config;
}
@Override
public boolean isEnabled() {
return true;
}
@Override
public String getText() {
String stripped = file.getName().replace(".so", "");
if (config.keyExists(stripped)) {
return config.getString(stripped);
} else
return stripped;
}
@Override
public int getIconResourceId() {
return 0;
}
@Override
public Drawable getIconDrawable() {
return null;
}
}
public class RetroArch extends Activity implements
AdapterView.OnItemClickListener {
private IconAdapter<ModuleWrapper> adapter;