Start file browser from root directory.

Use file and folder icons generated by android-ui-utils, rather than gartoon.
Don't hardcode the retro core search path.
This commit is contained in:
meancoot 2012-12-06 01:45:14 -05:00
parent fca88c4bd0
commit a8f7c1d4b7
12 changed files with 5 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

View File

@ -37,7 +37,7 @@ class FileWrapper implements IconAdapterItem
@Override public int getIconResourceId() @Override public int getIconResourceId()
{ {
return file.isFile() ? R.drawable.file : R.drawable.folder; return file.isFile() ? R.drawable.ic_file : R.drawable.ic_dir;
} }
@Override public Drawable getIconDrawable() @Override public Drawable getIconDrawable()
@ -85,10 +85,7 @@ public class DirectoryActivity extends Activity implements AdapterView.OnItemCli
// Load Directory // Load Directory
String path = getIntent().getStringExtra("ROM"); String path = getIntent().getStringExtra("ROM");
if(path == null) path = (path == null) ? "/" : path;
{
path = Environment.getExternalStorageDirectory().getPath();
}
wrapFiles(new File(path)); wrapFiles(new File(path));
setTitle(path); setTitle(path);

View File

@ -43,14 +43,12 @@ class ModuleWrapper implements IconAdapterItem
public class ModuleActivity extends Activity implements AdapterView.OnItemClickListener public class ModuleActivity extends Activity implements AdapterView.OnItemClickListener
{ {
// HACK: Hard path
private static final String modulePath = "/data/data/org.retroarch/lib/";
private IconAdapter<ModuleWrapper> adapter; private IconAdapter<ModuleWrapper> adapter;
@Override public void onCreate(Bundle savedInstanceState) @Override public void onCreate(Bundle savedInstanceState)
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.line_list); setContentView(R.layout.line_list);
// Setup the list // Setup the list
@ -61,6 +59,8 @@ public class ModuleActivity extends Activity implements AdapterView.OnItemClickL
setTitle("Select Emulator"); setTitle("Select Emulator");
// Populate the list
final String modulePath = getApplicationInfo().nativeLibraryDir;
for(final File lib: new File(modulePath).listFiles()) for(final File lib: new File(modulePath).listFiles())
{ {
if(lib.getName().startsWith("libretro_")) if(lib.getName().startsWith("libretro_"))