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
ScaleGestureDetector.SimpleOnScaleGestureListener ()
Public methods
onScale
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
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
void onScaleEnd (ScaleGestureDetector detector)
回应缩放手势的结尾。 现有指针正在上升。 一旦比例结束, getFocusX()
和getFocusY()
将返回屏幕上剩余指针的焦点。
Parameters |
detector |
ScaleGestureDetector : The detector reporting the event - use this to retrieve extended info about event state. |