public final class

MotionEventCompat

extends java.lang.Object

 java.lang.Object

↳androidx.core.view.MotionEventCompat

Gradle dependencies

compile group: 'androidx.core', name: 'core', version: '1.15.0-alpha02'

  • groupId: androidx.core
  • artifactId: core
  • version: 1.15.0-alpha02

Artifact androidx.core:core:1.15.0-alpha02 it located at Google repository (https://maven.google.com/)

Androidx artifact mapping:

androidx.core:core com.android.support:support-compat

Androidx class mapping:

androidx.core.view.MotionEventCompat android.support.v4.view.MotionEventCompat

Overview

Helper for accessing features in MotionEvent.

Summary

Fields
public static final intACTION_HOVER_ENTER

Synonym for MotionEvent.

public static final intACTION_HOVER_EXIT

Synonym for MotionEvent.

public static final intACTION_HOVER_MOVE

Synonym for MotionEvent.

public static final intACTION_MASK

Synonym for MotionEvent.

public static final intACTION_POINTER_DOWN

Synonym for MotionEvent.

public static final intACTION_POINTER_INDEX_MASK

Synonym for MotionEvent.

public static final intACTION_POINTER_INDEX_SHIFT

Synonym for MotionEvent.

public static final intACTION_POINTER_UP

Synonym for MotionEvent.

public static final intACTION_SCROLL

Synonym for MotionEvent.

public static final intAXIS_BRAKE

Synonym for MotionEvent.

public static final intAXIS_DISTANCE

Synonym for MotionEvent.

public static final intAXIS_GAS

Synonym for MotionEvent.

public static final intAXIS_GENERIC_1

Synonym for MotionEvent.

public static final intAXIS_GENERIC_10

Synonym for MotionEvent.

public static final intAXIS_GENERIC_11

Synonym for MotionEvent.

public static final intAXIS_GENERIC_12

Synonym for MotionEvent.

public static final intAXIS_GENERIC_13

Synonym for MotionEvent.

public static final intAXIS_GENERIC_14

Synonym for MotionEvent.

public static final intAXIS_GENERIC_15

Synonym for MotionEvent.

public static final intAXIS_GENERIC_16

Synonym for MotionEvent.

public static final intAXIS_GENERIC_2

Synonym for MotionEvent.

public static final intAXIS_GENERIC_3

Synonym for MotionEvent.

public static final intAXIS_GENERIC_4

Synonym for MotionEvent.

public static final intAXIS_GENERIC_5

Synonym for MotionEvent.

public static final intAXIS_GENERIC_6

Synonym for MotionEvent.

public static final intAXIS_GENERIC_7

Synonym for MotionEvent.

public static final intAXIS_GENERIC_8

Synonym for MotionEvent.

public static final intAXIS_GENERIC_9

Synonym for MotionEvent.

public static final intAXIS_HAT_X

Synonym for MotionEvent.

public static final intAXIS_HAT_Y

Synonym for MotionEvent.

public static final intAXIS_HSCROLL

Synonym for MotionEvent.

public static final intAXIS_LTRIGGER

Synonym for MotionEvent.

public static final intAXIS_ORIENTATION

Synonym for MotionEvent.

public static final intAXIS_PRESSURE

Synonym for MotionEvent.

public static final intAXIS_RELATIVE_X

Synonym for MotionEvent.

public static final intAXIS_RELATIVE_Y

Synonym for MotionEvent.

public static final intAXIS_RTRIGGER

Synonym for MotionEvent.

public static final intAXIS_RUDDER

Synonym for MotionEvent.

public static final intAXIS_RX

Synonym for MotionEvent.

public static final intAXIS_RY

Synonym for MotionEvent.

public static final intAXIS_RZ

Synonym for MotionEvent.

public static final intAXIS_SCROLL

Synonym for MotionEvent.

public static final intAXIS_SIZE

Synonym for MotionEvent.

public static final intAXIS_THROTTLE

Synonym for MotionEvent.

public static final intAXIS_TILT

Synonym for MotionEvent.

public static final intAXIS_TOOL_MAJOR

Synonym for MotionEvent.

public static final intAXIS_TOOL_MINOR

Synonym for MotionEvent.

public static final intAXIS_TOUCH_MAJOR

Synonym for MotionEvent.

public static final intAXIS_TOUCH_MINOR

Synonym for MotionEvent.

public static final intAXIS_VSCROLL

Synonym for MotionEvent.

public static final intAXIS_WHEEL

Synonym for MotionEvent.

public static final intAXIS_X

Synonym for MotionEvent.

public static final intAXIS_Y

Synonym for MotionEvent.

public static final intAXIS_Z

Synonym for MotionEvent.

public static final intBUTTON_PRIMARY

Synonym for MotionEvent.

Methods
public static intfindPointerIndex(MotionEvent event, int pointerId)

Call MotionEvent.

public static intgetActionIndex(MotionEvent event)

Call MotionEvent, returning only the pointer index portion.

public static intgetActionMasked(MotionEvent event)

Call MotionEvent, returning only the MotionEventCompat.ACTION_MASK portion.

public static floatgetAxisValue(MotionEvent event, int axis)

Get axis value for the first pointer index (may be an arbitrary pointer identifier).

public static floatgetAxisValue(MotionEvent event, int axis, int pointerIndex)

Returns the value of the requested axis for the given pointer index (use MotionEventCompat.getPointerId(MotionEvent, int) to find the pointer identifier for this index).

public static intgetButtonState(MotionEvent event)

public static intgetPointerCount(MotionEvent event)

The number of pointers of data contained in this event.

public static intgetPointerId(MotionEvent event, int pointerIndex)

Call MotionEvent.

public static intgetSource(MotionEvent event)

Gets the source of the event.

public static floatgetX(MotionEvent event, int pointerIndex)

Call MotionEvent.

public static floatgetY(MotionEvent event, int pointerIndex)

Call MotionEvent.

public static booleanisFromSource(MotionEvent event, int source)

Determines whether the event is from the given source.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int ACTION_MASK

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_POINTER_DOWN

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_POINTER_UP

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_HOVER_MOVE

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_SCROLL

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_POINTER_INDEX_MASK

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_POINTER_INDEX_SHIFT

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_HOVER_ENTER

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int ACTION_HOVER_EXIT

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_X

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_Y

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_PRESSURE

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_SIZE

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_TOUCH_MAJOR

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_TOUCH_MINOR

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_TOOL_MAJOR

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_TOOL_MINOR

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_ORIENTATION

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_VSCROLL

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_HSCROLL

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_Z

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_RX

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_RY

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_RZ

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_HAT_X

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_HAT_Y

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_LTRIGGER

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_RTRIGGER

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_THROTTLE

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_RUDDER

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_WHEEL

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GAS

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_BRAKE

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_DISTANCE

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_TILT

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_SCROLL

Synonym for MotionEvent.

public static final int AXIS_RELATIVE_X

Synonym for MotionEvent.

public static final int AXIS_RELATIVE_Y

Synonym for MotionEvent.

public static final int AXIS_GENERIC_1

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_2

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_3

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_4

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_5

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_6

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_7

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_8

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_9

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_10

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_11

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_12

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_13

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_14

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_15

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int AXIS_GENERIC_16

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

public static final int BUTTON_PRIMARY

Deprecated: Use MotionEvent directly.

Synonym for MotionEvent.

Methods

public static int getActionMasked(MotionEvent event)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Call MotionEvent, returning only the MotionEventCompat.ACTION_MASK portion.

public static int getActionIndex(MotionEvent event)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Call MotionEvent, returning only the pointer index portion.

public static int findPointerIndex(MotionEvent event, int pointerId)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Call MotionEvent.

public static int getPointerId(MotionEvent event, int pointerIndex)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Call MotionEvent.

public static float getX(MotionEvent event, int pointerIndex)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Call MotionEvent.

public static float getY(MotionEvent event, int pointerIndex)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Call MotionEvent.

public static int getPointerCount(MotionEvent event)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

The number of pointers of data contained in this event. Always

public static int getSource(MotionEvent event)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Gets the source of the event.

Returns:

The event source or InputDeviceCompat.SOURCE_UNKNOWN if unknown.

public static boolean isFromSource(MotionEvent event, int source)

Determines whether the event is from the given source.

Parameters:

event: motion event for which to check the source.
source: The input source to check against.

Returns:

Whether the event is from the given source.

public static float getAxisValue(MotionEvent event, int axis)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Get axis value for the first pointer index (may be an arbitrary pointer identifier).

Parameters:

event: motion event for which to get the value.
axis: The axis identifier for the axis value to retrieve.

See also: MotionEventCompat.AXIS_X, MotionEventCompat.AXIS_Y

public static float getAxisValue(MotionEvent event, int axis, int pointerIndex)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Returns the value of the requested axis for the given pointer index (use MotionEventCompat.getPointerId(MotionEvent, int) to find the pointer identifier for this index).

Parameters:

event: motion event for which to get the value.
axis: The axis identifier for the axis value to retrieve.
pointerIndex: Raw index of pointer to retrieve. Value may be from 0 (the first pointer that is down) to MotionEventCompat.getPointerCount(MotionEvent)-1.

Returns:

The value of the axis, or 0 if the axis is not available.

See also: MotionEventCompat.AXIS_X, MotionEventCompat.AXIS_Y

public static int getButtonState(MotionEvent event)

Deprecated: Call MotionEvent directly. This method will be removed in a future release.

Source

/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.core.view;

import android.view.MotionEvent;

import androidx.annotation.NonNull;

/**
 * Helper for accessing features in {@link MotionEvent}.
 */
public final class MotionEventCompat {
    /**
     * Synonym for {@link MotionEvent#ACTION_MASK}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_MASK} directly.
     */
    @Deprecated
    public static final int ACTION_MASK = 0xff;

    /**
     * Synonym for {@link MotionEvent#ACTION_POINTER_DOWN}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_POINTER_DOWN} directly.
     */
    @Deprecated
    public static final int ACTION_POINTER_DOWN = 5;

    /**
     * Synonym for {@link MotionEvent#ACTION_POINTER_UP}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_POINTER_UP} directly.
     */
    @Deprecated
    public static final int ACTION_POINTER_UP = 6;

    /**
     * Synonym for {@link MotionEvent#ACTION_HOVER_MOVE}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_HOVER_MOVE} directly.
     */
    @Deprecated
    public static final int ACTION_HOVER_MOVE = 7;

    /**
     * Synonym for {@link MotionEvent#ACTION_SCROLL}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_SCROLL} directly.
     */
    @Deprecated
    public static final int ACTION_SCROLL = 8;

    /**
     * Synonym for {@link MotionEvent#ACTION_POINTER_INDEX_MASK}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_POINTER_INDEX_MASK} directly.
     */
    @Deprecated
    public static final int ACTION_POINTER_INDEX_MASK  = 0xff00;

    /**
     * Synonym for {@link MotionEvent#ACTION_POINTER_INDEX_SHIFT}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_POINTER_INDEX_SHIFT} directly.
     */
    @Deprecated
    public static final int ACTION_POINTER_INDEX_SHIFT = 8;

    /**
     * Synonym for {@link MotionEvent#ACTION_HOVER_ENTER}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_HOVER_ENTER} directly.
     */
    @Deprecated
    public static final int ACTION_HOVER_ENTER = 9;

    /**
     * Synonym for {@link MotionEvent#ACTION_HOVER_EXIT}.
     *
     * @deprecated Use {@link MotionEvent#ACTION_HOVER_EXIT} directly.
     */
    @Deprecated
    public static final int ACTION_HOVER_EXIT = 10;

    /**
     * Synonym for {@link MotionEvent#AXIS_X}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_X} directly.
     */
    @Deprecated
    public static final int AXIS_X = 0;

    /**
     * Synonym for {@link MotionEvent#AXIS_Y}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_Y} directly.
     */
    @Deprecated
    public static final int AXIS_Y = 1;

    /**
     * Synonym for {@link MotionEvent#AXIS_PRESSURE}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_PRESSURE} directly.
     */
    @Deprecated
    public static final int AXIS_PRESSURE = 2;

    /**
     * Synonym for {@link MotionEvent#AXIS_SIZE}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_SIZE} directly.
     */
    @Deprecated
    public static final int AXIS_SIZE = 3;

    /**
     * Synonym for {@link MotionEvent#AXIS_TOUCH_MAJOR}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_TOUCH_MAJOR} directly.
     */
    @Deprecated
    public static final int AXIS_TOUCH_MAJOR = 4;

    /**
     * Synonym for {@link MotionEvent#AXIS_TOUCH_MINOR}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_TOUCH_MINOR} directly.
     */
    @Deprecated
    public static final int AXIS_TOUCH_MINOR = 5;

    /**
     * Synonym for {@link MotionEvent#AXIS_TOOL_MAJOR}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_TOOL_MAJOR} directly.
     */
    @Deprecated
    public static final int AXIS_TOOL_MAJOR = 6;

    /**
     * Synonym for {@link MotionEvent#AXIS_TOOL_MINOR}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_TOOL_MINOR} directly.
     */
    @Deprecated
    public static final int AXIS_TOOL_MINOR = 7;

    /**
     * Synonym for {@link MotionEvent#AXIS_ORIENTATION}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_ORIENTATION} directly.
     */
    @Deprecated
    public static final int AXIS_ORIENTATION = 8;

    /**
     * Synonym for {@link MotionEvent#AXIS_VSCROLL}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_VSCROLL} directly.
     */
    @Deprecated
    public static final int AXIS_VSCROLL = 9;

    /**
     * Synonym for {@link MotionEvent#AXIS_HSCROLL}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_HSCROLL} directly.
     */
    @Deprecated
    public static final int AXIS_HSCROLL = 10;

    /**
     * Synonym for {@link MotionEvent#AXIS_Z}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_Z} directly.
     */
    @Deprecated
    public static final int AXIS_Z = 11;

    /**
     * Synonym for {@link MotionEvent#AXIS_RX}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_RX} directly.
     */
    @Deprecated
    public static final int AXIS_RX = 12;

    /**
     * Synonym for {@link MotionEvent#AXIS_RY}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_RY} directly.
     */
    @Deprecated
    public static final int AXIS_RY = 13;

    /**
     * Synonym for {@link MotionEvent#AXIS_RZ}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_RZ} directly.
     */
    @Deprecated
    public static final int AXIS_RZ = 14;

    /**
     * Synonym for {@link MotionEvent#AXIS_HAT_X}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_HAT_X} directly.
     */
    @Deprecated
    public static final int AXIS_HAT_X = 15;

    /**
     * Synonym for {@link MotionEvent#AXIS_HAT_Y}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_HAT_Y} directly.
     */
    @Deprecated
    public static final int AXIS_HAT_Y = 16;

    /**
     * Synonym for {@link MotionEvent#AXIS_LTRIGGER}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_LTRIGGER} directly.
     */
    @Deprecated
    public static final int AXIS_LTRIGGER = 17;

    /**
     * Synonym for {@link MotionEvent#AXIS_RTRIGGER}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_RTRIGGER} directly.
     */
    @Deprecated
    public static final int AXIS_RTRIGGER = 18;

    /**
     * Synonym for {@link MotionEvent#AXIS_THROTTLE}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_THROTTLE} directly.
     */
    @Deprecated
    public static final int AXIS_THROTTLE = 19;

    /**
     * Synonym for {@link MotionEvent#AXIS_RUDDER}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_RUDDER} directly.
     */
    @Deprecated
    public static final int AXIS_RUDDER = 20;

    /**
     * Synonym for {@link MotionEvent#AXIS_WHEEL}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_WHEEL} directly.
     */
    @Deprecated
    public static final int AXIS_WHEEL = 21;

    /**
     * Synonym for {@link MotionEvent#AXIS_GAS}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GAS} directly.
     */
    @Deprecated
    public static final int AXIS_GAS = 22;

    /**
     * Synonym for {@link MotionEvent#AXIS_BRAKE}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_BRAKE} directly.
     */
    @Deprecated
    public static final int AXIS_BRAKE = 23;

    /**
     * Synonym for {@link MotionEvent#AXIS_DISTANCE}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_DISTANCE} directly.
     */
    @Deprecated
    public static final int AXIS_DISTANCE = 24;

    /**
     * Synonym for {@link MotionEvent#AXIS_TILT}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_TILT} directly.
     */
    @Deprecated
    public static final int AXIS_TILT = 25;

    /**
     * Synonym for {@link MotionEvent#AXIS_SCROLL}.
     */
    public static final int AXIS_SCROLL = 26;

    /**
     * Synonym for {@link MotionEvent#AXIS_RELATIVE_X}.
     */
    public static final int AXIS_RELATIVE_X = 27;

    /**
     * Synonym for {@link MotionEvent#AXIS_RELATIVE_Y}.
     */
    public static final int AXIS_RELATIVE_Y = 28;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_1}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_1} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_1 = 32;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_2}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_2} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_2 = 33;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_3}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_3} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_3 = 34;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_4}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_4} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_4 = 35;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_5}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_5} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_5 = 36;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_6}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_6} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_6 = 37;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_7}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_7} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_7 = 38;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_8}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_8} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_8 = 39;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_9}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_9} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_9 = 40;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_10}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_10} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_10 = 41;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_11}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_11} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_11 = 42;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_12}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_12} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_12 = 43;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_13}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_13} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_13 = 44;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_14}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_14} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_14 = 45;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_15}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_15} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_15 = 46;

    /**
     * Synonym for {@link MotionEvent#AXIS_GENERIC_16}.
     *
     * @deprecated Use {@link MotionEvent#AXIS_GENERIC_16} directly.
     */
    @Deprecated
    public static final int AXIS_GENERIC_16 = 47;

    /**
     * Synonym for {@link MotionEvent#BUTTON_PRIMARY}.
     *
     * @deprecated Use {@link MotionEvent#BUTTON_PRIMARY} directly.
     */
    @Deprecated
    public static final int BUTTON_PRIMARY = 1;

    /**
     * Call {@link MotionEvent#getAction}, returning only the {@link #ACTION_MASK}
     * portion.
     *
     * @deprecated Call {@link MotionEvent#getAction()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getActionMasked()")
    @Deprecated
    public static int getActionMasked(MotionEvent event) {
        return event.getActionMasked();
    }

    /**
     * Call {@link MotionEvent#getAction}, returning only the pointer index
     * portion.
     *
     * @deprecated Call {@link MotionEvent#getActionIndex()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getActionIndex()")
    @Deprecated
    public static int getActionIndex(MotionEvent event) {
        return event.getActionIndex();
    }

    /**
     * Call {@link MotionEvent#findPointerIndex(int)}.
     *
     * @deprecated Call {@link MotionEvent#findPointerIndex(int)} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.findPointerIndex(pointerId)")
    @Deprecated
    public static int findPointerIndex(MotionEvent event, int pointerId) {
        return event.findPointerIndex(pointerId);
    }

    /**
     * Call {@link MotionEvent#getPointerId(int)}.
     *
     * @deprecated Call {@link MotionEvent#getPointerId(int)} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getPointerId(pointerIndex)")
    @Deprecated
    public static int getPointerId(MotionEvent event, int pointerIndex) {
        return event.getPointerId(pointerIndex);
    }

    /**
     * Call {@link MotionEvent#getX(int)}.
     *
     * @deprecated Call {@link MotionEvent#getX()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getX(pointerIndex)")
    @Deprecated
    public static float getX(MotionEvent event, int pointerIndex) {
        return event.getX(pointerIndex);
    }

    /**
     * Call {@link MotionEvent#getY(int)}.
     *
     * @deprecated Call {@link MotionEvent#getY()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getY(pointerIndex)")
    @Deprecated
    public static float getY(MotionEvent event, int pointerIndex) {
        return event.getY(pointerIndex);
    }

    /**
     * The number of pointers of data contained in this event.  Always
     *
     * @deprecated Call {@link MotionEvent#getPointerCount()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getPointerCount()")
    @Deprecated
    public static int getPointerCount(MotionEvent event) {
        return event.getPointerCount();
    }

    /**
     * Gets the source of the event.
     *
     * @return The event source or {@link InputDeviceCompat#SOURCE_UNKNOWN} if unknown.
     * @deprecated Call {@link MotionEvent#getSource()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getSource()")
    @Deprecated
    public static int getSource(MotionEvent event) {
        return event.getSource();
    }

    /**
     * Determines whether the event is from the given source.
     * @param event motion event for which to check the source.
     * @param source The input source to check against.
     * @return Whether the event is from the given source.
     */
    public static boolean isFromSource(@NonNull MotionEvent event, int source) {
        return (event.getSource() & source) == source;
    }

    /**
     * Get axis value for the first pointer index (may be an
     * arbitrary pointer identifier).
     *
     * @param event motion event for which to get the value.
     * @param axis The axis identifier for the axis value to retrieve.
     *
     * @see #AXIS_X
     * @see #AXIS_Y
     *
     * @deprecated Call {@link MotionEvent#getAxisValue(int)} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getAxisValue(axis)")
    @Deprecated
    public static float getAxisValue(MotionEvent event, int axis) {
        return event.getAxisValue(axis);
    }

    /**
     * Returns the value of the requested axis for the given pointer <em>index</em>
     * (use {@link #getPointerId(MotionEvent, int)} to find the pointer identifier for this index).
     *
     * @param event motion event for which to get the value.
     * @param axis The axis identifier for the axis value to retrieve.
     * @param pointerIndex Raw index of pointer to retrieve.  Value may be from 0
     * (the first pointer that is down) to {@link #getPointerCount(MotionEvent)}-1.
     * @return The value of the axis, or 0 if the axis is not available.
     *
     * @see #AXIS_X
     * @see #AXIS_Y
     *
     * @deprecated Call {@link MotionEvent#getAxisValue(int, int)} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getAxisValue(axis, pointerIndex)")
    @Deprecated
    public static float getAxisValue(MotionEvent event, int axis, int pointerIndex) {
        return event.getAxisValue(axis, pointerIndex);
    }

    /**
     * @deprecated Call {@link MotionEvent#getButtonState()} directly. This method will be
     * removed in a future release.
     */
    @androidx.annotation.ReplaceWith(expression = "event.getButtonState()")
    @Deprecated
    public static int getButtonState(MotionEvent event) {
        return event.getButtonState();
    }

    private MotionEventCompat() {}
}