From 53bf55b1e9047a1065580a4e024fb5a74c5ec94a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Aug 2013 13:05:42 -0400 Subject: [PATCH] [Android] Make the file browser look much more nice and user friendly to use. This is what it now looks like: http://i.imgur.com/KOZgA1i.png As usual, if any bugs arise from this rather large change. Please report it so I can fix it. --- .../res/drawable-hdpi/ic_menu_file.png | Bin 0 -> 510 bytes .../res/drawable-hdpi/ic_menu_folder.png | Bin 0 -> 1449 bytes .../res/drawable-mdpi/ic_menu_file.png | Bin 0 -> 487 bytes .../res/drawable-mdpi/ic_menu_folder.png | Bin 0 -> 1312 bytes .../res/drawable-xhdpi/ic_menu_file.png | Bin 0 -> 580 bytes .../res/drawable-xhdpi/ic_menu_folder.png | Bin 0 -> 1617 bytes Source/Android/res/layout/about_layout.xml | 29 +++++ Source/Android/res/layout/folderbrowser.xml | 66 ++++++---- .../dolphinemu/dolphinemu/AboutFragment.java | 9 +- .../dolphinemu/dolphinemu/FolderBrowser.java | 18 +-- .../dolphinemu/FolderBrowserAdapter.java | 67 +++++++---- .../dolphinemu/FolderBrowserItem.java | 113 ++++++++++++++++++ .../dolphinemu/InputConfigItem.java | 48 +++++++- .../dolphinemu/dolphinemu/NativeLibrary.java | 11 +- .../dolphinemu/SideMenuAdapter.java | 48 ++++---- .../dolphinemu/dolphinemu/SideMenuItem.java | 34 +++++- 16 files changed, 346 insertions(+), 97 deletions(-) create mode 100644 Source/Android/res/drawable-hdpi/ic_menu_file.png create mode 100644 Source/Android/res/drawable-hdpi/ic_menu_folder.png create mode 100644 Source/Android/res/drawable-mdpi/ic_menu_file.png create mode 100644 Source/Android/res/drawable-mdpi/ic_menu_folder.png create mode 100644 Source/Android/res/drawable-xhdpi/ic_menu_file.png create mode 100644 Source/Android/res/drawable-xhdpi/ic_menu_folder.png create mode 100644 Source/Android/res/layout/about_layout.xml create mode 100644 Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserItem.java diff --git a/Source/Android/res/drawable-hdpi/ic_menu_file.png b/Source/Android/res/drawable-hdpi/ic_menu_file.png new file mode 100644 index 0000000000000000000000000000000000000000..f2047409059b819113f6ea6e455408f71a1f8bd0 GIT binary patch literal 510 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!pj3%#L`iUdT1k0gQ7S_~VrE{6o}X)oLYc9i zsh**M!Iz?iKx1<~T^vI)oZsH?^*S6Na`a;#i=(@ig`mswzPl|ij-i&J*KJ5-4(oKg|7q)wH_nmWx5OV+h2Pk~$h;xS zl3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT&-v*t}wBFaZNhzap_f-%!s00+w{G(#^lGsVi))Y-tz$kfu*$-vFf(ACh=#L&{!#L3yw z&D7A`#K{n**Cju>G&eP`1g19yq1O?oUQlAlEdbi=l3J8mmYU*Ll%J~r_Ow+dZnv1@ zG!Lpb1-Dx)aO%|uIz}H9wMbD769T3m5EGtofgE_!Pt60S_ab1z{wZbfoq>T#+SA1` zq~g|_8P?v+jv}p_Dp@~=$xgtPq#)P z%r4Ndv#``w+)uE{NA0AVHFxpDW>=w2_s{J7eBq;wzRp!wes$hs@66N9ng*QPnuI#0+5R`O+qGj##Dba! zOkYC;c^Y4C;HsF@TRDMe7yGNV`WLvv4ou{44%&B0Haz<2BPru28GmMcIV|&Wwbj8a zWu{M$?wh{hcAbCuVPVKXBEp6XG=T%rpOPOhc2>jX*QkOaQNc6CcX>&ayM5vPIvh&nzP~? zH)eMwkEtC#j{N=#~#y;ro0 zNp+qJcN@ov+=At|LbpwBe!6MBhq@Ia~A@BM6^rfve8KA<`)78&q Iol`;+00R>g-v9sr literal 0 HcmV?d00001 diff --git a/Source/Android/res/drawable-mdpi/ic_menu_file.png b/Source/Android/res/drawable-mdpi/ic_menu_file.png new file mode 100644 index 0000000000000000000000000000000000000000..dee2577897d33842c1c9677191bf04834c5c5aef GIT binary patch literal 487 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv00042Nkl5QX725b=VkcMwc8 zF%t|GuZW^38X0KdV;U%mrasYl{$U%M=HRR_TMZg~!4`eWn%;4{2TjvdWs8w)F_JAt zvc*WYSXhw74ok8rTe2oAL(4KNu5Zg0GyL&q`H;^JZ$s%b8M4>ndbeyb!_(31OJ3z= zM64x4_D)>ymMvz|05oJvXJozuYgkK$?5()oEnCc_0eC8!yEP7L$^5MW=449F)Tz literal 0 HcmV?d00001 diff --git a/Source/Android/res/drawable-mdpi/ic_menu_folder.png b/Source/Android/res/drawable-mdpi/ic_menu_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..cc81e57f7ecc485edb05d35c1efda39a45bc3e85 GIT binary patch literal 1312 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%qp275hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8hm3bwJ6}oxF$}kgLQj3#|G7CyF^YauyCMG83 zmzLNn0bL65LT&-v*t}wBFaZNhzap_f-%!s00+w{G(#^lGsVi)%+$!x$j!ji$-vFf(ACh=#L&{!#L3yw z&D7A`#K{n**Cju>G&eP`1g19yq1OozuV4URX z;uunK>&^7tUd)anZRN!mAFx_S3%=1=v&SUNu5s!Oj;I?y8TK{XHO-BP;NB({7wE$3 zx|T&*siRBaii`0-`#A^FPWT9IcGoR?pzJF4?DqdNmXlkK&3K?6K7&JrNy&ht&Ee$7 z7_m1^vv;r>eX`^db2#`hhCPDWyO4W{QvQvXioDAXG)!Z7{o!fj(wA(Xqf|3eHrfa$ z2;DK=$uGQz$^R=$&y>Y?C*LsAFxR}mnszYFmNBn}H|!w$?ju)i?LDgYPZZkH$Xmen z%tfj1XiB^C@23Z>qOFtnh6>6wXBs@tJRQbw*BbVQr6SJ^xCc3+DXuwCe8_>Voac)5e+g=n8|A-8U8F8KBM zc;A0>)*a`$Eeh_kEAM{!F bu}Uy#vJ`o5dtB`eDziLY{an^LB{Ts5!e_@2 literal 0 HcmV?d00001 diff --git a/Source/Android/res/drawable-xhdpi/ic_menu_file.png b/Source/Android/res/drawable-xhdpi/ic_menu_file.png new file mode 100644 index 0000000000000000000000000000000000000000..85369c338e1ffb721b44f074f4a515c1b25858af GIT binary patch literal 580 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fyQq3ba4!+h){Dhagyq521M`nKFdMt_Tq$1h{ezyI!@>Oy!Ga?G z3mZE+%%xT*h|OAh=k2k3sk5pMP8ZqySI(4g)0>`M>o%)7s~eRlVIvMRWfyR`i^}>0 zT<IrVzW6TQ}t0$b3 zj$!=su_%i1_XigJ4>1o!*ijrCpKM`q61%M0=-_K*aI?w5c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%uvD1M9IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr4|esh**NZ(?$0 z9!LbN!`Ii!Gq1QLF)umQ)5TT^Xog;9W{Q=osk4Ebk*TSvlYyI|p{t>#iJ_&diIcOV zo2j9>iIX8ruSMv>2~2MaLa!N4y`aR9TL84#CABECEH%ZgC_h&L>}jh^+-@<( zX&zK>3U0TU;MA)Rbc{YIYLTKECIn1BASOKF0y*%cpPC0u??u3by?xuI_Y4e7hdo^! zLn>~)ndO@;94OMJe%Uar`<=@hw}bow%w67^D`LaM-%b6;_&x7P{Db;}*XQTz&d|_kn7I#jXxhcG+-ZeKHZl#zn2LfWhEPQq)NyA%4&82@&$Nw7WM$Hg&&_4z@?`K)hPr`L!o z1hPLrV5oaLVgKTzb02c;IQ{x;-`fPSJLj4kQncnUsBh13C~u6Ot*CHok>DFswoQJo zPZZ9LV9j4za&9Ms=40_+x(OUH?B<#a0`3MsnGiHT^1ioB>ftLVikpw$|GPiu-?_H8 zTe}-_6XfaFT_)#c|DCU=X=ql=`>>uvB1Few)eY5m8GcMk%l;|d;O*1!|3ASu=xk`i zoB#Pc!o94kBR(?C(0LYm{d2>TJGIAt3$9x*>-qod^=JQ=F}+&(x4wmKYg@`^lOI!D z511Fse`zmM^1px5o-fwIk+T-gF#W9Y{2yOh%eD4+#^OkpEi=rnM|{g#_wSUAe8h=c zeC8IP8XtX`zVgnKsB5pD**JXOE|Ee?{F4e0Q)VQzgU`k<}Q<8gs zF>kTD&%)9#;lb&WGg(Y_mao&yYj{#QuYA?Ne^G|N|13(8V@atByc{>x6p@NRNowA) bd`32g_eBr8pZZM60u}O}u6{1-oD!M + + + + + + + + + \ No newline at end of file diff --git a/Source/Android/res/layout/folderbrowser.xml b/Source/Android/res/layout/folderbrowser.xml index 82b94e238f..61c6fba1ea 100644 --- a/Source/Android/res/layout/folderbrowser.xml +++ b/Source/Android/res/layout/folderbrowser.xml @@ -1,29 +1,43 @@ - - + android:layout_height="?android:attr/listPreferredItemHeight" + android:padding="3dip"> + + - - - - - - + + + + + diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java index 4a7b636ed6..4905027ae1 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java @@ -22,7 +22,6 @@ public class AboutFragment extends Fragment { private ListView mMainList; private FolderBrowserAdapter adapter; - private int configPosition = 0; boolean Configuring = false; boolean firstEvent = true; @@ -39,11 +38,11 @@ public class AboutFragment extends Fragment { String yes = getString(R.string.yes); String no = getString(R.string.no); - List Input = new ArrayList(); - Input.add(new GameListItem(m_activity, getString(R.string.build_revision), NativeLibrary.GetVersionString(), "", true)); - Input.add(new GameListItem(m_activity, getString(R.string.supports_gles3), PrefsFragment.SupportsGLES3() ? yes : no, "", true)); + List Input = new ArrayList(); + Input.add(new FolderBrowserItem(m_activity, getString(R.string.build_revision), NativeLibrary.GetVersionString(), "", true)); + Input.add(new FolderBrowserItem(m_activity, getString(R.string.supports_gles3), PrefsFragment.SupportsGLES3() ? yes : no, "", true)); - adapter = new FolderBrowserAdapter(m_activity, R.layout.folderbrowser, Input); + adapter = new FolderBrowserAdapter(m_activity, R.layout.about_layout, Input); mMainList.setAdapter(adapter); return mMainList; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java index 817a9152c5..aa44ad83ca 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowser.java @@ -26,8 +26,8 @@ public class FolderBrowser extends Fragment { { m_activity.setTitle(getString(R.string.current_dir) + currDir.getName()); File[] dirs = currDir.listFiles(); - Listdir = new ArrayList(); - Listfls = new ArrayList(); + Listdir = new ArrayList(); + Listfls = new ArrayList(); // Supported extensions to filter by Set validExts = new HashSet(Arrays.asList(".gcm", ".iso", ".wbfs", ".gcz", ".dol", ".elf", ".dff")); @@ -44,17 +44,17 @@ public class FolderBrowser extends Fragment { { if(entry.isDirectory()) { - dir.add(new GameListItem(m_activity, entryName, getString(R.string.folder), entry.getAbsolutePath(), true)); + dir.add(new FolderBrowserItem(m_activity, entryName, getString(R.string.folder), entry.getAbsolutePath(), true)); } else { if (validExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.')))) { - fls.add(new GameListItem(m_activity, entryName,getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), true)); + fls.add(new FolderBrowserItem(m_activity, entryName,getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), true)); } else if (invalidExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.')))) { - fls.add(new GameListItem(m_activity, entryName,getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), false)); + fls.add(new FolderBrowserItem(m_activity, entryName,getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), false)); } } } @@ -70,7 +70,7 @@ public class FolderBrowser extends Fragment { // Check for a parent directory to the one we're currently in. if (!currDir.getPath().equalsIgnoreCase("/")) - dir.add(0, new GameListItem(m_activity, "..", getString(R.string.parent_directory), currDir.getParent(), true)); + dir.add(0, new FolderBrowserItem(m_activity, "..", getString(R.string.parent_directory), currDir.getParent(), true)); adapter = new FolderBrowserAdapter(m_activity, R.layout.folderbrowser, dir); mDrawerList = (ListView) rootView.findViewById(R.id.gamelist); @@ -94,15 +94,15 @@ public class FolderBrowser extends Fragment { { public void onItemClick(AdapterView parent, View view, int position, long id) { - GameListItem o = adapter.getItem(position); - if(o.getData().equalsIgnoreCase(getString(R.string.folder)) || o.getData().equalsIgnoreCase(getString(R.string.parent_directory))) + FolderBrowserItem o = adapter.getItem(position); + if(o.isDirectory() || o.getSubtitle().equalsIgnoreCase(getString(R.string.parent_directory))) { currentDir = new File(o.getPath()); Fill(currentDir); } else { - if (o.isValid()) + if (o.isValidItem()) FolderSelected(); else Toast.makeText(m_activity, getString(R.string.cant_use_compressed_filetypes), Toast.LENGTH_LONG).show(); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java index 30c1747781..0c38aa7b2f 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserAdapter.java @@ -1,58 +1,79 @@ package org.dolphinemu.dolphinemu; import android.content.Context; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; +import android.widget.ImageView; import android.widget.TextView; import java.util.List; -public class FolderBrowserAdapter extends ArrayAdapter{ +public class FolderBrowserAdapter extends ArrayAdapter{ private Context c; private int id; - private Listitems; + private List items; - public FolderBrowserAdapter(Context context, int textViewResourceId, - List objects) { + public FolderBrowserAdapter(Context context, int textViewResourceId, List objects) { super(context, textViewResourceId, objects); c = context; id = textViewResourceId; items = objects; } - public GameListItem getItem(int i) + public FolderBrowserItem getItem(int i) { return items.get(i); } + @Override - public View getView(int position, View convertView, ViewGroup parent) { + 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); + if (v == null) + { + LayoutInflater vi = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + v = vi.inflate(id, parent, false); } - 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); + + final FolderBrowserItem item = items.get(position); + if (item != null) + { + ImageView iconView = (ImageView) v.findViewById(R.id.ImageIcon); + TextView mainText = (TextView) v.findViewById(R.id.FolderTitle); + TextView subtitleText = (TextView) v.findViewById(R.id.FolderSubTitle); - if(t1!=null) + if(mainText != null) { - t1.setText(o.getName()); - if (!o.isValid()) - t1.setTextColor(0xFFFF0000); + mainText.setText(item.getName()); + + if (!item.isValidItem()) + { + mainText.setTextColor(0xFFFF0000); + } + } + + if(subtitleText != null) + { + subtitleText.setText(item.getSubtitle()); + } + + if (iconView != null) + { + if (item.isDirectory()) + { + iconView.setImageResource(R.drawable.ic_menu_folder); + } + else + { + iconView.setImageResource(R.drawable.ic_menu_file); + } } - if(t2!=null) - t2.setText(o.getData()); } return v; } - - - } - diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserItem.java new file mode 100644 index 0000000000..d2f8773e24 --- /dev/null +++ b/Source/Android/src/org/dolphinemu/dolphinemu/FolderBrowserItem.java @@ -0,0 +1,113 @@ +package org.dolphinemu.dolphinemu; + +import java.io.File; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.drawable.Drawable; + +/** + * Represents an item in the folder browser list. + */ +public final class FolderBrowserItem implements Comparable +{ + private final Context ctx; + private final String name; + private final String subtitle; + private final String path; + private final boolean isValid; + private final File underlyingFile; + + /** + * Constructor + * + * @param ctx Context this FolderBrowserItem is being used in. + * @param name The name of the file/folder represented by this item. + * @param subtitle The subtitle of this FolderBrowserItem to display. + * @param path The path of the file/folder represented by this item. + * @param isValid Whether or not this item represents a file type that can be handled. + */ + public FolderBrowserItem(Context ctx, String name, String subtitle, String path, boolean isValid) + { + this.ctx = ctx; + this.name = name; + this.subtitle = subtitle; + this.path = path; + this.isValid = isValid; + this.underlyingFile = new File(path); + } + + /** + * Gets the name of the file/folder represented by this FolderBrowserItem. + * + * @return the name of the file/folder represented by this FolderBrowserItem. + */ + public String getName() + { + return name; + } + + /** + * Gets the subtitle text of this FolderBrowserItem. + * + * @return the subtitle text of this FolderBrowserItem. + */ + public String getSubtitle() + { + return subtitle; + } + + /** + * Gets the path of the file/folder represented by this FolderBrowserItem. + * + * @return the path of the file/folder represented by this FolderBrowserItem. + */ + public String getPath() + { + return path; + } + + /** + * Gets whether or not the file represented + * by this FolderBrowserItem is supported + * and can be handled correctly. + * + * @return whether or not the file represented + * by this FolderBrowserItem is supported + * and can be handled correctly. + */ + public boolean isValidItem() + { + return isValid; + } + + /** + * Gets the {@link File} representation of the underlying file/folder + * represented by this FolderBrowserItem. + * + * @return the {@link File} representation of the underlying file/folder + * represented by this FolderBrowserItem. + */ + public File getUnderlyingFile() + { + return underlyingFile; + } + + /** + * Gets whether or not this FolderBrowserItem represents a directory. + * + * @return true if this FolderBrowserItem represents a directory, false otherwise. + */ + public boolean isDirectory() + { + return underlyingFile.isDirectory(); + } + + public int compareTo(FolderBrowserItem other) + { + if(this.name != null) + return this.name.toLowerCase().compareTo(other.getName().toLowerCase()); + else + throw new IllegalArgumentException(); + } +} diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigItem.java index ff8a077703..0a6f69a1d0 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigItem.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigItem.java @@ -1,10 +1,14 @@ -package org.dolphinemu.dolphinemu; - -/** +/* * Copyright 2013 Dolphin Emulator Project * Licensed under GPLv2 * Refer to the license.txt file included. */ + +package org.dolphinemu.dolphinemu; + +/** + * Represents a controller input item (button, stick, etc). + */ public class InputConfigItem implements Comparable{ private String m_name; private String m_Config; @@ -20,27 +24,65 @@ public class InputConfigItem implements Comparable{ m_bind = NativeLibrary.GetConfig("Dolphin.ini", Key, Value, defaultBind); } + /** + * Constructor + * + * @param name Name of the input config item. + * @param config Name of the key in the configuration file that this control modifies. + * @param defaultBind Default binding to fall back upon if binding fails. + */ public InputConfigItem(String name, String config, String defaultBind) { Init(name, config, defaultBind); } + /** + * Constructor that creates an InputConfigItem + * that has a default binding of "None" + * + * @param name Name of the input config item. + * @param config Name of the key in the configuration file that this control modifies. + */ public InputConfigItem(String name, String config) { Init(name, config, "None"); } + + /** + * Gets the name of this InputConfigItem. + * + * @return the name of this InputConfigItem + */ public String getName() { return m_name; } + + /** + * Gets the config key this InputConfigItem modifies. + * + * @return the config key this InputConfigItem modifies. + */ public String getConfig() { return m_Config; } + + /** + * Gets the currently set binding of this InputConfigItem + * + * @return the currently set binding of this InputConfigItem + */ public String getBind() { return m_bind; } + + /** + * Sets a new binding for this InputConfigItem. + * + * @param bind The new binding. + */ public void setBind(String bind) { m_bind = bind; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java index f089362c38..da58274c5f 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -1,12 +1,17 @@ +/* + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu; import android.util.Log; import android.view.Surface; /** - * Copyright 2013 Dolphin Emulator Project - * Licensed under GPLv2 - * Refer to the license.txt file included. + * Class which contains methods that interact + * with the native side of the Dolphin code. */ public class NativeLibrary { public static native void onTouchEvent(int Action, float X, float Y); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java index 599ce5007a..eb2143becb 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuAdapter.java @@ -16,34 +16,38 @@ public class SideMenuAdapter extends ArrayAdapter{ private Listitems; public SideMenuAdapter(Context context, int textViewResourceId, - List objects) { + List objects) + { super(context, textViewResourceId, objects); c = context; id = textViewResourceId; items = objects; } + public SideMenuItem 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 SideMenuItem o = items.get(position); - if (o != null) { - TextView t1 = (TextView) v.findViewById(R.id.SideMenuTitle); - - if(t1!=null) - t1.setText(o.getName()); - } - return v; - } - - - + } + @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 SideMenuItem o = items.get(position); + if (o != null) + { + TextView t1 = (TextView) v.findViewById(R.id.SideMenuTitle); + + if(t1!=null) + t1.setText(o.getName()); + } + + return v; + } } diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuItem.java index e24842bed1..6d204d0d69 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuItem.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/SideMenuItem.java @@ -1,25 +1,47 @@ -package org.dolphinemu.dolphinemu; - -/** +/* * Copyright 2013 Dolphin Emulator Project * Licensed under GPLv2 * Refer to the license.txt file included. */ -public class SideMenuItem implements Comparable{ +package org.dolphinemu.dolphinemu; + + +/** + * Represents an item that goes in the sidemenu of the app. + */ +public class SideMenuItem implements Comparable +{ private String m_name; private int m_id; - public SideMenuItem(String n, int id) + /** + * Constructor + * + * @param name The name of the SideMenuItem. + * @param id ID number of this specific SideMenuItem. + */ + public SideMenuItem(String name, int id) { - m_name = n; + m_name = name; m_id = id; } + /** + * Gets the name of this SideMenuItem. + * + * @return the name of this SideMenuItem. + */ public String getName() { return m_name; } + + /** + * Gets the ID of this SideMenuItem. + * + * @return the ID of this SideMenuItem. + */ public int getID() { return m_id;