mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
add real digital pad and new digital buttons
This commit is contained in:
parent
69321636b5
commit
4e29f2ae8b
@ -21,7 +21,7 @@ public class AnalogStick extends View
|
|||||||
MOVED
|
MOVED
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final boolean _PRINT_DEBUG_INFORMATION = false;
|
private static final boolean _PRINT_DEBUG_INFORMATION = true;
|
||||||
|
|
||||||
public interface AnalogStickListener
|
public interface AnalogStickListener
|
||||||
{
|
{
|
||||||
@ -33,6 +33,11 @@ public class AnalogStick extends View
|
|||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOnTouchListener(OnTouchListener listener)
|
||||||
|
{
|
||||||
|
onTouchListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
private static final void _DBG(String text)
|
private static final void _DBG(String text)
|
||||||
{
|
{
|
||||||
if (_PRINT_DEBUG_INFORMATION)
|
if (_PRINT_DEBUG_INFORMATION)
|
||||||
@ -41,6 +46,9 @@ public class AnalogStick extends View
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int normalColor = 0x88888888;
|
||||||
|
private int pressedColor = 0x880000FF;
|
||||||
|
|
||||||
float radius_complete = 0;
|
float radius_complete = 0;
|
||||||
float radius_dead_zone = 0;
|
float radius_dead_zone = 0;
|
||||||
float radius_analog_stick = 0;
|
float radius_analog_stick = 0;
|
||||||
@ -52,6 +60,7 @@ public class AnalogStick extends View
|
|||||||
_STICK_STATE stick_state = _STICK_STATE.NO_MOVEMENT;
|
_STICK_STATE stick_state = _STICK_STATE.NO_MOVEMENT;
|
||||||
|
|
||||||
List<AnalogStickListener> listeners = new ArrayList<AnalogStickListener>();
|
List<AnalogStickListener> listeners = new ArrayList<AnalogStickListener>();
|
||||||
|
OnTouchListener onTouchListener = null;
|
||||||
|
|
||||||
public AnalogStick(Context context)
|
public AnalogStick(Context context)
|
||||||
{
|
{
|
||||||
@ -93,9 +102,9 @@ public class AnalogStick extends View
|
|||||||
@Override
|
@Override
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh)
|
protected void onSizeChanged(int w, int h, int oldw, int oldh)
|
||||||
{
|
{
|
||||||
radius_complete = getPercent(getCorrectWidth() / 2, 90);
|
radius_complete = getPercent(getCorrectWidth() / 2, 95);
|
||||||
radius_dead_zone = getPercent(getCorrectWidth() / 2, 10);
|
radius_dead_zone = getPercent(getCorrectWidth() / 2, 20);
|
||||||
radius_analog_stick = getPercent(getCorrectWidth() / 2, 20);
|
radius_analog_stick = getPercent(getCorrectWidth() / 2, 30);
|
||||||
|
|
||||||
super.onSizeChanged(w, h, oldw, oldh);
|
super.onSizeChanged(w, h, oldw, oldh);
|
||||||
}
|
}
|
||||||
@ -103,11 +112,14 @@ public class AnalogStick extends View
|
|||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas)
|
protected void onDraw(Canvas canvas)
|
||||||
{
|
{
|
||||||
|
// set transparent background
|
||||||
|
canvas.drawColor(Color.TRANSPARENT);
|
||||||
|
|
||||||
Paint paint = new Paint();
|
Paint paint = new Paint();
|
||||||
paint.setStyle(Paint.Style.STROKE);
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
paint.setStrokeWidth(getPercent(getCorrectWidth() / 2, 2));
|
paint.setStrokeWidth(getPercent(getCorrectWidth() / 2, 2));
|
||||||
|
|
||||||
paint.setColor(Color.YELLOW);
|
paint.setColor(normalColor);
|
||||||
|
|
||||||
// draw outer circle
|
// draw outer circle
|
||||||
canvas.drawCircle(getWidth() / 2, getHeight() / 2, radius_complete, paint);
|
canvas.drawCircle(getWidth() / 2, getHeight() / 2, radius_complete, paint);
|
||||||
@ -122,14 +134,14 @@ public class AnalogStick extends View
|
|||||||
{
|
{
|
||||||
case NO_MOVEMENT:
|
case NO_MOVEMENT:
|
||||||
{
|
{
|
||||||
paint.setColor(Color.BLUE);
|
paint.setColor(normalColor);
|
||||||
canvas.drawCircle(position_stick_x, position_stick_y, radius_analog_stick, paint);
|
canvas.drawCircle(position_stick_x, position_stick_y, radius_analog_stick, paint);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MOVED:
|
case MOVED:
|
||||||
{
|
{
|
||||||
paint.setColor(Color.CYAN);
|
paint.setColor(pressedColor);
|
||||||
canvas.drawCircle(position_stick_x, position_stick_y, radius_analog_stick, paint);
|
canvas.drawCircle(position_stick_x, position_stick_y, radius_analog_stick, paint);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -138,11 +150,9 @@ public class AnalogStick extends View
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
paint.setColor(Color.RED);
|
paint.setColor(normalColor);
|
||||||
canvas.drawCircle(getWidth() / 2, getHeight() / 2, radius_analog_stick, paint);
|
canvas.drawCircle(getWidth() / 2, getHeight() / 2, radius_analog_stick, paint);
|
||||||
}
|
}
|
||||||
// set transparent background
|
|
||||||
canvas.drawColor(Color.TRANSPARENT);
|
|
||||||
|
|
||||||
super.onDraw(canvas);
|
super.onDraw(canvas);
|
||||||
}
|
}
|
||||||
@ -244,7 +254,7 @@ public class AnalogStick extends View
|
|||||||
position_stick_x = getWidth() / 2 - correlated_x;
|
position_stick_x = getWidth() / 2 - correlated_x;
|
||||||
position_stick_y = getHeight() / 2 - correlated_y;
|
position_stick_y = getHeight() / 2 - correlated_y;
|
||||||
|
|
||||||
// check if analog stick is inside of dead zone
|
// check if analog stick is outside of dead zone
|
||||||
if (movement_radius > radius_dead_zone)
|
if (movement_radius > radius_dead_zone)
|
||||||
{
|
{
|
||||||
moveActionCallback(movement_x, movement_y);
|
moveActionCallback(movement_x, movement_y);
|
||||||
@ -260,6 +270,11 @@ public class AnalogStick extends View
|
|||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event)
|
public boolean onTouchEvent(MotionEvent event)
|
||||||
{
|
{
|
||||||
|
if (onTouchListener != null)
|
||||||
|
{
|
||||||
|
return onTouchListener.onTouch(this, event);
|
||||||
|
}
|
||||||
|
|
||||||
// get masked (not specific to a pointer) action
|
// get masked (not specific to a pointer) action
|
||||||
int action = event.getActionMasked();
|
int action = event.getActionMasked();
|
||||||
|
|
||||||
|
@ -0,0 +1,172 @@
|
|||||||
|
package com.limelight.binding.input.virtual_controller;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Karim on 24.01.2015.
|
||||||
|
*/
|
||||||
|
public class DigitalButton extends View
|
||||||
|
{
|
||||||
|
private static final boolean _PRINT_DEBUG_INFORMATION = true;
|
||||||
|
|
||||||
|
private int normalColor = 0x88888888;
|
||||||
|
private int pressedColor = 0x880000FF;
|
||||||
|
private String text;
|
||||||
|
|
||||||
|
|
||||||
|
public interface DigitalButtonListener
|
||||||
|
{
|
||||||
|
void onClick();
|
||||||
|
|
||||||
|
void onRelease();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDigitalButtonListener(DigitalButtonListener listener)
|
||||||
|
{
|
||||||
|
listeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnTouchListener(OnTouchListener listener)
|
||||||
|
{
|
||||||
|
onTouchListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final void _DBG(String text)
|
||||||
|
{
|
||||||
|
if (_PRINT_DEBUG_INFORMATION)
|
||||||
|
{
|
||||||
|
System.out.println("DigitalButton: " + text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DigitalButtonListener> listeners = new ArrayList<DigitalButtonListener>();
|
||||||
|
OnTouchListener onTouchListener = null;
|
||||||
|
|
||||||
|
boolean clicked;
|
||||||
|
|
||||||
|
public DigitalButton(Context context)
|
||||||
|
{
|
||||||
|
super(context);
|
||||||
|
|
||||||
|
clicked = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String text)
|
||||||
|
{
|
||||||
|
this.text = text;
|
||||||
|
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getPercent(float value, float percent)
|
||||||
|
{
|
||||||
|
return value / 100 * percent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getCorrectWidth()
|
||||||
|
{
|
||||||
|
return getWidth() > getHeight() ? getHeight() : getWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas)
|
||||||
|
{
|
||||||
|
// set transparent background
|
||||||
|
canvas.drawColor(Color.TRANSPARENT);
|
||||||
|
|
||||||
|
Paint paint = new Paint();
|
||||||
|
|
||||||
|
paint.setTextSize(getPercent(getCorrectWidth(), 50));
|
||||||
|
paint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
paint.setStrokeWidth(3);
|
||||||
|
|
||||||
|
paint.setColor(clicked ? pressedColor : normalColor);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawRect(
|
||||||
|
1, 1,
|
||||||
|
getWidth() - 1, getHeight() - 1,
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||||
|
canvas.drawText(text,
|
||||||
|
getPercent(getWidth(), 50), getPercent(getHeight(), 75),
|
||||||
|
paint);
|
||||||
|
|
||||||
|
super.onDraw(canvas);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onClickCallback()
|
||||||
|
{
|
||||||
|
_DBG("clicked");
|
||||||
|
|
||||||
|
// notify listeners
|
||||||
|
for (DigitalButtonListener listener : listeners)
|
||||||
|
{
|
||||||
|
listener.onClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onReleaseCallback()
|
||||||
|
{
|
||||||
|
_DBG("released");
|
||||||
|
|
||||||
|
// notify listeners
|
||||||
|
for (DigitalButtonListener listener : listeners)
|
||||||
|
{
|
||||||
|
listener.onRelease();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
if (onTouchListener != null)
|
||||||
|
{
|
||||||
|
return onTouchListener.onTouch(this, event);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// get masked (not specific to a pointer) action
|
||||||
|
int action = event.getActionMasked();
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
case MotionEvent.ACTION_POINTER_DOWN:
|
||||||
|
{
|
||||||
|
clicked = true;
|
||||||
|
onClickCallback();
|
||||||
|
|
||||||
|
invalidate();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
case MotionEvent.ACTION_POINTER_UP:
|
||||||
|
{
|
||||||
|
clicked = false;
|
||||||
|
onReleaseCallback();
|
||||||
|
|
||||||
|
invalidate();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onTouchEvent(event);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,276 @@
|
|||||||
|
package com.limelight.binding.input.virtual_controller;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Karim Mreisi on 23.01.2015.
|
||||||
|
*/
|
||||||
|
public class DigitalPad extends View
|
||||||
|
{
|
||||||
|
public final static int DIGITAL_PAD_DIRECTION_NO_DIRECTION = 0;
|
||||||
|
public final static int DIGITAL_PAD_DIRECTION_LEFT = 1;
|
||||||
|
public final static int DIGITAL_PAD_DIRECTION_UP = 2;
|
||||||
|
public final static int DIGITAL_PAD_DIRECTION_RIGHT = 4;
|
||||||
|
public final static int DIGITAL_PAD_DIRECTION_DOWN = 8;
|
||||||
|
|
||||||
|
private int normalColor = 0x88888888;
|
||||||
|
private int pressedColor = 0x880000FF;
|
||||||
|
|
||||||
|
private static final boolean _PRINT_DEBUG_INFORMATION = true;
|
||||||
|
|
||||||
|
public interface DigitalPadListener
|
||||||
|
{
|
||||||
|
void onDirectionChange(int direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDigitalPadListener (DigitalPadListener listener)
|
||||||
|
{
|
||||||
|
listeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnTouchListener(OnTouchListener listener)
|
||||||
|
{
|
||||||
|
onTouchListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final void _DBG(String text)
|
||||||
|
{
|
||||||
|
if (_PRINT_DEBUG_INFORMATION)
|
||||||
|
{
|
||||||
|
System.out.println("DigitalPad: " + text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DigitalPadListener> listeners = new ArrayList<DigitalPadListener>();
|
||||||
|
OnTouchListener onTouchListener = null;
|
||||||
|
|
||||||
|
int direction;
|
||||||
|
|
||||||
|
public DigitalPad(Context context)
|
||||||
|
{
|
||||||
|
super(context);
|
||||||
|
|
||||||
|
direction = DIGITAL_PAD_DIRECTION_NO_DIRECTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getPercent(float value, float percent)
|
||||||
|
{
|
||||||
|
return value / 100 * percent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getCorrectWidth()
|
||||||
|
{
|
||||||
|
return getWidth() > getHeight() ? getHeight() : getWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas)
|
||||||
|
{
|
||||||
|
// set transparent background
|
||||||
|
canvas.drawColor(Color.TRANSPARENT);
|
||||||
|
|
||||||
|
Paint paint = new Paint();
|
||||||
|
|
||||||
|
paint.setTextSize(getPercent(getCorrectWidth(), 20));
|
||||||
|
paint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
paint.setStrokeWidth(3);
|
||||||
|
|
||||||
|
// draw no direction rect
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
paint.setColor(direction == DIGITAL_PAD_DIRECTION_NO_DIRECTION ? pressedColor : normalColor);
|
||||||
|
canvas.drawRect(
|
||||||
|
getPercent(getWidth(), 36), getPercent(getHeight(), 36),
|
||||||
|
getPercent(getWidth(), 63), getPercent(getHeight(), 63),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw left rect
|
||||||
|
paint.setColor((direction & DIGITAL_PAD_DIRECTION_LEFT) > 0 ? pressedColor : normalColor);
|
||||||
|
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||||
|
canvas.drawText("LF",
|
||||||
|
getPercent(getWidth(), 16.5f), getPercent(getHeight(), 58),
|
||||||
|
paint);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawRect(
|
||||||
|
0, getPercent(getHeight(), 33),
|
||||||
|
getPercent(getWidth(), 33), getPercent(getHeight(), 66),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw left up line
|
||||||
|
paint.setColor((
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_LEFT) > 0 &&
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_UP) > 0
|
||||||
|
) ? pressedColor : normalColor
|
||||||
|
);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawLine(
|
||||||
|
0, getPercent(getWidth(), 33),
|
||||||
|
getPercent(getWidth(), 33), 0,
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw up rect
|
||||||
|
paint.setColor((direction & DIGITAL_PAD_DIRECTION_UP) > 0 ? pressedColor : normalColor);
|
||||||
|
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||||
|
canvas.drawText("UP",
|
||||||
|
getPercent(getWidth(), 49.5f), getPercent(getHeight(), 25),
|
||||||
|
paint);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawRect(
|
||||||
|
getPercent(getWidth(), 33), 0,
|
||||||
|
getPercent(getWidth(), 66), getPercent(getHeight(), 33),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw up right line
|
||||||
|
paint.setColor((
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_UP) > 0 &&
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_RIGHT) > 0
|
||||||
|
) ? pressedColor : normalColor
|
||||||
|
);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawLine(
|
||||||
|
getPercent(getWidth(), 66), 0,
|
||||||
|
getPercent(getWidth(), 100), getPercent(getHeight(), 33),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw right rect
|
||||||
|
paint.setColor((direction & DIGITAL_PAD_DIRECTION_RIGHT) > 0 ? pressedColor : normalColor);
|
||||||
|
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||||
|
canvas.drawText("RI",
|
||||||
|
getPercent(getWidth(), 82.5f), getPercent(getHeight(), 58),
|
||||||
|
paint);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawRect(
|
||||||
|
getPercent(getWidth(), 66), getPercent(getHeight(), 33),
|
||||||
|
getPercent(getWidth(), 100), getPercent(getHeight(), 66),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw right down line
|
||||||
|
paint.setColor((
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_RIGHT) > 0 &&
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_DOWN) > 0
|
||||||
|
) ? pressedColor : normalColor
|
||||||
|
);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawLine(
|
||||||
|
getPercent(getWidth(), 100), getPercent(getHeight(), 66),
|
||||||
|
getPercent(getWidth(), 66), getPercent(getHeight(), 100),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw down rect
|
||||||
|
paint.setColor((direction & DIGITAL_PAD_DIRECTION_DOWN) > 0 ? pressedColor : normalColor);
|
||||||
|
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||||
|
canvas.drawText("DW",
|
||||||
|
getPercent(getWidth(), 49.5f), getPercent(getHeight(), 91),
|
||||||
|
paint);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawRect(
|
||||||
|
getPercent(getWidth(), 33), getPercent(getHeight(), 66),
|
||||||
|
getPercent(getWidth(), 66), getPercent(getHeight(), 100),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
// draw down left line
|
||||||
|
paint.setColor((
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_DOWN) > 0 &&
|
||||||
|
(direction & DIGITAL_PAD_DIRECTION_LEFT) > 0
|
||||||
|
) ? pressedColor : normalColor
|
||||||
|
);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
canvas.drawLine(
|
||||||
|
getPercent(getWidth(), 33), getPercent(getHeight(), 100),
|
||||||
|
getPercent(getWidth(), 0), getPercent(getHeight(), 66),
|
||||||
|
paint
|
||||||
|
);
|
||||||
|
|
||||||
|
super.onDraw(canvas);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void newDirectionCallback(int direction)
|
||||||
|
{
|
||||||
|
_DBG("direction: " + direction);
|
||||||
|
|
||||||
|
// notify listeners
|
||||||
|
for (DigitalPadListener listener : listeners)
|
||||||
|
{
|
||||||
|
listener.onDirectionChange(direction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event)
|
||||||
|
{
|
||||||
|
if (onTouchListener != null)
|
||||||
|
{
|
||||||
|
return onTouchListener.onTouch(this, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// get masked (not specific to a pointer) action
|
||||||
|
int action = event.getActionMasked();
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
case MotionEvent.ACTION_POINTER_DOWN:
|
||||||
|
{
|
||||||
|
direction = 0;
|
||||||
|
|
||||||
|
if (event.getX() < getPercent(getWidth(), 33))
|
||||||
|
{
|
||||||
|
direction |= DIGITAL_PAD_DIRECTION_LEFT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getX() > getPercent(getWidth(), 66))
|
||||||
|
{
|
||||||
|
direction |= DIGITAL_PAD_DIRECTION_RIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getY() > getPercent(getHeight(), 66))
|
||||||
|
{
|
||||||
|
direction |= DIGITAL_PAD_DIRECTION_DOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getY() < getPercent(getHeight(), 33))
|
||||||
|
{
|
||||||
|
direction |= DIGITAL_PAD_DIRECTION_UP;
|
||||||
|
}
|
||||||
|
|
||||||
|
newDirectionCallback(direction);
|
||||||
|
|
||||||
|
invalidate();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
case MotionEvent.ACTION_POINTER_UP:
|
||||||
|
{
|
||||||
|
direction = 0;
|
||||||
|
|
||||||
|
newDirectionCallback(direction);
|
||||||
|
|
||||||
|
invalidate();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onTouchEvent(event);
|
||||||
|
}
|
||||||
|
}
|
@ -36,10 +36,7 @@ public class VirtualController
|
|||||||
private FrameLayout frame_layout = null;
|
private FrameLayout frame_layout = null;
|
||||||
private RelativeLayout relative_layout = null;
|
private RelativeLayout relative_layout = null;
|
||||||
|
|
||||||
private RelativeLayout.LayoutParams layoutParamsButtonDPadLeft = null;
|
private RelativeLayout.LayoutParams layoutParamsDPad = null;
|
||||||
private RelativeLayout.LayoutParams layoutParamsButtonDPadRight = null;
|
|
||||||
private RelativeLayout.LayoutParams layoutParamsButtonDPadUp = null;
|
|
||||||
private RelativeLayout.LayoutParams layoutParamsButtonDPadDown = null;
|
|
||||||
|
|
||||||
private RelativeLayout.LayoutParams layoutParamsButtonA = null;
|
private RelativeLayout.LayoutParams layoutParamsButtonA = null;
|
||||||
private RelativeLayout.LayoutParams layoutParamsButtonB = null;
|
private RelativeLayout.LayoutParams layoutParamsButtonB = null;
|
||||||
@ -57,19 +54,16 @@ public class VirtualController
|
|||||||
private Button buttonSelect = null;
|
private Button buttonSelect = null;
|
||||||
private Button buttonESC = null;
|
private Button buttonESC = null;
|
||||||
|
|
||||||
private Button buttonDPadLeft = null;
|
private DigitalPad digitalPad = null;
|
||||||
private Button buttonDPadRight = null;
|
|
||||||
private Button buttonDPadUp = null;
|
|
||||||
private Button buttonDPadDown = null;
|
|
||||||
|
|
||||||
private Button buttonA = null;
|
private DigitalButton buttonA = null;
|
||||||
private Button buttonB = null;
|
private DigitalButton buttonB = null;
|
||||||
private Button buttonX = null;
|
private DigitalButton buttonX = null;
|
||||||
private Button buttonY = null;
|
private DigitalButton buttonY = null;
|
||||||
private Button buttonLT = null;
|
private DigitalButton buttonLT = null;
|
||||||
private Button buttonRT = null;
|
private DigitalButton buttonRT = null;
|
||||||
private Button buttonLB = null;
|
private DigitalButton buttonLB = null;
|
||||||
private Button buttonRB = null;
|
private DigitalButton buttonRB = null;
|
||||||
|
|
||||||
|
|
||||||
private AnalogStick stick = null;
|
private AnalogStick stick = null;
|
||||||
@ -132,10 +126,7 @@ public class VirtualController
|
|||||||
{
|
{
|
||||||
relative_layout.removeAllViews();
|
relative_layout.removeAllViews();
|
||||||
|
|
||||||
layoutParamsButtonDPadLeft = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
layoutParamsDPad = new RelativeLayout.LayoutParams(getPercentageV(30), getPercentageV(30));
|
||||||
layoutParamsButtonDPadRight = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
|
||||||
layoutParamsButtonDPadUp = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
|
||||||
layoutParamsButtonDPadDown = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
|
||||||
|
|
||||||
layoutParamsParamsStick = new RelativeLayout.LayoutParams(getPercentageV(40), getPercentageV(40));
|
layoutParamsParamsStick = new RelativeLayout.LayoutParams(getPercentageV(40), getPercentageV(40));
|
||||||
layoutParamsParamsStick2 = new RelativeLayout.LayoutParams(getPercentageV(40), getPercentageV(40));
|
layoutParamsParamsStick2 = new RelativeLayout.LayoutParams(getPercentageV(40), getPercentageV(40));
|
||||||
@ -150,10 +141,7 @@ public class VirtualController
|
|||||||
layoutParamsButtonLB = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
layoutParamsButtonLB = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
||||||
layoutParamsButtonRB = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
layoutParamsButtonRB = new RelativeLayout.LayoutParams(getPercentageV(10), getPercentageV(10));
|
||||||
|
|
||||||
setPercentilePosition(layoutParamsButtonDPadLeft, 5, 45);
|
setPercentilePosition(layoutParamsDPad, 10, 35);
|
||||||
setPercentilePosition(layoutParamsButtonDPadRight, 15, 45);
|
|
||||||
setPercentilePosition(layoutParamsButtonDPadUp, 10, 35);
|
|
||||||
setPercentilePosition(layoutParamsButtonDPadDown, 10, 55);
|
|
||||||
|
|
||||||
setPercentilePosition(layoutParamsParamsStick, 22, 78);
|
setPercentilePosition(layoutParamsParamsStick, 22, 78);
|
||||||
setPercentilePosition(layoutParamsParamsStick2, 78, 78);
|
setPercentilePosition(layoutParamsParamsStick2, 78, 78);
|
||||||
@ -169,13 +157,11 @@ public class VirtualController
|
|||||||
setPercentilePosition(layoutParamsButtonLB, 85, 28);
|
setPercentilePosition(layoutParamsButtonLB, 85, 28);
|
||||||
setPercentilePosition(layoutParamsButtonRB, 92, 23);
|
setPercentilePosition(layoutParamsButtonRB, 92, 23);
|
||||||
|
|
||||||
relative_layout.addView(buttonDPadLeft, layoutParamsButtonDPadLeft);
|
relative_layout.addView(digitalPad, layoutParamsDPad);
|
||||||
relative_layout.addView(buttonDPadRight, layoutParamsButtonDPadRight);
|
|
||||||
relative_layout.addView(buttonDPadUp, layoutParamsButtonDPadUp);
|
|
||||||
relative_layout.addView(buttonDPadDown, layoutParamsButtonDPadDown);
|
|
||||||
|
|
||||||
relative_layout.addView(stick, layoutParamsParamsStick);
|
relative_layout.addView(stick, layoutParamsParamsStick);
|
||||||
relative_layout.addView(stick2, layoutParamsParamsStick2);
|
relative_layout.addView(stick2, layoutParamsParamsStick2);
|
||||||
|
|
||||||
relative_layout.addView(buttonA, layoutParamsButtonA);
|
relative_layout.addView(buttonA, layoutParamsButtonA);
|
||||||
relative_layout.addView(buttonB, layoutParamsButtonB);
|
relative_layout.addView(buttonB, layoutParamsButtonB);
|
||||||
relative_layout.addView(buttonX, layoutParamsButtonX);
|
relative_layout.addView(buttonX, layoutParamsButtonX);
|
||||||
@ -204,197 +190,188 @@ public class VirtualController
|
|||||||
|
|
||||||
frame_layout.addView(relative_layout);
|
frame_layout.addView(relative_layout);
|
||||||
|
|
||||||
buttonDPadLeft = new Button(context);
|
digitalPad = new DigitalPad(context);
|
||||||
buttonDPadLeft.setText("LF");
|
digitalPad.addDigitalPadListener(new DigitalPad.DigitalPadListener()
|
||||||
buttonDPadLeft.setOnTouchListener(new View.OnTouchListener()
|
{
|
||||||
{
|
@Override
|
||||||
@Override
|
public void onDirectionChange(int direction)
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
{
|
||||||
{
|
do
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.LEFT_FLAG);
|
{
|
||||||
|
if (direction == DigitalPad.DIGITAL_PAD_DIRECTION_NO_DIRECTION)
|
||||||
|
{
|
||||||
|
inputMap &= ~ControllerPacket.LEFT_FLAG;
|
||||||
|
inputMap &= ~ControllerPacket.RIGHT_FLAG;
|
||||||
|
inputMap &= ~ControllerPacket.UP_FLAG;
|
||||||
|
inputMap &= ~ControllerPacket.DOWN_FLAG;
|
||||||
|
|
||||||
return false;
|
break;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
buttonDPadRight = new Button(context);
|
if ((direction & DigitalPad.DIGITAL_PAD_DIRECTION_LEFT) > 0)
|
||||||
buttonDPadRight.setText("RI");
|
{
|
||||||
buttonDPadRight.setOnTouchListener(new View.OnTouchListener()
|
inputMap |= ControllerPacket.LEFT_FLAG;
|
||||||
{
|
}
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
|
||||||
{
|
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.RIGHT_FLAG);
|
|
||||||
|
|
||||||
return false;
|
if ((direction & DigitalPad.DIGITAL_PAD_DIRECTION_RIGHT) > 0)
|
||||||
}
|
{
|
||||||
});
|
inputMap |= ControllerPacket.RIGHT_FLAG;
|
||||||
|
}
|
||||||
|
|
||||||
buttonDPadUp = new Button(context);
|
if ((direction & DigitalPad.DIGITAL_PAD_DIRECTION_UP) > 0)
|
||||||
buttonDPadUp.setText("UP");
|
{
|
||||||
buttonDPadUp.setOnTouchListener(new View.OnTouchListener()
|
inputMap |= ControllerPacket.UP_FLAG;
|
||||||
{
|
}
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
|
||||||
{
|
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.UP_FLAG);
|
|
||||||
|
|
||||||
return false;
|
if ((direction & DigitalPad.DIGITAL_PAD_DIRECTION_DOWN) > 0)
|
||||||
}
|
{
|
||||||
});
|
inputMap |= ControllerPacket.DOWN_FLAG;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (false);
|
||||||
|
|
||||||
buttonDPadDown = new Button(context);
|
sendControllerInputPacket();
|
||||||
buttonDPadDown.setText("DW");
|
}
|
||||||
buttonDPadDown.setOnTouchListener(new View.OnTouchListener()
|
});
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
|
||||||
{
|
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.DOWN_FLAG);
|
|
||||||
|
|
||||||
return false;
|
buttonX = new DigitalButton(context);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
buttonX = new Button(context);
|
|
||||||
buttonX.setText("X");
|
buttonX.setText("X");
|
||||||
buttonX.setOnTouchListener(new View.OnTouchListener()
|
buttonX.addDigitalButtonListener(new DigitalButton.DigitalButtonListener() {
|
||||||
{
|
@Override
|
||||||
@Override
|
public void onClick() {
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
inputMap |= ControllerPacket.X_FLAG;
|
||||||
{
|
sendControllerInputPacket();
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.X_FLAG);
|
}
|
||||||
|
|
||||||
return false;
|
@Override
|
||||||
}
|
public void onRelease() {
|
||||||
});
|
inputMap &= ControllerPacket.X_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
buttonY = new Button(context);
|
buttonY = new DigitalButton(context);
|
||||||
buttonY.setText("Y");
|
buttonY.setText("Y");
|
||||||
buttonY.setOnTouchListener(new View.OnTouchListener()
|
buttonY.addDigitalButtonListener(new DigitalButton.DigitalButtonListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
public void onClick()
|
||||||
{
|
{
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.Y_FLAG);
|
inputMap |= ControllerPacket.Y_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
@Override
|
||||||
}
|
public void onRelease()
|
||||||
});
|
{
|
||||||
|
inputMap &= ControllerPacket.Y_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
buttonA = new Button(context);
|
buttonA = new DigitalButton(context);
|
||||||
buttonA.setText("A");
|
buttonA.setText("A");
|
||||||
buttonA.setOnTouchListener(new View.OnTouchListener()
|
buttonA.addDigitalButtonListener(new DigitalButton.DigitalButtonListener() {
|
||||||
{
|
@Override
|
||||||
@Override
|
public void onClick() {
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
inputMap |= ControllerPacket.A_FLAG;
|
||||||
{
|
sendControllerInputPacket();
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.A_FLAG);
|
}
|
||||||
|
|
||||||
return false;
|
@Override
|
||||||
}
|
public void onRelease() {
|
||||||
});
|
inputMap &= ControllerPacket.A_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
buttonB = new Button(context);
|
buttonB = new DigitalButton(context);
|
||||||
buttonB.setText("B");
|
buttonB.setText("B");
|
||||||
buttonB.setOnTouchListener(new View.OnTouchListener()
|
buttonB.addDigitalButtonListener(new DigitalButton.DigitalButtonListener() {
|
||||||
{
|
@Override
|
||||||
@Override
|
public void onClick() {
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
inputMap |= ControllerPacket.B_FLAG;
|
||||||
{
|
sendControllerInputPacket();
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.B_FLAG);
|
}
|
||||||
|
|
||||||
return false;
|
@Override
|
||||||
}
|
public void onRelease() {
|
||||||
});
|
inputMap &= ControllerPacket.B_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
buttonLT = new Button(context);
|
buttonLT = new DigitalButton(context);
|
||||||
buttonLT.setText("LT");
|
buttonLT.setText("LT");
|
||||||
buttonLT.setOnTouchListener(new View.OnTouchListener() {
|
buttonLT.addDigitalButtonListener(new DigitalButton.DigitalButtonListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
public void onClick()
|
||||||
// get masked (not specific to a pointer) action
|
{
|
||||||
int action = event.getActionMasked();
|
leftTrigger = (byte) (1 * 0xFF);
|
||||||
|
|
||||||
switch (action) {
|
sendControllerInputPacket();
|
||||||
case MotionEvent.ACTION_DOWN:
|
}
|
||||||
case MotionEvent.ACTION_POINTER_DOWN: {
|
|
||||||
leftTrigger = (byte) (1 * 0xFF);
|
|
||||||
|
|
||||||
sendControllerInputPacket();
|
@Override
|
||||||
|
public void onRelease()
|
||||||
|
{
|
||||||
|
leftTrigger = (byte) (0 * 0xFF);
|
||||||
|
|
||||||
break;
|
sendControllerInputPacket();
|
||||||
}
|
|
||||||
|
|
||||||
case MotionEvent.ACTION_UP:
|
|
||||||
case MotionEvent.ACTION_POINTER_UP: {
|
|
||||||
leftTrigger = (byte) (0 * 0xFF);
|
|
||||||
|
|
||||||
sendControllerInputPacket();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonRT = new Button(context);
|
buttonRT = new DigitalButton(context);
|
||||||
buttonRT.setText("RT");
|
buttonRT.setText("RT");
|
||||||
buttonRT.setOnTouchListener(new View.OnTouchListener() {
|
buttonRT.addDigitalButtonListener(new DigitalButton.DigitalButtonListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
public void onClick()
|
||||||
// get masked (not specific to a pointer) action
|
{
|
||||||
int action = event.getActionMasked();
|
rightTrigger = (byte) (0xFF);
|
||||||
|
|
||||||
switch (action) {
|
sendControllerInputPacket();
|
||||||
case MotionEvent.ACTION_DOWN:
|
}
|
||||||
case MotionEvent.ACTION_POINTER_DOWN: {
|
|
||||||
rightTrigger = (byte) (1 * 0xFF);
|
|
||||||
|
|
||||||
sendControllerInputPacket();
|
@Override
|
||||||
|
public void onRelease()
|
||||||
|
{
|
||||||
|
rightTrigger = (byte) (0);
|
||||||
|
|
||||||
break;
|
sendControllerInputPacket();
|
||||||
}
|
|
||||||
|
|
||||||
case MotionEvent.ACTION_UP:
|
|
||||||
case MotionEvent.ACTION_POINTER_UP: {
|
|
||||||
rightTrigger = (byte) (0 * 0xFF);
|
|
||||||
|
|
||||||
sendControllerInputPacket();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonLB = new Button(context);
|
buttonLB = new DigitalButton(context);
|
||||||
buttonLB.setText("LB");
|
buttonLB.setText("LB");
|
||||||
buttonLB.setOnTouchListener(new View.OnTouchListener()
|
buttonLB.addDigitalButtonListener(new DigitalButton.DigitalButtonListener() {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
public void onClick() {
|
||||||
{
|
inputMap |= ControllerPacket.LB_FLAG;
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.LB_FLAG);
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
@Override
|
||||||
|
public void onRelease() {
|
||||||
|
inputMap &= ControllerPacket.LB_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonRB = new Button(context);
|
buttonRB = new DigitalButton(context);
|
||||||
buttonRB.setText("RB");
|
buttonRB.setText("RB");
|
||||||
buttonRB.setOnTouchListener(new View.OnTouchListener()
|
buttonRB.addDigitalButtonListener(new DigitalButton.DigitalButtonListener() {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
public void onClick() {
|
||||||
{
|
inputMap |= ControllerPacket.RB_FLAG;
|
||||||
onButtonTouchEvent(v, event, ControllerPacket.RB_FLAG);
|
sendControllerInputPacket();
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
@Override
|
||||||
|
public void onRelease() {
|
||||||
|
inputMap &= ControllerPacket.RB_FLAG;
|
||||||
|
sendControllerInputPacket();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -450,40 +427,30 @@ public class VirtualController
|
|||||||
|
|
||||||
frame_layout.addView(relative_layout);
|
frame_layout.addView(relative_layout);
|
||||||
|
|
||||||
buttonDPadLeft = new Button(context);
|
digitalPad = new DigitalPad(context);
|
||||||
buttonDPadLeft.setText("LF");
|
|
||||||
|
|
||||||
buttonDPadRight = new Button(context);
|
buttonX = new DigitalButton(context);
|
||||||
buttonDPadRight.setText("RI");
|
|
||||||
|
|
||||||
buttonDPadUp = new Button(context);
|
|
||||||
buttonDPadUp.setText("UP");
|
|
||||||
|
|
||||||
buttonDPadDown = new Button(context);
|
|
||||||
buttonDPadDown.setText("DW");
|
|
||||||
|
|
||||||
buttonX = new Button(context);
|
|
||||||
buttonX.setText("X");
|
buttonX.setText("X");
|
||||||
|
|
||||||
buttonY = new Button(context);
|
buttonY = new DigitalButton(context);
|
||||||
buttonY.setText("Y");
|
buttonY.setText("Y");
|
||||||
|
|
||||||
buttonA = new Button(context);
|
buttonA = new DigitalButton(context);
|
||||||
buttonA.setText("A");
|
buttonA.setText("A");
|
||||||
|
|
||||||
buttonB = new Button(context);
|
buttonB = new DigitalButton(context);
|
||||||
buttonB.setText("B");
|
buttonB.setText("B");
|
||||||
|
|
||||||
buttonLT = new Button(context);
|
buttonLT = new DigitalButton(context);
|
||||||
buttonLT.setText("LT");
|
buttonLT.setText("LT");
|
||||||
|
|
||||||
buttonRT = new Button(context);
|
buttonRT = new DigitalButton(context);
|
||||||
buttonRT.setText("RT");
|
buttonRT.setText("RT");
|
||||||
|
|
||||||
buttonLB = new Button(context);
|
buttonLB = new DigitalButton(context);
|
||||||
buttonLB.setText("LB");
|
buttonLB.setText("LB");
|
||||||
|
|
||||||
buttonRB = new Button(context);
|
buttonRB = new DigitalButton(context);
|
||||||
buttonRB.setText("RB");
|
buttonRB.setText("RB");
|
||||||
|
|
||||||
stick = new AnalogStick(context);
|
stick = new AnalogStick(context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user