public class ZoomHandler
extends java.lang.Object
implements android.view.View.OnTouchListener, android.view.ScaleGestureDetector.OnScaleGestureListener
Modifier and Type | Field and Description |
---|---|
private android.hardware.Camera |
camera
The camera object to apply zoom effects on
|
private android.view.ScaleGestureDetector |
gestureScale
The scale gesture detector to detect pinch in and pinch out gestures
|
private float |
scaleFactor
The amount to scale
|
Constructor and Description |
---|
ZoomHandler(android.hardware.Camera camera,
android.content.Context c)
The default constructor of the zoom detector
|
Modifier and Type | Method and Description |
---|---|
boolean |
onScale(android.view.ScaleGestureDetector detector)
The main function to handle the zoom.
|
boolean |
onScaleBegin(android.view.ScaleGestureDetector detector)
Blank Function
|
void |
onScaleEnd(android.view.ScaleGestureDetector detector)
Blank Function
|
boolean |
onTouch(android.view.View view,
android.view.MotionEvent event)
A function to activate zoom on the touch events
|
private android.hardware.Camera camera
private android.view.ScaleGestureDetector gestureScale
private float scaleFactor
public ZoomHandler(android.hardware.Camera camera, android.content.Context c)
camera
- The camera to apply zoom effects on.c
- The context of the texture to listen zoo events onto.public boolean onScale(android.view.ScaleGestureDetector detector)
onScale
in interface android.view.ScaleGestureDetector.OnScaleGestureListener
detector
- Detector to get the scale factor to zoom accordingly.public boolean onScaleBegin(android.view.ScaleGestureDetector detector)
onScaleBegin
in interface android.view.ScaleGestureDetector.OnScaleGestureListener
detector
- -blank-public void onScaleEnd(android.view.ScaleGestureDetector detector)
onScaleEnd
in interface android.view.ScaleGestureDetector.OnScaleGestureListener
detector
- -blank-public boolean onTouch(android.view.View view, android.view.MotionEvent event)
onTouch
in interface android.view.View.OnTouchListener
view
- The view object of the textureevent
- The type of motion event.