[Class] Pinch Zoom and Move View
I had the need for my purposes to do the Pinch Zoom in contemporary Move to a View, now I put my code available to anyone who might be in need, just to get ideas on what to do.
Is required the library Gesture and Reflection of Agraham.
Events:
- Click
- LongClick
- Change
Property:
- CanMove
- CanZoom
- LimitArea
- LimitBorder
- Zoom
[UPDATE 1.00]
I changed the code in Class.
[UPDATE 1.10]
Added the following methods:
SetIfCanMove() - sets whether the View may translare or not.
GetIfCanMove - returns if the View can translate.
SetZoom() - sets the zoom.
GetZoom - returns the current zoom.
[UPDATE 1.20]
Improved zoom function, now the zoom is localized based on the touches.
Renamed Class in PinchZoomAndMove.
[UPDATE 1.30]
Added the possibility to set the BringToFront.
Added the possibility to set the Tag for a multi-View.
Added the "Click" event for the View.
[UPDATE 1.40]
Added the LongClick event for the View.
Added methods SetIfCanMove() - sets whether the View may zoom or not.
Inserted also Library version in Zip Class.
Changed the type of data sent with the Click events and LongClick.
[UPDATE 1.41]
Now works in Obfuscated mode. Thanks Informatix!
Improvements to minors.
[UPDATE 1.43]
Now the events are generated in different activity from the Main.
Added the following methods:
SetLimitBorder() - if it is True, the View will not come out from the edges of its parent.
SetLimitArea() - if True, the edges of the View will remain within its parent.
[UPDATE 1.44]
Added the Change event for the View.
[UPDATE 1.45]
Converted the property into methods for ease of use, but this requires a small change to the code of the old methods.
For suggestions and bug reports please do not hesitate to post it here.
I had the need for my purposes to do the Pinch Zoom in contemporary Move to a View, now I put my code available to anyone who might be in need, just to get ideas on what to do.
Is required the library Gesture and Reflection of Agraham.
Events:
- Click
- LongClick
- Change
Property:
- CanMove
- CanZoom
- LimitArea
- LimitBorder
- Zoom
[UPDATE 1.00]
I changed the code in Class.
[UPDATE 1.10]
Added the following methods:
SetIfCanMove() - sets whether the View may translare or not.
GetIfCanMove - returns if the View can translate.
SetZoom() - sets the zoom.
GetZoom - returns the current zoom.
[UPDATE 1.20]
Improved zoom function, now the zoom is localized based on the touches.
Renamed Class in PinchZoomAndMove.
[UPDATE 1.30]
Added the possibility to set the BringToFront.
Added the possibility to set the Tag for a multi-View.
Added the "Click" event for the View.
[UPDATE 1.40]
Added the LongClick event for the View.
Added methods SetIfCanMove() - sets whether the View may zoom or not.
Inserted also Library version in Zip Class.
Changed the type of data sent with the Click events and LongClick.
[UPDATE 1.41]
Now works in Obfuscated mode. Thanks Informatix!
Improvements to minors.
[UPDATE 1.43]
Now the events are generated in different activity from the Main.
Added the following methods:
SetLimitBorder() - if it is True, the View will not come out from the edges of its parent.
SetLimitArea() - if True, the edges of the View will remain within its parent.
[UPDATE 1.44]
Added the Change event for the View.
[UPDATE 1.45]
Converted the property into methods for ease of use, but this requires a small change to the code of the old methods.
For suggestions and bug reports please do not hesitate to post it here.
Attachments
Last edited: