1

I've been trying to create a ViewGroup that allows me to move it's children around individually and at the same time let's me use pinch zoom. I started with a version that allowed me to move children individually in an absolute manner. Having a onTouchListner on every child and then changing that childs position in it's LayoutParams.

When researching how to implement pinch zoom for my app i came across this blogg post http://android-developers.blogspot.de/2010/06/making-sense-of-multitouch.html and this stackoverflow question View with horizontal and vertical pan/drag and pinch-zoom. In these examples they use canvas.transform to move things around but this moves the parent and all of it's containing children around. I want to move children around individualy but maintain the functionality in the above example that allows for zooming and maintains functionality for (for instance) buttons inside the children.

What is the best strategy to adress this? Is there a way to use the examples but change them so they identify what child is being moved and then only transform the canvas for that particular child or do I need to use my old strategy moving children with LayoutParams if so how would you implement zoom?

Community
  • 1
  • 1
JonasE
  • 31
  • 4
  • see my answer here http://stackoverflow.com/questions/21633545/android-imageview-scaling-and-translating-issue on how i did it for Bitmaps in custom View, you would need to change it to work for Views in custom ViewGroup – pskink May 27 '14 at 12:15
  • Through offline help I have solved this combining the two strategy’s. I will post code in an answer as soon as I have time. – JonasE May 27 '14 at 13:45
  • What was the solution here? I am trying to implement the same thing and thought about using AbsolueView but knowing that it is deprecated I've had doubts and did not start development – John Ernest Guadalupe Jun 25 '15 at 02:52

0 Answers0