diff --git a/Source/Android/AndroidManifest.xml b/Source/Android/AndroidManifest.xml index 624f7b2df9..82573aa8aa 100644 --- a/Source/Android/AndroidManifest.xml +++ b/Source/Android/AndroidManifest.xml @@ -26,7 +26,13 @@ + + diff --git a/Source/Android/assets/Dolphin.png b/Source/Android/assets/Dolphin.png deleted file mode 100644 index 74d6c88801..0000000000 Binary files a/Source/Android/assets/Dolphin.png and /dev/null differ diff --git a/Source/Android/project.properties b/Source/Android/project.properties index a3ee5ab64f..91be165ce3 100644 --- a/Source/Android/project.properties +++ b/Source/Android/project.properties @@ -12,3 +12,4 @@ # Project target. target=android-17 +android.library.reference.1=../../Externals/android-menudrawer/library diff --git a/Source/Android/res/layout/folderbrowser.xml b/Source/Android/res/layout/folderbrowser.xml new file mode 100644 index 0000000000..ae480d0807 --- /dev/null +++ b/Source/Android/res/layout/folderbrowser.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Android/res/layout/folderbrowserfooter.xml b/Source/Android/res/layout/folderbrowserfooter.xml new file mode 100644 index 0000000000..9c0e11d81b --- /dev/null +++ b/Source/Android/res/layout/folderbrowserfooter.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/Source/Android/res/layout/main.xml b/Source/Android/res/layout/main.xml index 6116f6c33d..1b19ad19fe 100644 --- a/Source/Android/res/layout/main.xml +++ b/Source/Android/res/layout/main.xml @@ -1,26 +1,42 @@ - - + - - + + + + + + + + + + + diff --git a/Source/Android/res/layout/sidemenu.xml b/Source/Android/res/layout/sidemenu.xml new file mode 100644 index 0000000000..57ab67e3ca --- /dev/null +++ b/Source/Android/res/layout/sidemenu.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index a989bf68d5..82d186de26 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -6,6 +6,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import net.simonvt.menudrawer.MenuDrawer; + import android.app.Activity; import android.content.Intent; import android.os.Bundle; @@ -88,7 +90,8 @@ public class DolphinEmulator extends Activity super.onCreate(savedInstanceState); if (savedInstanceState == null) { - Intent ListIntent = new Intent(this, NativeListView.class); + + Intent ListIntent = new Intent(this, GameListView.class); startActivityForResult(ListIntent, 1); // Make the assets directory @@ -120,13 +123,22 @@ public class DolphinEmulator extends Activity CopyAsset("Dolphin.png", Environment.getExternalStorageDirectory()+File.separator+ "dolphin-emu" + File.separator + "Dolphin.png"); + CopyAsset("Back.png", + Environment.getExternalStorageDirectory()+File.separator+ + "dolphin-emu" + File.separator + "Back.png"); + CopyAsset("Folder.png", + Environment.getExternalStorageDirectory()+File.separator+ + "dolphin-emu" + File.separator + "Folder.png"); + CopyAsset("Background.glsl", + Environment.getExternalStorageDirectory()+File.separator+ + "dolphin-emu" + File.separator + "Background.glsl"); CopyAsset("GCPadNew.ini", Environment.getExternalStorageDirectory()+File.separator+ "dolphin-emu" + File.separator +"Config"+ File.separator +"GCPadNew.ini"); } } } - + @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java new file mode 100644 index 0000000000..68203413b7 --- /dev/null +++ b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java @@ -0,0 +1,98 @@ +package org.dolphinemu.dolphinemu; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.simonvt.menudrawer.MenuDrawer; + +import android.app.Activity; +import android.app.ListActivity; +import android.content.Intent; +import android.os.Bundle; +import android.os.Environment; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemLongClickListener; +import android.widget.BaseAdapter; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +public class FolderBrowser extends ListActivity { + private GameListAdapter adapter; + private static File currentDir = null; + private void Fill(File f) + { + File[]dirs = f.listFiles(); + this.setTitle("Current Dir: " + f.getName()); + Listdir = new ArrayList(); + Listfls = new ArrayList(); + + try + { + for(File ff: dirs) + { + if (ff.getName().charAt(0) != '.') + if(ff.isDirectory()) + dir.add(new GameListItem(getApplicationContext(), ff.getName(),"Folder",ff.getAbsolutePath())); + else + if (ff.getName().toLowerCase().contains(".gcm") || + ff.getName().toLowerCase().contains(".iso") || + ff.getName().toLowerCase().contains(".wbfs") || + ff.getName().toLowerCase().contains(".gcz") || + ff.getName().toLowerCase().contains(".dol") || + ff.getName().toLowerCase().contains(".elf")) + fls.add(new GameListItem(getApplicationContext(), ff.getName(),"File Size: "+ff.length(),ff.getAbsolutePath())); + } + } + catch(Exception e) + { + } + + Collections.sort(dir); + Collections.sort(fls); + dir.addAll(fls); + if (!f.getName().equalsIgnoreCase("sdcard")) + dir.add(0, new GameListItem(getApplicationContext(), "..", "Parent Directory", f.getParent())); + + adapter = new GameListAdapter(this,R.layout.folderbrowser,dir); + this.setListAdapter(adapter); + } + + @Override + protected void onListItemClick(ListView l, View v, int position, long id) { + // TODO Auto-generated method stub + super.onListItemClick(l, v, position, id); + GameListItem o = adapter.getItem(position); + if(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")){ + currentDir = new File(o.getPath()); + Fill(currentDir); + } + } + + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + if(currentDir == null) + currentDir = new File(Environment.getExternalStorageDirectory().getPath()); + Fill(currentDir); + } + @Override + public void onBackPressed() { + Intent intent = new Intent(); + intent.putExtra("Select", currentDir.getPath()); + setResult(Activity.RESULT_OK, intent); + + this.finish(); + super.onBackPressed(); + } +} diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FileArrayAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java similarity index 71% rename from Source/Android/src/org/dolphinemu/dolphinemu/FileArrayAdapter.java rename to Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java index b49149a36c..f0aa522a1f 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/FileArrayAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java @@ -7,22 +7,23 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; +import android.widget.ImageView; import android.widget.TextView; -public class FileArrayAdapter extends ArrayAdapter