-1

I have a fragment where I have a 2 relative layouts as a child of a linear layout. Now I want that on pinching the layout, 2nd relative layout which is below the first relative layout should have zooming effect like on pinch, layout should zoom in and out. At the same time I want the upper Relative layout to scroll above when 2nd relative layout is zoomed in. This is same as gmail inbox.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Bhuvi
  • 1
  • 2

1 Answers1

0

The below layout would be a zoomable layout. You can read from here or here about how to create a zoomable viewGroup.

Now you will have to pass scaleFactor from your zoomable layout to your activity or fragment (where both the layouts exist). Use view.setTranslationY(scaleFactor * 500) to move the upper layout as user zooms in. 500 here is an arbitrary number, changing it will change the speed of movement of your header.

Now the trick is to also move the bottom zoomable layout as the header moves. Because if you don't move that up, the zoom will only happen in the bounds of bottom layout and there will be white space where your header used to be.

VipulKumar
  • 2,385
  • 1
  • 22
  • 28