mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-29 11:10:27 +00:00
(Android Java) Split ModuleWrapper class off into separate .java file
This commit is contained in:
parent
f17fd23ad0
commit
b142cae10a
41
android/phoenix/src/org/retroarch/browser/ModuleWrapper.java
Normal file
41
android/phoenix/src/org/retroarch/browser/ModuleWrapper.java
Normal 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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user