views:

257

answers:

0

I have a custom view that represents something like a photo-collage.

I need to support the following:

  1. Fling
  2. Zoom In
  3. Zoom Out

Here's what I currently do:

onDraw:

  1. Look out for the number of images to be drawn.
  2. Look out for the images to be drawn and their locations and angles
  3. If the image had been downloaded (from the server), draw it. Otherwise, draw some default image.

onTouch:

  1. action = DOWN: Record X,Y
  2. action = MOVE: Record X,Y; get the delta; record "new origins" and invalidate the UI.

This will result in redrawing the UI with latest images and coordinates.

However, this has serious performance problems when the images are still not downloaded the user stars flinging.

Is it possible to take a "snapshot" of the "view" and "pan" the "recorded image" during fling? And when the fling is complete, just update the UI with latest images?