Pinch Zoom gridview - android

I'd like to implement a GridView with Pinch Zoom. for example, if we zoom on an area the number of cells will decrease.
I'm trying to do this with a GridView because each cell should be clickable for doing a different action.
Is there any interface I need to implement? Is it possible to get this result with an ImageView? How would you do it? Code would be appreciated.

Related

How to Resize imageview size using ontouch Android

I have an ImageView which I want to "resize", not re-sizing the Image but the ImageView, I know I have to implement it using onTouch, but I what I do not know is how to use the given Coordinates in getting a resize, a good example would be WhatsApp, when one ought to set a new display Image on android, it takes them to the gallery then it brings up a "grid" like view which has 8 points, one of each corner and one in between the two points at each corner, you can resize that view how you like it, you can drag the points and the view sizes updates to drop point height and width, how Can i implement such a view? all help will be highly appreciated
look at this Moving Images on the Screen with Android
How to use Multi-touch in Android 2: Part 6, Implementing the Pinch Zoom Gesture

How to pinch zoom in/out and pan around in LinearLayout in android?

In my android app, I have a linearlayout where I put many linearlayouts with images in it. It will go past the screen border horizontally and vertically.
I want the user to pinch zoom in or out and pan around. I tried putting it in a horizontal scroll and vertical scroll, but it wont let me zoom, and I can only move in 1 direction at 1 time, like it wont let me move diagonally.
I tried this plugin
https://code.google.com/p/android-zoom-view/downloads/list
But it won't let me pan around. It only lets me do it on the stuff thats visible on the screen...
Does anyone know how to make this work?
Thanks
The easiest way I can think of is to put your images in HTML and use webview to display it.Webview automatically handles zooming and panning of content.

Change the number of columns in GridView With Zoom / Pinch

In my application I implemented a Gallery like view using GridView. I want to change the number of columns in GridView manually as per user's choice. I can change it by providing any button or menu option. I want to do same thing with Zoom / Pinch operation like, if some one tries to zoom the GridView, it should reduce the number of columns and increase the same if tries to Pinch. To achieve this I tried overriding onTouch event but its neither smooth nor as desired. If any one knows or have any idea of how to achieve this please let me know.
This won't be easy.
First I would try this:
Put a plain View on top of the GridView (i.e. this View is at the same position as GridView and has the same width and height).
Override the onTouchEvent of this plain View. If you detect a Pinch Zoom do the special handling (changing the GridView's columns). If you don't detect a Pinch Zoom, let the onTouchEvent return false (not handled) letting the touch-events bubble down to the underlying GridView.
The trick is in recognizing a Pinch Zoom correctly and not messing up the default touch behavior of the GridView.

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?

Categories

Resources