OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.content.browser; |
| 6 |
| 7 import android.view.InputDevice; |
| 8 import android.view.MotionEvent; |
| 9 |
| 10 import org.chromium.base.CalledByNative; |
| 11 import org.chromium.base.JNINamespace; |
| 12 |
| 13 /** |
| 14 * TODO |
| 15 */ |
| 16 @JNINamespace("JNI_MotionEventUtil") |
| 17 final class MotionEventUtil { |
| 18 /** |
| 19 */ |
| 20 @CalledByNative |
| 21 public static float getAxisValueOrNaN(MotionEvent event, int axis, int point
erIndex) { |
| 22 InputDevice device = event.getDevice(); |
| 23 InputDevice.MotionRange range = device.getMotionRange(axis); |
| 24 if (range == null || range.getRange() == 0.0) |
| 25 return Float.NaN; |
| 26 return event.getAxisValue(axis, pointerIndex); |
| 27 } |
| 28 } |
OLD | NEW |