Android: Cleanup formatting

This commit is contained in:
Sean Maas
2016-10-25 14:18:06 -04:00
parent 9e21ac8607
commit 3b28fe11d6
58 changed files with 290 additions and 313 deletions
@@ -4,7 +4,6 @@ import android.app.Application;
import org.dolphinemu.dolphinemu.model.GameDatabase;
public class DolphinApplication extends Application
{
public static GameDatabase databaseHelper;
@@ -6,7 +6,6 @@
package org.dolphinemu.dolphinemu;
import android.view.Surface;
import android.widget.Toast;
@@ -298,7 +297,6 @@ public final class NativeLibrary
/**
* Saves a screen capture of the game
*
*/
public static native void SaveScreenShot();
@@ -121,8 +121,7 @@ public final class EmulationActivity extends AppCompatActivity
getSupportActionBar().hide();
}
}
}
);
});
}
else
{
@@ -408,7 +407,8 @@ public final class EmulationActivity extends AppCompatActivity
{
// Edit the placement of the controls
case R.id.menu_emulation_edit_layout:
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager().findFragmentById(R.id.frame_emulation_fragment);
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager()
.findFragmentById(R.id.frame_emulation_fragment);
if (emulationFragment.isConfiguringControls())
{
emulationFragment.stopConfiguringControls();
@@ -434,13 +434,13 @@ public final class EmulationActivity extends AppCompatActivity
}
builder.setMultiChoiceItems(R.array.gcpadButtons, enabledButtons,
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleGc" + indexSelected, isChecked);
}
});
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleGc" + indexSelected, isChecked);
}
});
}
else if (mPreferences.getInt("wiiController", 3) == 4)
{
@@ -450,13 +450,13 @@ public final class EmulationActivity extends AppCompatActivity
}
builder.setMultiChoiceItems(R.array.classicButtons, enabledButtons,
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleClassic" + indexSelected, isChecked);
}
});
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleClassic" + indexSelected, isChecked);
}
});
}
else
{
@@ -468,25 +468,25 @@ public final class EmulationActivity extends AppCompatActivity
{
builder.setMultiChoiceItems(R.array.nunchukButtons, enabledButtons,
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleWii" + indexSelected, isChecked);
}
});
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleWii" + indexSelected, isChecked);
}
});
}
else
{
builder.setMultiChoiceItems(R.array.wiimoteButtons, enabledButtons,
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleWii" + indexSelected, isChecked);
}
});
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleWii" + indexSelected, isChecked);
}
});
}
}
builder.setNeutralButton(getString(R.string.emulation_toggle_all), new DialogInterface.OnClickListener()
@@ -499,7 +499,7 @@ public final class EmulationActivity extends AppCompatActivity
emulationFragment.toggleInputOverlayVisibility();
}
});
builder.setPositiveButton(getString(R.string.emulation_done), new DialogInterface.OnClickListener()
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialogInterface, int i)
@@ -552,7 +552,7 @@ public final class EmulationActivity extends AppCompatActivity
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_control_scale);
builder.setView(view);
builder.setPositiveButton(getString(R.string.emulation_done), new DialogInterface.OnClickListener()
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialogInterface, int i)
@@ -580,17 +580,17 @@ public final class EmulationActivity extends AppCompatActivity
builder.setTitle(R.string.emulation_choose_controller);
builder.setSingleChoiceItems(R.array.controllersEntries, mPreferences.getInt("wiiController", 3),
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected)
{
editor.putInt("wiiController", indexSelected);
{
@Override
public void onClick(DialogInterface dialog, int indexSelected)
{
editor.putInt("wiiController", indexSelected);
NativeLibrary.SetConfig("WiimoteNew.ini", "Wiimote1", "Extension",
getResources().getStringArray(R.array.controllersValues)[indexSelected]);
}
});
builder.setPositiveButton(getString(R.string.emulation_done), new DialogInterface.OnClickListener()
NativeLibrary.SetConfig("WiimoteNew.ini", "Wiimote1", "Extension",
getResources().getStringArray(R.array.controllersValues)[indexSelected]);
}
});
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialogInterface, int i)
@@ -619,7 +619,7 @@ public final class EmulationActivity extends AppCompatActivity
NativeLibrary.SaveScreenShot();
return;
// Quicksave / Load
// Quick save / load
case R.id.menu_quicksave:
NativeLibrary.SaveState(9);
return;
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.adapters;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
@@ -17,10 +16,11 @@ public class PlatformPagerAdapter extends FragmentPagerAdapter
{
private Context mContext;
private final static int[] TAB_ICONS = {
private final static int[] TAB_ICONS =
{
R.drawable.ic_gamecube,
R.drawable.ic_wii,
R.drawable.ic_folder// wiiware TODO Have an icon here.
R.drawable.ic_folder // WiiWare TODO Have an icon here.
};
public PlatformPagerAdapter(FragmentManager fm, Context context)
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.adapters;
import android.content.res.Resources;
import android.support.v17.leanback.widget.ImageCardView;
import android.support.v17.leanback.widget.Presenter;
@@ -44,4 +43,4 @@ public final class SettingsRowPresenter extends Presenter
{
// no op
}
}
}
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
@@ -63,7 +62,7 @@ public final class GameDetailsDialog extends DialogFragment
FloatingActionButton buttonLaunch = (FloatingActionButton) contents.findViewById(R.id.button_launch);
int countryIndex = getArguments().getInt(ARGUMENT_GAME_COUNTRY);
String country = getResources().getStringArray(R.array.country_names)[countryIndex];
String country = getResources().getStringArray(R.array.countryNames)[countryIndex];
textTitle.setText(getArguments().getString(ARGUMENT_GAME_TITLE));
textDescription.setText(getArguments().getString(ARGUMENT_GAME_DESCRIPTION));
@@ -175,4 +175,4 @@ public final class MotionAlertDialog extends AlertDialog
dismiss();
}
}
}
@@ -18,7 +18,6 @@ import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.overlay.InputOverlay;
import org.dolphinemu.dolphinemu.utils.Log;
public final class EmulationFragment extends Fragment implements SurfaceHolder.Callback
{
public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".emulation_fragment";
@@ -36,7 +35,6 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
private boolean mEmulationStarted;
private boolean mEmulationRunning;
public static EmulationFragment newInstance(String path)
{
EmulationFragment fragment = new EmulationFragment();
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.model;
import org.dolphinemu.dolphinemu.NativeLibrary;
import java.io.File;
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.model;
public final class TvSettingsItem
{
private final int mItemId;
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.model.settings.view;
import org.dolphinemu.dolphinemu.model.settings.BooleanSetting;
import org.dolphinemu.dolphinemu.model.settings.Setting;
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.model.settings.view;
import org.dolphinemu.dolphinemu.model.settings.Setting;
public final class HeaderSetting extends SettingsItem
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.model.settings.view;
import org.dolphinemu.dolphinemu.model.settings.IntSetting;
import org.dolphinemu.dolphinemu.model.settings.Setting;
@@ -33,7 +33,7 @@ import java.util.Set;
/**
* Draws the interactive input overlay on top of the
* {@link NativeGLSurfaceView} that is rendering emulation.
* {@link SurfaceView} that is rendering emulation.
*/
public final class InputOverlay extends SurfaceView implements OnTouchListener
{
@@ -215,8 +215,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
int fingerPositionX = (int)event.getX(pointerIndex);
int fingerPositionY = (int)event.getY(pointerIndex);
//Maybe combine Button and Joystick as subclasses of the same parent?
//Or maybe create an interface like IMoveableHUDControl?
// Maybe combine Button and Joystick as subclasses of the same parent?
// Or maybe create an interface like IMoveableHUDControl?
for (InputOverlayDrawableButton button : overlayButtons)
{
@@ -245,7 +245,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
case MotionEvent.ACTION_POINTER_UP:
if (mButtonBeingConfigured == button)
{
//Persist button position by saving new place.
// Persist button position by saving new place.
saveControlPosition(mButtonBeingConfigured.getId(), mButtonBeingConfigured.getBounds().left, mButtonBeingConfigured.getBounds().top);
mButtonBeingConfigured = null;
}
@@ -280,7 +280,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
case MotionEvent.ACTION_POINTER_UP:
if (mDpadBeingConfigured == dpad)
{
//Persist button position by saving new place.
// Persist button position by saving new place.
saveControlPosition(mDpadBeingConfigured.getId(0), mDpadBeingConfigured.getBounds().left, mDpadBeingConfigured.getBounds().top);
mDpadBeingConfigured = null;
}
@@ -638,8 +638,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
// The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay.
// These were set in the input overlay configuration menu.
int drawableX = (int) sPrefs.getFloat(buttonId+"-X", 0f);
int drawableY = (int) sPrefs.getFloat(buttonId+"-Y", 0f);
int drawableX = (int) sPrefs.getFloat(buttonId + "-X", 0f);
int drawableY = (int) sPrefs.getFloat(buttonId + "-Y", 0f);
// Intrinsic width and height of the InputOverlayDrawableButton.
// For any who may not know, intrinsic width/height
@@ -649,7 +649,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
// Now set the bounds for the InputOverlayDrawableButton.
// This will dictate where on the screen (and the what the size) the InputOverlayDrawableButton will be.
overlayDrawable.setBounds(drawableX, drawableY, drawableX+intrinWidth, drawableY+intrinHeight);
overlayDrawable.setBounds(drawableX, drawableY, drawableX + intrinWidth, drawableY + intrinHeight);
// Need to set the image's position
overlayDrawable.setPosition(drawableX, drawableY);
@@ -660,12 +660,12 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
/**
* Initializes an {@link InputOverlayDrawableDpad}
*
* @param context The current {@link Context}.
* @param resId The resource ID of the {@link Drawable} to get the {@link Bitmap} of.
* @param buttonUp Identifier for the up button.
* @param context The current {@link Context}.
* @param resId The resource ID of the {@link Drawable} to get the {@link Bitmap} of.
* @param buttonUp Identifier for the up button.
* @param buttonDown Identifier for the down button.
* @param buttonLeft Identifier for the left button.
* @param buttonRight Identifier for the right button.
* @param buttonRight Identifier for the right button.
*
* @return the initialized {@link InputOverlayDrawableDpad}
*/
@@ -705,8 +705,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
// The X and Y coordinates of the InputOverlayDrawableDpad on the InputOverlay.
// These were set in the input overlay configuration menu.
int drawableX = (int) sPrefs.getFloat(buttonUp+"-X", 0f);
int drawableY = (int) sPrefs.getFloat(buttonUp+"-Y", 0f);
int drawableX = (int) sPrefs.getFloat(buttonUp + "-X", 0f);
int drawableY = (int) sPrefs.getFloat(buttonUp + "-Y", 0f);
// Intrinsic width and height of the InputOverlayDrawableDpad.
// For any who may not know, intrinsic width/height
@@ -716,7 +716,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
// Now set the bounds for the InputOverlayDrawableDpad.
// This will dictate where on the screen (and the what the size) the InputOverlayDrawableDpad will be.
overlayDrawable.setBounds(drawableX, drawableY, drawableX+intrinWidth, drawableY+intrinHeight);
overlayDrawable.setBounds(drawableX, drawableY, drawableX + intrinWidth, drawableY + intrinHeight);
// Need to set the image's position
overlayDrawable.setPosition(drawableX, drawableY);
@@ -730,7 +730,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
* @param context The current {@link Context}
* @param resOuter Resource ID for the outer image of the joystick (the static image that shows the circular bounds).
* @param resInner Resource ID for the inner image of the joystick (the one you actually move around).
* @param joystick Identifier for which joystick this is.
* @param joystick Identifier for which joystick this is.
*
* @return the initialized {@link InputOverlayDrawableJoystick}.
*/
@@ -753,8 +753,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
// The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay.
// These were set in the input overlay configuration menu.
int drawableX = (int) sPrefs.getFloat(joystick+"-X", 0f);
int drawableY = (int) sPrefs.getFloat(joystick+"-Y", 0f);
int drawableX = (int) sPrefs.getFloat(joystick + "-X", 0f);
int drawableY = (int) sPrefs.getFloat(joystick + "-Y", 0f);
// Decide inner scale based on joystick ID
float innerScale;
@@ -797,5 +797,4 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
{
return mIsInEditMode;
}
}
@@ -29,10 +29,10 @@ public final class InputOverlayDrawableDpad extends BitmapDrawable
*
* @param res {@link Resources} instance.
* @param bitmap {@link Bitmap} to use with this Drawable.
* @param buttonUp Identifier for the up button.
* @param buttonUp Identifier for the up button.
* @param buttonDown Identifier for the down button.
* @param buttonLeft Identifier for the left button.
* @param buttonRight Identifier for the right button.
* @param buttonRight Identifier for the right button.
*/
public InputOverlayDrawableDpad(Resources res, Bitmap bitmap,
int buttonUp, int buttonDown,
@@ -154,4 +154,4 @@ public final class DividerItemDecoration extends RecyclerView.ItemDecoration
"DividerItemDecoration can only be used with a LinearLayoutManager.");
}
}
}
}
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.ui.main;
import android.database.Cursor;
/**
@@ -250,7 +250,7 @@ public final class TvMainActivity extends Activity implements MainView
R.string.grid_menu_refresh));
// Create a header for this row.
HeaderItem header = new HeaderItem(R.string.settings, getString(R.string.settings));
HeaderItem header = new HeaderItem(R.string.preferences_settings, getString(R.string.preferences_settings));
return new ListRow(header, rowItems);
}
@@ -48,15 +48,14 @@ public final class PlatformGamesPresenter
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Cursor>()
{
@Override
public void call(Cursor games)
{
Log.debug("[PlatformGamesPresenter] " + mPlatform + ": Load finished, swapping cursor...");
{
@Override
public void call(Cursor games)
{
Log.debug("[PlatformGamesPresenter] " + mPlatform + ": Load finished, swapping cursor...");
mView.showGames(games);
}
}
);
mView.showGames(games);
}
});
}
}
@@ -1,6 +1,5 @@
package org.dolphinemu.dolphinemu.ui.platform;
import android.database.Cursor;
/**

Some files were not shown because too many files have changed in this diff Show More