-Fixed some various coding standard issues from previous commit.

This commit is contained in:
Ironthighs
2016-07-21 19:24:38 -05:00
parent 3dfeea01da
commit 89b5bc9ee5
4 changed files with 32 additions and 19 deletions

View File

@ -11,8 +11,8 @@ android {
abortOnError false abortOnError false
//Uncomment disable lines for test builds... //Uncomment disable lines for test builds...
//disable 'MissingTranslation' disable 'MissingTranslation'
//disable 'ExtraTranslation' disable 'ExtraTranslation'
} }
defaultConfig { defaultConfig {

View File

@ -102,11 +102,14 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
} }
@Override @Override
public void onViewCreated(View view, Bundle savedInstanceState) { public void onViewCreated(View view, Bundle savedInstanceState)
{
Button doneButton = (Button) view.findViewById(R.id.done_control_config); Button doneButton = (Button) view.findViewById(R.id.done_control_config);
doneButton.setOnClickListener(new View.OnClickListener() { doneButton.setOnClickListener(new View.OnClickListener()
{
@Override @Override
public void onClick(View v) { public void onClick(View v)
{
stopConfiguringControls(); stopConfiguringControls();
} }
}); });
@ -242,12 +245,14 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
mInputOverlay.setIsInEditMode(true); mInputOverlay.setIsInEditMode(true);
} }
public void stopConfiguringControls() { public void stopConfiguringControls()
{
getView().findViewById(R.id.done_control_config).setVisibility(View.GONE); getView().findViewById(R.id.done_control_config).setVisibility(View.GONE);
mInputOverlay.setIsInEditMode(false); mInputOverlay.setIsInEditMode(false);
} }
public boolean isConfiguringControls() { public boolean isConfiguringControls()
{
return mInputOverlay.isInEditMode(); return mInputOverlay.isInEditMode();
} }
} }

View File

@ -115,7 +115,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
@Override @Override
public boolean onTouch(View v, MotionEvent event) public boolean onTouch(View v, MotionEvent event)
{ {
if(isInEditMode()) { if (isInEditMode())
{
return onTouchWhileEditing(v, event); return onTouchWhileEditing(v, event);
} }
@ -131,13 +132,17 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE:
// If a pointer enters the bounds of a button, press that button. // If a pointer enters the bounds of a button, press that button.
if (button.getBounds().contains((int)event.getX(pointerIndex), (int)event.getY(pointerIndex))) if (button.getBounds().contains((int)event.getX(pointerIndex), (int)event.getY(pointerIndex)))
{
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.PRESSED); NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.PRESSED);
}
break; break;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP: case MotionEvent.ACTION_POINTER_UP:
// If a pointer ends, release the button it was pressing. // If a pointer ends, release the button it was pressing.
if (button.getBounds().contains((int)event.getX(pointerIndex), (int)event.getY(pointerIndex))) if (button.getBounds().contains((int)event.getX(pointerIndex), (int)event.getY(pointerIndex)))
{
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.RELEASED); NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.RELEASED);
}
break; break;
} }
} }
@ -150,8 +155,10 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
float[] axises = joystick.getAxisValues(); float[] axises = joystick.getAxisValues();
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, axisIDs[i], axises[i]); NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, axisIDs[i], axises[i]);
} }
}
return true; return true;
} }
@ -393,7 +400,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
mIsInEditMode = isInEditMode; mIsInEditMode = isInEditMode;
} }
public boolean isInEditMode() { public boolean isInEditMode()
{
return mIsInEditMode; return mIsInEditMode;
} }