Zoomable Imageview or Activity - android

I have an activity that has just a image to show like graphical help. It has a lots of info and needs to be zoomed. I searched alot in diffrent sites and they say imageview is not zoomable. and i found complicated algoritjhms for it. i want to make my programm to zoom like many usual proggrams that zoom like my 2 fingers get further image zooms in and if they get close zooms out and and i want to user be able to move postion if image in image view bye moving his finger on it.if its impossible can i make that as background and do these functions on whole activity? thanks for helping

This SO thread should have everything you need to implement the pinch zoom. Alternatively you could have a look at the PhotoView library; an implementation of ImageView that supports zooming.

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)

android ImageView vs canvas for game

I´m new in android development. I want to create a game where the user needs to quickly drag and drop balls with the finger in the screen to specific locations in order to win.
I don´t know if i can do this with simple ImageViews or i need to use canvas or other thing to draw in the screen.
I have tried to drag and drop an ImageView on top of another ImageView but it does not seem to work very well and i'm hesitating if i need to do it drawing figures instead of using the ImageViews or to do something else.
Please advice. Any help is apreciated. Thank you.
ImageViews are Views designed to hold image drawables, which isn't really needed in your case - you can use a simple View with a color background or implemended onDraw method, you can use an ImageView just as well.
Asfor the drag and drop, what you need is any View with implemented onTouch method so that the view changes its position on screen with ACTION_MOVE touch events.
If you're interested, i have implemented a simple frame layout with drag and drop functionality. My layout requires long-click to start drag, but it can be easily modified so it won't. Check it out at my github page. You can clone the project and run demo activity to see how it works, and start from there.

Android zoomable view with pin

I'm looking for tips or a lib that can help me with this challenge: I need to build a widget that is similar to a Map View. I mean, I have a huge image that will be used as background and a list of coordinates that should be used as pins over the image.
I need to achieve an experience similar to a Map View (pan, zoom and pinch gestures) and treat pin clicks. Once placed over the image, a pin should note move its position considering the background image.
The problem is not really new, but I couldn't solve it yet. I've tried a WebView with some html but the image is rendered really blurry.
Any tip? Any Github project? I've googled a lot and found no answer.

Moving image in circle with touch move

I want to move an image within a circle with my touch on move. I've been confused how to determine the coordinates circle boundaries when the finger moved.
For example I want to move this image like lock screen on android tabs.
http://cdn.alltouchtablet.com/wp-content/uploads/2012/03/samsung-galaxy-tab-7-plus-lock-screen.jpg
EDIT :
Now After learn the answer below, I managed to draw an circle image and moving this image around the screen.
And now, I want to restrict the image movement so that it only can moved in a circle, just like in the image above. Any ideas?
I hope you can help me. Thank you!
so I've actually not done anything like this but i know this tutorial : and the guy does something similar to what you want,
this video is one right in the middle of an entire playlist of tutorial videos if you dont get what he's doing check the previous few... as for moving the image in a circle i'm sure there'll be some way to set boundries :)
http://www.youtube.com/watch?v=9d4Wua-cxZs&list=PLB03EA9545DD188C3&index=32&feature=plpp_video
hope it was helpful!

How to animate Bitmap on Surface view onDraw()?

I am trying to make a game. I try to use GridView but wonder how can I drag Item onTouchEvent(). I found an example
http://www.droidnova.com/playing-with-graphics-in-android-part-ii,160.html
It is a great example. I cropped my image in 12 small image bitmap. display them on screen randomly on specific position.
By overriding the onTouchEvent() I got my requirement. Now I want to animate my image as the "swap" other image by animating. I have both images X,Y location.
I am wondring if it can by done by some Animation class.So that I should not put effort for doing it manually. I know it is not a hard job. But I Animation class can do it more smoothly.
So I have a ArrayOfImages(Bitmap) and I want to swap 2Images with animation. I am using a thread that update "Canvas" in background. Please help me.
.
I more thing. How can I add Scroll view with surface holder?? Is it possible? Because I think when I try to drag my image , It my not drag and active scrollbar for this response?
Finally I am using a loop for a specific x,y to a specific x,y while updating the canvas. Although this is not a efficient way.

Categories

Resources