Image zooming/panning inside of a Gallery

by Eric F » Wed, 02 Jun 2010 01:54:54 GMT

Sponsored Links
 I'm trying to combine the capability of doing image zoom/panning
inside of a Gallery view. The problem is controlling which touch
events are processed by each. In a horizontal drag on the image, the
ImageView needs to process the drag in order to pan, up until the edge
of the image is reached then the gallery view needs to process the
touch event so that it can swipe over to the next photo.

It seems that if I return false from the imageview's ontouchevent,
then I won't be notified of the panning-drag move events.

What I tried to do was return true from the imageview's ontouchevent
until the edge of the image was hit then return false. However I
believe that this doesn't cause the Gallery to begin processing these
events, as it missed the initial touchdown event.

My next thought is to somehow turn the containing activity into the
touch handler, and somehow stop the Gallery and ImageView from getting
touch events normally, and have the activity forward the touch event's
manually. Not sure if this is possible or if there is an example.

My last resort will be to simply not use the android.widget.Gallery,
which I want to avoid because I want the widget to "feel" the same as
other places on the phone, and I like code re-use. Unfortunately I
might have to do this, as I see all other apps that have this zoom/pan
capability don't seem to use the Gallery widget (Gallery3D etc).

My question is, what's the best way to design for this situation where
motionevents need to split between two views? Any ideas would be
greatly appreciated thank you.


Other Threads

1. I want to create an app for work orders - HELP

I am an engineer for a small IT consulting company. we have a work
order form that we email to a distribution group and the client.  how
would I go about doing this on our moto driod phone?  i downloaded the
sdk and have little programming but willing to learn.  I have done
access database and some vb work.  We use exchange 2007 so I could use
smtp, imap4 or activesync to send the info.  the fields are

Arrival Time - maybe able to be done as a stopwatch
Departure Time
Company - this could be a lookup somehow
   contact email
Work Done -
Follow up info
Technician - another lookup

Other thoughts are multiple open work orders for phone calls while

How would I go about doing this?


2. Using intent with startActivity from inner class


I am trying to use an intent from an inner class which should be
callable from different Activities/outer classes. I receive the
following compilation error: "The constructor Intent(InnerClass,
Class<OtherClass>) is undefined".

The code below illustrates what I am trying to achieve.
Any help would be greatly appreciated.


public class OuterClass1 extends Activity {
   public void onCreate(Bundle savedInstanceState) {
      new InnerClass(this);

public class OuterClass2 extends Activity {
   public void onCreate(Bundle savedInstanceState) {
      new InnerClass(this);

public class InnerClass {

   public InnerClass(Activity ac){
      Intent i = new Intent(ac, FooBar.class); // This line compiles

      // Next line doesn't compile - "The constructor Intent
(InnerClass, Class<OtherClass>) is undefined"


3. Google Maps Api -> No image displayed


5. Mouse cursor on Android emulator (Non x86 platforms)?

6. Dymanic View Populated From DB Schema

7. support of jdbc for sqlite