Most visited

Recently visited

Added in API level 8

ScaleGestureDetector.SimpleOnScaleGestureListener

public static class ScaleGestureDetector.SimpleOnScaleGestureListener
extends Object implements ScaleGestureDetector.OnScaleGestureListener

java.lang.Object
    android.view.ScaleGestureDetector.SimpleOnScaleGestureListener


如果您只想监听缩放相关事件的子集,则可以扩展便利类。 这实现了ScaleGestureDetector.OnScaleGestureListener所有方法,但什么都不做。 onScale(ScaleGestureDetector)返回false以便子类可以在重写的onScaleEnd中检索累计比例因子。 onScaleBegin(ScaleGestureDetector)返回true

摘要(Summary)

Public constructors

ScaleGestureDetector.SimpleOnScaleGestureListener()

公共方法(Public methods)

boolean onScale(ScaleGestureDetector detector)

响应正在进行的手势的缩放事件。

boolean onScaleBegin(ScaleGestureDetector detector)

响应缩放手势的开始。

void onScaleEnd(ScaleGestureDetector detector)

回应缩放手势的结尾。

继承方法(Inherited methods)

From class java.lang.Object
From interface android.view.ScaleGestureDetector.OnScaleGestureListener

Public constructors

ScaleGestureDetector.SimpleOnScaleGestureListener

Added in API level 8
ScaleGestureDetector.SimpleOnScaleGestureListener ()

公共方法(Public methods)

onScale

Added in API level 8
boolean onScale (ScaleGestureDetector detector)

响应正在进行的手势的缩放事件。 指针运动报告。

参数(Parameters)
detector ScaleGestureDetector: The detector reporting the event - use this to retrieve extended info about event state.
返回(Returns)
boolean Whether or not the detector should consider this event as handled. If an event was not handled, the detector will continue to accumulate movement until an event is handled. This can be useful if an application, for example, only wants to update scaling factors if the change is greater than 0.01.

onScaleBegin

Added in API level 8
boolean onScaleBegin (ScaleGestureDetector detector)

响应缩放手势的开始。 新指针报道下跌。

参数(Parameters)
detector ScaleGestureDetector: The detector reporting the event - use this to retrieve extended info about event state.
返回(Returns)
boolean Whether or not the detector should continue recognizing this gesture. For example, if a gesture is beginning with a focal point outside of a region where it makes sense, onScaleBegin() may return false to ignore the rest of the gesture.

onScaleEnd

Added in API level 8
void onScaleEnd (ScaleGestureDetector detector)

回应缩放手势的结尾。 现有指针正在上升。 一旦比例结束, getFocusX()getFocusY()将返回屏幕上剩余指针的焦点。

参数(Parameters)
detector ScaleGestureDetector: The detector reporting the event - use this to retrieve extended info about event state.

Hooray!