[Android] Format all Java files to be consistent.

This commit is contained in:
Lioncash 2013-08-22 03:43:07 -04:00
parent f09cafb2be
commit 7c99b0650b
17 changed files with 948 additions and 944 deletions

View File

@ -21,8 +21,8 @@ import org.dolphinemu.dolphinemu.settings.UserPreferences;
public final class DolphinEmulator<MainActivity> extends Activity public final class DolphinEmulator<MainActivity> extends Activity
{ {
static private NativeGLSurfaceView GLview = null; private static NativeGLSurfaceView GLview = null;
static private boolean Running = false; private static boolean Running = false;
private float screenWidth; private float screenWidth;
private float screenHeight; private float screenHeight;
@ -40,7 +40,7 @@ public final class DolphinEmulator<MainActivity> extends Activity
in.close(); in.close();
out.close(); out.close();
} }
catch(IOException e) catch (IOException e)
{ {
Log.e("DolphinEmulator", "Failed to copy asset file: " + asset, e); Log.e("DolphinEmulator", "Failed to copy asset file: " + asset, e);
} }
@ -51,7 +51,7 @@ public final class DolphinEmulator<MainActivity> extends Activity
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int read; int read;
while((read = in.read(buffer)) != -1) while ((read = in.read(buffer)) != -1)
{ {
out.write(buffer, 0, read); out.write(buffer, 0, read);
} }

View File

@ -6,9 +6,9 @@ import android.view.SurfaceView;
public final class NativeGLSurfaceView extends SurfaceView public final class NativeGLSurfaceView extends SurfaceView
{ {
static private Thread myRun; private static Thread myRun;
static private boolean Running = false; private static boolean Running = false;
static private boolean Created = false; private static boolean Created = false;
public NativeGLSurfaceView(Context context) public NativeGLSurfaceView(Context context)
{ {
@ -23,7 +23,8 @@ public final class NativeGLSurfaceView extends SurfaceView
} }
}; };
getHolder().addCallback(new SurfaceHolder.Callback() { getHolder().addCallback(new SurfaceHolder.Callback()
{
public void surfaceCreated(SurfaceHolder holder) public void surfaceCreated(SurfaceHolder holder)
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -82,7 +82,6 @@ public final class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>
iconView.setImageResource(R.drawable.ic_menu_file); iconView.setImageResource(R.drawable.ic_menu_file);
} }
} }
} }
return v; return v;
} }

View File

