0

I have relative layout in XML. On a button press I am adding Views ti it:

   LayoutInflater inflater =
   (LayoutInflater)this.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
   View iv = inflater.inflate( R.layout.motor_block, null );
   //LinearLayout iv = (LinearLayout) findViewById(R.id.motor_block);
   RelativeLayout rl = (RelativeLayout) findViewById(R.id.layout);

   rl.addView(iv);

Then I am using OnTouch to drag each of the Views INDIVIDUALLY. Is it possible to add pan and zoom to ALL the views as a group?

Sochimickox
  • 135
  • 1
  • 2
  • 9
  • See my answer here: [http://stackoverflow.com/questions/20225265/pinch-zoom-and-pan/20226476#20226476][1] [1]: http://stackoverflow.com/questions/20225265/pinch-zoom-and-pan/20226476#20226476 – beplaya Nov 26 '13 at 19:53

1 Answers1

0

yes it is, you need to set onTouchListener on your main layout, add ScaleGestureDetector and inside of its onScale method you can manipulate your views whatever you want.

Maciej Boguta
  • 1,354
  • 1
  • 12
  • 15