Android Horizontal Zoom in LinearLayout? - android

Hi I have a one LinearLayout that would be contain some other views. I would like to have the ability to zoomIn and zoomOut(ONLY HORIZONTAL ZOOM OUT/IN) on the actual LinearLayout as a whole. Is there a way to do that?
Here am use screen shorts once look at this.
1)This IS general Image
NOTE: Without Effecting remaining viws

On touch zoom of View is described in documentation. And if you like zoom on gesture, i think this post be useful.

Related

think my Android app needs a pinch zoom and pan LAYOUT

So. Iv'e got a straight forward relative layout which I add multiple ImageViews to.
I don't want the images to obscure each other so as they are added they are translated so they don't.
As more ImageViews are added they need to be translated further and further away from the centre of the layout so as not to overlap other images and so they fall off the edge of the user's screen - no problem so far ...
I need to give the user the ability to pan to see the images that are off screen and also zoom in and out (with gestures not buttons) to see all images or focus in on one.
I think the solution to this problem is to modify the layout to allow pinch and pan but all I can find is how to create views that support pinch and pan.
I need each image to be in a separate ImageView.
Forgive me if this is the wrong way to come at this problem but any help would be much appreciated.
This might help explain:
want to scroll about and zoom around this layout (click to see)

Panning a layout with imageviews on it

I have been puzzled by how to approach this for a while. I have Framelayout with over 20 image views on it. I want to be able to pan the framelayout. Basically, touching and dragging causes the background image to pan (and the 20 image views to move along).
This is similar to what strategy games do (you have map and buildings).
I read all about panning and zooming and they all talking about doing this for single imageview. In my case, not only it is a layout but also it has other views.
How do I approach this? Any pointers ?
Thanks
I have a github project for zooming and panning although its for View Groups it would be easy to change for a View.
Check it out let me know if you have a question it is unfinished but works.
https://github.com/Xjasz/AndroidZoomableViewGroup
Copy the class and extends FrameLayout instead of ListView.
Then make sure in your XML to use the class instead of a FrameLayout.
You could have a TouchInterceptor/Custom view where on touch, you offset the view from its parent by the delta of the current touch coords from the last touch coords.

Android : GridView Zoom

I have two gridviews, they contains my custom views as their children. I have implemented a drag and drop functionality to drag a view from one grid to another. What I want to achieve now is when I drop my view on the main GameBoard grid, I want the Grid to Zoom automatically. I also want to implement Pinch zoom so that user can zoom in/out the grid by himself also. Is there any way to achieve this?
I have tried to increase the gridview column height and width dynamically, but it is not working out, please suggest me a way to do this.
Thanks.
I have dig out a lot after solving this, but I end up in a black hole. Revised entire game to remove the GridView and use basic Canvas to achieve all the functionality. Hope this helps someone.
Thanks

How to zoom normal views in Android

In my application, I would like to add zoom functionality to my views. Like in an activity I am displaying LinearLayout etc. But as of now what I know a view can be zoomed in only in WebView and not in normal view. After all what I want is to zoom in/zoom out feature similar to WebView in my normal views.
Thanks in advance.
Construct a Custom Layout extending Liner Layout or any other. Override its onDraw function and and provide zooming functionality manually. There are many example at SO for zooming. You can follow them..
This might help:
android pinch zoom
How to apply pinch zoom on Gallery in android?

Did a layout with many ui controls can support pinch and zoom gestures

I need apply pinch and zoom gestures for my complete view.
In my view there are a lot of controls like textviews, buttons, list view and all. This all have different listeners. I need to apply zoom to this without affecting the my UI controls and listeners.
I know how to zoom a image and using a webview. But how we apply zoom to complete layout with different controls and listeners ?
(I'm working on honeycomb)
At last i got the solution. We can use setScalaX and setScaleY with pivot point
I have explained it here
Zooming a view completely
Pinch Zoom to view completely
Im not aware of anything that will simply take care of this. All I can say is that I've known others to achieve this by applying a translation matrix to a route view group which then applies to it's children's views (if I remember correctly).
From this the touch events were converted to apply to the translated view.
To handle the pinch to zoom this may be of use: Android Dev - OnScaleGestureListener

Categories

Resources