JoystickView for Android
Java
Switch branches/tags
Nothing to show
Clone or download
Latest commit 46b20f2 Nov 9, 2015

README.md

JoystickView

A JoystickView library for Android with an example

Joystick controller for android applications.

*Simple usage

*Callback interface implemented.

*Power and degree values returned.

*Changable assets.You can change joystick images as you wish.

From xml add the lines below: XML:

    <com.developwear.joystickview.JoystickView
    android:id="@+id/joystickview"
    android:layout_width="500px"
    android:layout_height="500px" />

And from your java class set joystickChangeListener:

    joystickView=(JoystickView)findViewById(R.id.joystickview);
    joystickView.setJoystickChangeListener(new JoystickView.JoystickChangeListener() {
        @Override
        public void onJoystickChanged(int power, int degree) {
            textView.setText("power:".concat(String.valueOf(power).concat(" - ")).concat("degree:").concat(String.valueOf(degree)));
        }
    });

Installation

You can either add as a module or directly add to build.gradle file as shown below:

    compile 'com.developwear:joystickviewlib:1.0.1'