Android Studio auto-reformat of new virtual controller code

This commit is contained in:
Cameron Gutman 2016-01-07 00:24:39 -06:00
parent b6bd48584f
commit 2736bd9165
9 changed files with 851 additions and 826 deletions

View File

@ -18,13 +18,21 @@ import java.util.List;
*/ */
public class AnalogStick extends VirtualControllerElement { public class AnalogStick extends VirtualControllerElement {
/** outer radius size in percent of the ui element */ /**
* outer radius size in percent of the ui element
*/
public static final int SIZE_RADIUS_COMPLETE = 90; public static final int SIZE_RADIUS_COMPLETE = 90;
/** analog stick size in percent of the ui element */ /**
* analog stick size in percent of the ui element
*/
public static final int SIZE_RADIUS_ANALOG_STICK = 90; public static final int SIZE_RADIUS_ANALOG_STICK = 90;
/** dead zone size in percent of the ui element */ /**
* dead zone size in percent of the ui element
*/
public static final int SIZE_RADIUS_DEADZONE = 90; public static final int SIZE_RADIUS_DEADZONE = 90;
/** time frame for a double click */ /**
* time frame for a double click
*/
public final static long timeoutDoubleClick = 250; public final static long timeoutDoubleClick = 250;
/** /**
@ -34,6 +42,7 @@ public class AnalogStick extends VirtualControllerElement {
/** /**
* onMovement event will be fired on real analog stick movement (outside of the deadzone). * onMovement event will be fired on real analog stick movement (outside of the deadzone).
*
* @param x horizontal position, value from -1.0 ... 0 .. 1.0 * @param x horizontal position, value from -1.0 ... 0 .. 1.0
* @param y vertical position, value from -1.0 ... 0 .. 1.0 * @param y vertical position, value from -1.0 ... 0 .. 1.0
*/ */
@ -73,19 +82,31 @@ public class AnalogStick extends VirtualControllerElement {
DOUBLE DOUBLE
} }
/** configuration if the analog stick should be displayed as circle or square*/ /**
* configuration if the analog stick should be displayed as circle or square
*/
private boolean circle_stick = true; // TODO: implement square sick for simulations private boolean circle_stick = true; // TODO: implement square sick for simulations
/** outer radius, this size will be automatically updated on resize */ /**
* outer radius, this size will be automatically updated on resize
*/
private float radius_complete = 0; private float radius_complete = 0;
/** analog stick radius, this size will be automatically updated on resize */ /**
* analog stick radius, this size will be automatically updated on resize
*/
private float radius_analog_stick = 0; private float radius_analog_stick = 0;
/** dead zone radius, this size will be automatically updated on resize */ /**
* dead zone radius, this size will be automatically updated on resize
*/
private float radius_dead_zone = 0; private float radius_dead_zone = 0;
/** horizontal position in relation to the center of the element */ /**
* horizontal position in relation to the center of the element
*/
private float relative_x = 0; private float relative_x = 0;
/** vertical position in relation to the center of the element */ /**
* vertical position in relation to the center of the element
*/
private float relative_y = 0; private float relative_y = 0;

View File

@ -20,7 +20,8 @@ public class LeftTrigger extends DigitalButton {
} }
@Override @Override
public void onLongClick() {} public void onLongClick() {
}
@Override @Override
public void onRelease() { public void onRelease() {

View File

@ -20,7 +20,8 @@ public class RightTrigger extends DigitalButton {
} }
@Override @Override
public void onLongClick() {} public void onLongClick() {
}
@Override @Override
public void onRelease() { public void onRelease() {

View File

@ -20,6 +20,7 @@ import java.util.List;
public class VirtualControllerConfigurationLoader { public class VirtualControllerConfigurationLoader {
private static final String PROFILE_PATH = "profiles"; private static final String PROFILE_PATH = "profiles";
private static int getPercent( private static int getPercent(
int percent, int percent,
int total) { int total) {

View File

@ -245,6 +245,7 @@ public abstract class VirtualControllerElement extends View {
} }
abstract protected void onElementDraw(Canvas canvas); abstract protected void onElementDraw(Canvas canvas);
abstract public boolean onElementTouchEvent(MotionEvent event); abstract public boolean onElementTouchEvent(MotionEvent event);
protected static final void _DBG(String text) { protected static final void _DBG(String text) {