Reputation: 1736
I am trying to create an application that employs the scrollView in Android. It so happens that scrollView does not support matrices. Therefore I can not do something like this:
Matrix matrix = new Matrix();
Matrix eventMatrix = new Matrix();
// possible touch states
final static int NONE = 0;
final static int DRAG = 1;
final static int ZOOM = 2;
int touchState = NONE;
Would anyone know if it is possible to attain the zooming as well as pinching functionality through other process? Appreciate the help.
Thanks.
[RE-EDIT]
The scrollView will serve as a container so that various UIs can be placed inside it. That way the scrollView can serve as one UI part.
Thanks.
Upvotes: 4
Views: 6935
Reputation: 6663
Depending on your specific requirements here are a couple possible approaches to this problem:
Upvotes: 2
Reputation: 4041
If your intention is to provide zoom capabilities to an image, then you're in luck! I wrote a fairly thorough class that extends ImageView to add pinch zoom and panning functionality, with boundary testing. Check it out here. If that's not what you want, then you'll have to provide more information about exactly what you want to do. But, this code might be adaptable to your needs.
Upvotes: 0
Reputation: 7410
I'm not sure what you are using the ScrollView for but you should take a look at this android developer article - Making sense of multitouch to get pinch/zoom functionality.
Upvotes: 1