Example usage for android.view MotionEvent axisToString

List of usage examples for android.view MotionEvent axisToString

Introduction

In this page you can find the example usage for android.view MotionEvent axisToString.

Prototype

public static String axisToString(int axis) 

Source Link

Document

Returns a string that represents the symbolic name of the specified axis such as "AXIS_X" or an equivalent numeric constant such as "42" if unknown.

Usage

From source file:Main.java

public static List<String> getAxisNames(InputDevice device) {
    List<String> axisNames = new ArrayList<String>();
    if (device == null) {
        return axisNames;
    }/*  w  ww .j a  v a 2  s  .  c  om*/

    List<MotionRange> motionRanges = device.getMotionRanges();
    for (MotionRange range : motionRanges) {
        axisNames.add(MotionEvent.axisToString(range.getAxis()));
    }

    return axisNames;
}