@ -33,7 +33,6 @@ public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
/** /**
* Constructor. Initializes a FolderBrowserItem with an empty subtitle. * Constructor. Initializes a FolderBrowserItem with an empty subtitle.
* *
* @param ctx Context this FolderBrowserItem is being used in.
* @param name The name of the file/folder represented by this item. * @param name The name of the file/folder represented by this item.
* @param path The path of the file/folder represented by this item. * @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. * @param isValid Whether or not this item represents a file type that can be handled.

View File

@ -271,5 +271,4 @@ public final class GameListActivity extends Activity
return super.dispatchKeyEvent(event); return super.dispatchKeyEvent(event);
} }
} }

View File

@ -48,13 +48,13 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
TextView subtitle = (TextView) v.findViewById(R.id.GameItemSubText); TextView subtitle = (TextView) v.findViewById(R.id.GameItemSubText);
ImageView icon = (ImageView) v.findViewById(R.id.GameItemIcon); ImageView icon = (ImageView) v.findViewById(R.id.GameItemIcon);
if(title != null) if (title != null)
title.setText(item.getName()); title.setText(item.getName());
if(subtitle != null) if (subtitle != null)
subtitle.setText(item.getData()); subtitle.setText(item.getData());
if(icon != null) if (icon != null)
{ {
icon.setImageBitmap(item.getImage()); icon.setImageBitmap(item.getImage());
icon.getLayoutParams().width = (int) ((860 / c.getResources().getDisplayMetrics().density) + 0.5); icon.getLayoutParams().width = (int) ((860 / c.getResources().getDisplayMetrics().density) + 0.5);

View File

@ -60,13 +60,13 @@ public final class GameListFragment extends Fragment
File[] dirs = currentDir.listFiles(); File[] dirs = currentDir.listFiles();
try try
{ {
for(File entry : dirs) for (File entry : dirs)
{ {
String entryName = entry.getName(); String entryName = entry.getName();
if (entryName.charAt(0) != '.') if (entryName.charAt(0) != '.')
{ {
if(!entry.isDirectory()) if (!entry.isDirectory())
{ {
if (exts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.')))) if (exts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
fls.add(new GameListItem(mMe.getApplicationContext(), entryName, getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), true)); fls.add(new GameListItem(mMe.getApplicationContext(), entryName, getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), true));
@ -74,7 +74,7 @@ public final class GameListFragment extends Fragment
} }
} }
} }
catch(Exception ignored) catch (Exception ignored)
{ {
} }
} }
@ -118,7 +118,7 @@ public final class GameListFragment extends Fragment
public void onItemClick(AdapterView<?> parent, View view, int position, long id) public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{ {
GameListItem o = mGameAdapter.getItem(position); GameListItem o = mGameAdapter.getItem(position);
if(!(o.getData().equalsIgnoreCase(getString(R.string.folder))||o.getData().equalsIgnoreCase(getString(R.string.parent_directory)))) if (!(o.getData().equalsIgnoreCase(getString(R.string.folder))||o.getData().equalsIgnoreCase(getString(R.string.parent_directory))))
{ {
onFileClick(o.getPath()); onFileClick(o.getPath());
} }

View File

@ -47,7 +47,6 @@ public final class GameListItem implements Comparable<GameListItem>
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} }
else else
{ {
@ -85,7 +84,7 @@ public final class GameListItem implements Comparable<GameListItem>
public int compareTo(GameListItem o) public int compareTo(GameListItem o)
{ {
if(this.name != null) if (this.name != null)
return this.name.toLowerCase().compareTo(o.getName().toLowerCase()); return this.name.toLowerCase().compareTo(o.getName().toLowerCase());
else else
throw new IllegalArgumentException(); throw new IllegalArgumentException();

View File

@ -51,10 +51,10 @@ public final class InputConfigAdapter extends ArrayAdapter<InputConfigItem>
TextView title = (TextView) v.findViewById(R.id.FolderTitle); TextView title = (TextView) v.findViewById(R.id.FolderTitle);
TextView subtitle = (TextView) v.findViewById(R.id.FolderSubTitle); TextView subtitle = (TextView) v.findViewById(R.id.FolderSubTitle);
if(title != null) if (title != null)
title.setText(item.getName()); title.setText(item.getName());
if(subtitle != null) if (subtitle != null)
subtitle.setText(item.getBind()); subtitle.setText(item.getBind());
} }

View File

@ -51,6 +51,7 @@ public final class InputConfigFragment extends Fragment
return fakeid; return fakeid;
} }
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{ {
@ -116,7 +117,7 @@ public final class InputConfigFragment extends Fragment
// Called from GameListActivity // Called from GameListActivity
public boolean onMotionEvent(MotionEvent event) public boolean onMotionEvent(MotionEvent event)
{ {
if (((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == 0)) if ((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == 0)
return false; return false;
InputDevice input = event.getDevice(); InputDevice input = event.getDevice();

View File

@ -41,7 +41,7 @@ public final class InputConfigItem implements Comparable<InputConfigItem>
/** /**
* Constructor that creates an InputConfigItem * Constructor that creates an InputConfigItem
* that has a default binding of "None" * that has a default binding of "None".
* *
* @param name Name of the input config item. * @param name Name of the input config item.
* @param config Name of the key in the configuration file that this control modifies. * @param config Name of the key in the configuration file that this control modifies.
@ -72,7 +72,7 @@ public final class InputConfigItem implements Comparable<InputConfigItem>
} }
/** /**
* Gets the currently set binding of this InputConfigItem * Gets the currently set binding of this InputConfigItem.
* *
* @return the currently set binding of this InputConfigItem * @return the currently set binding of this InputConfigItem
*/ */
@ -93,7 +93,7 @@ public final class InputConfigItem implements Comparable<InputConfigItem>
public int compareTo(InputConfigItem o) public int compareTo(InputConfigItem o)
{ {
if(this.m_name != null) if (this.m_name != null)
return this.m_name.toLowerCase().compareTo(o.getName().toLowerCase()); return this.m_name.toLowerCase().compareTo(o.getName().toLowerCase());
else else
throw new IllegalArgumentException(); throw new IllegalArgumentException();

View File

@ -7,6 +7,7 @@
package org.dolphinemu.dolphinemu.settings; package org.dolphinemu.dolphinemu.settings;
import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.inputconfig.InputConfigFragment;
import android.app.ActionBar; import android.app.ActionBar;
import android.app.ActionBar.Tab; import android.app.ActionBar.Tab;
@ -72,8 +73,8 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
// the TabListener interface, as the callback (listener) for when // the TabListener interface, as the callback (listener) for when
// this tab is selected. // this tab is selected.
actionBar.addTab(actionBar.newTab().setText(R.string.cpu_settings).setTabListener(this)); actionBar.addTab(actionBar.newTab().setText(R.string.cpu_settings).setTabListener(this));
actionBar.addTab(actionBar.newTab().setText("Input Settings").setTabListener(this));
actionBar.addTab(actionBar.newTab().setText(R.string.video_settings).setTabListener(this)); actionBar.addTab(actionBar.newTab().setText(R.string.video_settings).setTabListener(this));
} }
public void onTabReselected(Tab arg0, FragmentTransaction arg1) public void onTabReselected(Tab arg0, FragmentTransaction arg1)
@ -96,9 +97,8 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to one of the * A {@link FragmentPagerAdapter} that returns a fragment corresponding to one of the
* sections/tabs/pages. * sections/tabs/pages.
*/ */
public class SectionsPagerAdapter extends FragmentPagerAdapter public final class SectionsPagerAdapter extends FragmentPagerAdapter
{ {
public SectionsPagerAdapter(FragmentManager fm) public SectionsPagerAdapter(FragmentManager fm)
{ {
super(fm); super(fm);
@ -113,6 +113,9 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
return new CPUSettingsFragment(); return new CPUSettingsFragment();
case 1: case 1:
return new InputConfigFragment();
case 2:
return new VideoSettingsFragment(); return new VideoSettingsFragment();
default: // Should never happen. default: // Should never happen.
@ -124,7 +127,7 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
public int getCount() public int getCount()
{ {
// Show total pages. // Show total pages.
return 2; return 3;
} }
@Override @Override
@ -136,6 +139,9 @@ public final class PrefsActivity extends Activity implements ActionBar.TabListen
return getString(R.string.cpu_settings).toUpperCase(); return getString(R.string.cpu_settings).toUpperCase();
case 1: case 1:
return "Input Settings";//getString(R.string)
case 2:
return getString(R.string.video_settings).toUpperCase(); return getString(R.string.video_settings).toUpperCase();
default: // Should never happen. default: // Should never happen.

View File

@ -27,7 +27,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
{ {
private Activity m_activity; private Activity m_activity;
static public class VersionCheck public static class VersionCheck
{ {
EGL10 mEGL; EGL10 mEGL;
EGLDisplay mEGLDisplay; EGLDisplay mEGLDisplay;
@ -107,7 +107,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
} }
} }
static public boolean SupportsGLES3() public static boolean SupportsGLES3()
{ {
VersionCheck mbuffer = new VersionCheck(); VersionCheck mbuffer = new VersionCheck();
String m_GLVersion = mbuffer.getVersion(); String m_GLVersion = mbuffer.getVersion();

View File

@ -45,7 +45,7 @@ public final class SideMenuAdapter extends ArrayAdapter<SideMenuItem>
{ {
TextView title = (TextView) v.findViewById(R.id.SideMenuTitle); TextView title = (TextView) v.findViewById(R.id.SideMenuTitle);
if(title != null) if (title != null)
title.setText(item.getName()); title.setText(item.getName());
} }

View File

@ -49,7 +49,7 @@ public final class SideMenuItem implements Comparable<SideMenuItem>
public int compareTo(SideMenuItem o) public int compareTo(SideMenuItem o)
{ {
if(this.m_name != null) if (this.m_name != null)
return this.m_name.toLowerCase().compareTo(o.getName().toLowerCase()); return this.m_name.toLowerCase().compareTo(o.getName().toLowerCase());
else else
throw new IllegalArgumentException(); throw new IllegalArgumentException();