summaryrefslogtreecommitdiff
path: root/Source/Android/src
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-06-22 07:45:05 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2013-06-22 07:45:05 -0500
commit2b9f79dff32b16c5f61dcf4da643cca67c599833 (patch)
treecd50f1f83c69558027298c0535127f2621c4ab9d /Source/Android/src
parent15943de3135dbc23fc337d00ae67d51d8fd389f3 (diff)
[Android] Remove SimonVT menudrawer library. Move to Google's support library for their navigation drawer support. Overall cleanup.
Diffstat (limited to 'Source/Android/src')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java2
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java4
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java53
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java292
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java10
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java225
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java4
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/InputConfigAdapter.java4
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java6
9 files changed, 360 insertions, 240 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
index 3c11ed76c6..d8559c1393 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
@@ -77,7 +77,7 @@ public class DolphinEmulator<MainActivity> extends Activity
if (savedInstanceState == null)
{
- Intent ListIntent = new Intent(this, GameListView.class);
+ Intent ListIntent = new Intent(this, GameListActivity.class);
startActivityForResult(ListIntent, 1);
// Make the assets directory
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java
index 0ff58cdb39..0ceb776a77 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java
@@ -16,7 +16,7 @@ import java.util.Collections;
import java.util.List;
public class FolderBrowser extends ListActivity {
- private GameListAdapter adapter;
+ private FolderBrowserAdapter adapter;
private static File currentDir = null;
private void Fill(File f)
{
@@ -52,7 +52,7 @@ public class FolderBrowser extends ListActivity {
if (!f.getPath().equalsIgnoreCase("/"))
dir.add(0, new GameListItem(getApplicationContext(), "..", "Parent Directory", f.getParent()));
- adapter = new GameListAdapter(this,R.layout.folderbrowser,dir);
+ adapter = new FolderBrowserAdapter(this,R.layout.folderbrowser,dir);
this.setListAdapter(adapter);
}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java
new file mode 100644
index 0000000000..b201125a62
--- /dev/null
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java
@@ -0,0 +1,53 @@
+package org.dolphinemu.dolphinemu;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.TextView;
+
+import java.util.List;
+
+public class FolderBrowserAdapter extends ArrayAdapter<GameListItem>{
+
+ private Context c;
+ private int id;
+ private List<GameListItem>items;
+
+ public FolderBrowserAdapter(Context context, int textViewResourceId,
+ List<GameListItem> objects) {
+ super(context, textViewResourceId, objects);
+ c = context;
+ id = textViewResourceId;
+ items = objects;
+ }
+ public GameListItem getItem(int i)
+ {
+ return items.get(i);
+ }
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if (v == null) {
+ LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ v = vi.inflate(id, null);
+ }
+ final GameListItem o = items.get(position);
+ if (o != null) {
+ TextView t1 = (TextView) v.findViewById(R.id.FolderTitle);
+ TextView t2 = (TextView) v.findViewById(R.id.FolderSubTitle);
+
+ if(t1!=null)
+ t1.setText(o.getName());
+ if(t2!=null)
+ t2.setText(o.getData());
+
+ }
+ return v;
+ }
+
+
+
+}
+
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java
new file mode 100644
index 0000000000..9e9de31dab
--- /dev/null
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java
@@ -0,0 +1,292 @@
+package org.dolphinemu.dolphinemu;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.app.FragmentManager;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.support.v4.app.ActionBarDrawerToggle;
+import android.support.v4.widget.DrawerLayout;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ListView;
+import android.widget.Toast;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Copyright 2013 Dolphin Emulator Project
+ * Licensed under GPLv2
+ * Refer to the license.txt file included.
+ */
+public class GameListActivity extends Activity {
+
+ enum keyTypes {TYPE_STRING, TYPE_BOOL};
+
+ private ActionBarDrawerToggle mDrawerToggle;
+ private DrawerLayout mDrawerLayout;
+ private SideMenuAdapter mDrawerAdapter;
+ private ListView mDrawerList;
+
+ private static GameListActivity me;
+
+ public static class GameListFragment extends Fragment {
+ private ListView mMainList;
+ private GameListAdapter mGameAdapter;
+
+ public GameListFragment() {
+ // Empty constructor required for fragment subclasses
+ }
+ private void Fill()
+ {
+ List<GameListItem>fls = new ArrayList<GameListItem>();
+ String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0");
+ int intDirectories = Integer.parseInt(Directories);
+ for (int a = 0; a < intDirectories; ++a)
+ {
+ String BrowseDir = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(a), "");
+ File currentDir = new File(BrowseDir);
+ File[]dirs = currentDir.listFiles();
+ try
+ {
+ for(File ff: dirs)
+ {
+ if (ff.getName().charAt(0) != '.')
+ if(!ff.isDirectory())
+ 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") ||
+ ff.getName().toLowerCase().contains(".dff"))
+ fls.add(new GameListItem(me.getApplicationContext(), ff.getName(),"File Size: "+ff.length(),ff.getAbsolutePath()));
+ }
+ }
+ catch(Exception ignored)
+ {
+ }
+ }
+ Collections.sort(fls);
+
+ mGameAdapter = new GameListAdapter(me, R.layout.gamelist_layout, fls);
+ mMainList.setAdapter(mGameAdapter);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
+ mMainList = (ListView) rootView.findViewById(R.id.gamelist);
+ mMainList.setOnItemClickListener(mGameItemClickListener);
+
+ Fill();
+
+ return mMainList;
+ }
+ private AdapterView.OnItemClickListener mGameItemClickListener = new AdapterView.OnItemClickListener()
+ {
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
+ {
+ GameListItem o = mGameAdapter.getItem(position);
+ if(!(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")))
+ {
+ onFileClick(o.getPath());
+ }
+ }
+ };
+ private void onFileClick(String o)
+ {
+ Toast.makeText(me, "File Clicked: " + o, Toast.LENGTH_SHORT).show();
+
+ Intent intent = new Intent();
+ intent.putExtra("Select", o);
+ me.setResult(Activity.RESULT_OK, intent);
+
+ me.finish();
+ }
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.gamelist_activity);
+ me = this;
+
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+ mDrawerList = (ListView) findViewById(R.id.left_drawer);
+
+ List<SideMenuItem> dir = new ArrayList<SideMenuItem>();
+ dir.add(new SideMenuItem("Browse Folder", 0));
+ dir.add(new SideMenuItem("Settings", 1));
+ dir.add(new SideMenuItem("Gamepad Config", 2));
+
+ mDrawerAdapter = new SideMenuAdapter(this, R.layout.sidemenu, dir);
+ mDrawerList.setAdapter(mDrawerAdapter);
+ mDrawerList.setOnItemClickListener(mMenuItemClickListener);
+
+ // enable ActionBar app icon to behave as action to toggle nav drawer
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ getActionBar().setHomeButtonEnabled(true);
+
+ // ActionBarDrawerToggle ties together the the proper interactions
+ // between the sliding drawer and the action bar app icon
+ mDrawerToggle = new ActionBarDrawerToggle(
+ this, /* host Activity */
+ mDrawerLayout, /* DrawerLayout object */
+ R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
+ R.string.drawer_open, /* "open drawer" description for accessibility */
+ R.string.drawer_close /* "close drawer" description for accessibility */
+ ) {
+ };
+ mDrawerLayout.setDrawerListener(mDrawerToggle);
+
+ recreateFragment();
+ }
+
+ private void recreateFragment()
+ {
+ Fragment fragment = new GameListFragment();
+ FragmentManager fragmentManager = getFragmentManager();
+ fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
+ }
+
+ private AdapterView.OnItemClickListener mMenuItemClickListener = new AdapterView.OnItemClickListener()
+ {
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
+ {
+ SideMenuItem o = mDrawerAdapter.getItem(position);
+ mDrawerLayout.closeDrawer(mDrawerList);
+
+ switch(o.getID())
+ {
+ case 0:
+ Toast.makeText(me, "Loading up the browser", Toast.LENGTH_SHORT).show();
+ Intent ListIntent = new Intent(me, FolderBrowser.class);
+ startActivityForResult(ListIntent, 1);
+ break;
+ case 1:
+ Toast.makeText(me, "Loading up settings", Toast.LENGTH_SHORT).show();
+ Intent SettingIntent = new Intent(me, PrefsActivity.class);
+ startActivityForResult(SettingIntent, 2);
+ break;
+ case 2:
+ Toast.makeText(me, "Loading up gamepad config", Toast.LENGTH_SHORT).show();
+ Intent ConfigIntent = new Intent(me, InputConfigActivity.class);
+ startActivityForResult(ConfigIntent, 3);
+ break;
+ default:
+ break;
+ }
+
+ }
+ };
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data)
+ {
+ super.onActivityResult(requestCode, resultCode, data);
+
+ switch (requestCode)
+ {
+ // Browse
+ case 1:
+ if (resultCode == Activity.RESULT_OK)
+ {
+ String FileName = data.getStringExtra("Select");
+ Toast.makeText(this, "Folder Selected: " + FileName, Toast.LENGTH_SHORT).show();
+ String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0");
+ int intDirectories = Integer.parseInt(Directories);
+ Directories = Integer.toString(intDirectories + 1);
+ NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", Directories);
+ NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), FileName);
+
+ recreateFragment();
+ }
+ break;
+ // Settings
+ case 2:
+
+ String Keys[] = {
+ "cpupref",
+ "dualcorepref",
+ "gpupref",
+ };
+ String ConfigKeys[] = {
+ "Core-CPUCore",
+ "Core-CPUThread",
+ "Core-GFXBackend",
+ };
+
+ keyTypes KeysTypes[] = {
+ keyTypes.TYPE_STRING,
+ keyTypes.TYPE_BOOL,
+ keyTypes.TYPE_STRING,
+ };
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+
+ // Set our preferences here
+ for (int a = 0; a < Keys.length; ++a)
+ {
+ String ConfigValues[] = ConfigKeys[a].split("-");
+ String Key = ConfigValues[0];
+ String Value = ConfigValues[1];
+
+ switch(KeysTypes[a])
+ {
+ case TYPE_STRING:
+ String strPref = prefs.getString(Keys[a], "");
+ NativeLibrary.SetConfig("Dolphin.ini", Key, Value, strPref);
+ break;
+ case TYPE_BOOL:
+ boolean boolPref = prefs.getBoolean(Keys[a], true);
+ NativeLibrary.SetConfig("Dolphin.ini", Key, Value, boolPref ? "True" : "False");
+ break;
+ }
+
+ }
+ break;
+ case 3: // Gamepad settings
+ /* Do Nothing */
+ break;
+ }
+ }
+ /**
+ * When using the ActionBarDrawerToggle, you must call it during
+ * onPostCreate() and onConfigurationChanged()...
+ */
+
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ // Sync the toggle state after onRestoreInstanceState has occurred.
+ mDrawerToggle.syncState();
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ // Pass any configuration change to the drawer toggls
+ mDrawerToggle.onConfigurationChanged(newConfig);
+ }
+
+ /* Called whenever we call invalidateOptionsMenu() */
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ return super.onPrepareOptionsMenu(menu);
+ }
+ public void onBackPressed()
+ {
+
+ }
+
+
+}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java
index f0aa522a1f..a970db2f2a 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListAdapter.java
@@ -1,7 +1,5 @@
package org.dolphinemu.dolphinemu;
-import java.util.List;
-
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
@@ -10,6 +8,8 @@ import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
+import java.util.List;
+
public class GameListAdapter extends ArrayAdapter<GameListItem>{
private Context c;
@@ -36,9 +36,9 @@ public class GameListAdapter extends ArrayAdapter<GameListItem>{
}
final GameListItem o = items.get(position);
if (o != null) {
- TextView t1 = (TextView) v.findViewById(R.id.TextView01);
- TextView t2 = (TextView) v.findViewById(R.id.TextView02);
- ImageView v1 = (ImageView) v.findViewById(R.id.imageView1);
+ TextView t1 = (TextView) v.findViewById(R.id.GameItemTitle);
+ TextView t2 = (TextView) v.findViewById(R.id.GameItemSubText);
+ ImageView v1 = (ImageView) v.findViewById(R.id.GameItemIcon);
if(t1!=null)
t1.setText(o.getName());
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java
deleted file mode 100644
index 4a88977a5b..0000000000
--- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListView.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package org.dolphinemu.dolphinemu;
-
-import android.app.Activity;
-import android.app.ListActivity;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.view.KeyEvent;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ListView;
-import android.widget.Toast;
-import net.simonvt.menudrawer.MenuDrawer;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public class GameListView extends ListActivity {
- private GameListAdapter adapter;
- private MenuDrawer mDrawer;
-
- private SideMenuAdapter mAdapter;
- private static GameListView me;
-
- enum keyTypes {TYPE_STRING, TYPE_BOOL};
-
- private void Fill()
- {
- this.setTitle("Game List");
- List<GameListItem>fls = new ArrayList<GameListItem>();
- String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0");
- int intDirectories = Integer.parseInt(Directories);
- for (int a = 0; a < intDirectories; ++a)
- {
- String BrowseDir = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(a), "");
- File currentDir = new File(BrowseDir);
- File[]dirs = currentDir.listFiles();
- try
- {
- for(File ff: dirs)
- {
- if (ff.getName().charAt(0) != '.')
- if(!ff.isDirectory())
- 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") ||
- ff.getName().toLowerCase().contains(".dff"))
- fls.add(new GameListItem(getApplicationContext(), ff.getName(),"File Size: "+ff.length(),ff.getAbsolutePath()));
- }
- }
- catch(Exception ignored)
- {
- }
- }
- Collections.sort(fls);
-
- adapter = new GameListAdapter(this,R.layout.main, fls);
- this.setListAdapter(adapter);
- }
-
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- super.onListItemClick(l, v, position, id);
- GameListItem o = adapter.getItem(position);
- if(!(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")))
- {
- onFileClick(o.getPath());
- }
- }
-
- private void onFileClick(String o)
- {
- Toast.makeText(this, "File Clicked: " + o, Toast.LENGTH_SHORT).show();
-
- Intent intent = new Intent();
- intent.putExtra("Select", o);
- setResult(Activity.RESULT_OK, intent);
-
- this.finish();
- }
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data)
- {
- super.onActivityResult(requestCode, resultCode, data);
-
- switch (requestCode)
- {
- // Browse
- case 1:
- if (resultCode == Activity.RESULT_OK)
- {
- String FileName = data.getStringExtra("Select");
- Toast.makeText(this, "Folder Selected: " + FileName, Toast.LENGTH_SHORT).show();
- String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0");
- int intDirectories = Integer.parseInt(Directories);
- Directories = Integer.toString(intDirectories + 1);
- NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", Directories);
- NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), FileName);
-
- Fill();
- }
- break;
- // Settings
- case 2:
-
- String Keys[] = {
- "cpupref",
- "dualcorepref",
- "gpupref",
- };
- String ConfigKeys[] = {
- "Core-CPUCore",
- "Core-CPUThread",
- "Core-GFXBackend",
- };
-
- keyTypes KeysTypes[] = {
- keyTypes.TYPE_STRING,
- keyTypes.TYPE_BOOL,
- keyTypes.TYPE_STRING,
- };
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-
- // Set our preferences here
- for (int a = 0; a < Keys.length; ++a)
- {
- String ConfigValues[] = ConfigKeys[a].split("-");
- String Key = ConfigValues[0];
- String Value = ConfigValues[1];
-
- switch(KeysTypes[a])
- {
- case TYPE_STRING:
- String strPref = prefs.getString(Keys[a], "");
- NativeLibrary.SetConfig("Dolphin.ini", Key, Value, strPref);
- break;
- case TYPE_BOOL:
- boolean boolPref = prefs.getBoolean(Keys[a], true);
- NativeLibrary.SetConfig("Dolphin.ini", Key, Value, boolPref ? "True" : "False");
- break;
- }
-
- }
- break;
- case 3: // Gamepad settings
- /* Do Nothing */
- break;
- }
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- me = this;
-
- mDrawer = MenuDrawer.attach(this, MenuDrawer.MENU_DRAG_CONTENT);
- Fill();
-
- List<SideMenuItem>dir = new ArrayList<SideMenuItem>();
- dir.add(new SideMenuItem("Browse Folder", 0));
- dir.add(new SideMenuItem("Settings", 1));
- dir.add(new SideMenuItem("Gamepad Config", 2));
-
- ListView mList = new ListView(this);
- mAdapter = new SideMenuAdapter(this,R.layout.sidemenu,dir);
- mList.setAdapter(mAdapter);
- mList.setOnItemClickListener(mItemClickListener);
-
- mDrawer.setMenuView(mList);
- }
- private AdapterView.OnItemClickListener mItemClickListener = new AdapterView.OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- SideMenuItem o = mAdapter.getItem(position);
-
- switch(o.getID())
- {
- case 0:
- Toast.makeText(me, "Loading up the browser", Toast.LENGTH_SHORT).show();
- Intent ListIntent = new Intent(me, FolderBrowser.class);
- startActivityForResult(ListIntent, 1);
- break;
- case 1:
- Toast.makeText(me, "Loading up settings", Toast.LENGTH_SHORT).show();
- Intent SettingIntent = new Intent(me, PrefsActivity.class);
- startActivityForResult(SettingIntent, 2);
- break;
- case 2:
- Toast.makeText(me, "Loading up settings", Toast.LENGTH_SHORT).show();
- Intent ConfigIntent = new Intent(me, InputConfigActivity.class);
- startActivityForResult(ConfigIntent, 3);
- break;
- default:
- break;
- }
- mDrawer.closeMenu();
- }
- };
- @Override
- public void setContentView(int layoutResID) {
- // This override is only needed when using MENU_DRAG_CONTENT.
- mDrawer.setContentView(layoutResID);
- onContentChanged();
- }
-
- @Override
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- if (event.getAction() == KeyEvent.KEYCODE_MENU|| event.getAction() == KeyEvent.KEYCODE_BACK) {
- final int drawerState = mDrawer.getDrawerState();
- if (drawerState == MenuDrawer.STATE_OPEN || drawerState == MenuDrawer.STATE_OPENING) {
- mDrawer.closeMenu();
- return true;
- }
- mDrawer.openMenu();
- return true;
- }
- return false;
- }
-}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java
index 1df812b830..d7132a4aff 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java
@@ -55,8 +55,8 @@ public class InputConfigActivity extends ListActivity {
Input.add(a++, new InputConfigItem("Trigger L", "Android-InputL"));
Input.add(a++, new InputConfigItem("Trigger R", "Android-InputR"));
- adapter = new InputConfigAdapter(this,R.layout.folderbrowser, Input);
- this.setListAdapter(adapter);
+ adapter = new InputConfigAdapter(this, R.layout.folderbrowser, Input);
+ setListAdapter(adapter);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigAdapter.java
index 4430126d46..b0984dd08a 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigAdapter.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigAdapter.java
@@ -40,8 +40,8 @@ public class InputConfigAdapter extends ArrayAdapter<InputConfigItem> {
}
final InputConfigItem o = items.get(position);
if (o != null) {
- TextView t1 = (TextView) v.findViewById(R.id.TextView01);
- TextView t2 = (TextView) v.findViewById(R.id.TextView02);
+ TextView t1 = (TextView) v.findViewById(R.id.FolderTitle);
+ TextView t2 = (TextView) v.findViewById(R.id.FolderSubTitle);
if(t1!=null)
t1.setText(o.getName());
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java
index e1c0ed5e31..599ce5007a 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java
@@ -1,7 +1,5 @@
package org.dolphinemu.dolphinemu;
-import java.util.List;
-
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
@@ -9,6 +7,8 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
+import java.util.List;
+
public class SideMenuAdapter extends ArrayAdapter<SideMenuItem>{
private Context c;
@@ -35,7 +35,7 @@ public class SideMenuAdapter extends ArrayAdapter<SideMenuItem>{
}
final SideMenuItem o = items.get(position);
if (o != null) {
- TextView t1 = (TextView) v.findViewById(R.id.TextView01);
+ TextView t1 = (TextView) v.findViewById(R.id.SideMenuTitle);
if(t1!=null)
t1.setText(o.getName());