(Android Java) Split ModuleWrapper class off into separate .java file
This commit is contained in:
parent
f17fd23ad0
commit
b142cae10a
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,44 +17,9 @@ import android.util.Log;
|
||||||
import android.view.*;
|
import android.view.*;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
import android.view.inputmethod.*;
|
import android.view.inputmethod.*;
|
||||||
import android.graphics.drawable.*;
|
|
||||||
|
|
||||||
// JELLY_BEAN_MR1 = 17
|
// 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
|
public class RetroArch extends Activity implements
|
||||||
AdapterView.OnItemClickListener {
|
AdapterView.OnItemClickListener {
|
||||||
private IconAdapter<ModuleWrapper> adapter;
|
private IconAdapter<ModuleWrapper> adapter;
|
||||||
|
|
Loading…
Reference in New Issue