This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using animations inside a view object to pan / zoom around a large image  RSS feed

Posts: 1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm new to android development and have a question regarding animating an image within a custom view. I've created a custom view to display a bitmap image without any trouble. The image is over-sized and extends the frame of the screen, which is what I want. But now I want to be able to scroll to particular predetermined regions of the image based upon a gesture. I am able to get the functionality using a gesture listener with mView.scrollTo(x, y); or even mView.scrollBy(x,y) within the gesture handlers. However, the position movement is very dramatic, and I need to slow it down so that is smoothly scrolls to the regions. The effect is similar to Dr Suess eBooks available in the android's a video demo that show the "panning" effect -- I'm not really creating an ebook but the effect is the same, being able to swipe and have the screen move around to predetermined spots on the image detailing notes at each point. I do not want to scroll to follow finger gestures on the screen, i just want to be trigger the move to a new location via a swipe. I've been able to get this working by animating the view in an xml file, but that simply animates the entire view object and moves it around the screen. I want the same effect INSIDE the view object. Is there a way to slow down the scrollTo(x,y) function? or am I totally going in the wrong direction with how to do this?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!