Well, i'm aswering to myself.

I really like this modification to be used by someone, so If someone
likes it I can tell him how to do it. What I have done was to extend
Gallery and override onScroll() so when the selected view is the next
one to the jog, it won't scroll anymore.

Also, I need to modify onFling() and see what to do there... (possible
things is to avoid flinging, or limiting the fling somehow, as it's a
runnable within the Gallery widget that is started on the appropiate
event).

But for now, that works when scrolling. The other modification is to
override onWindowFocusChanged() to emulate a 'touch' event so the
Gallery centers our first image.

After that, the Gallery will center our first image. It will be like a
click to the 2nd image from the Adapter, so you need to calculate
X_COORDS and Y_COORDS according your needs.

Then, you need to prevent clicking on the jog overriding
onSingleTapUp() and making some calculations.

An important thing to mention is that I have identified every View
with setId(position) in the Adapter getView() method.

These are the drawable xml files for the jogs, left and right (I
modified an file from android platform):

http://paste2.org/p/911856
http://paste2.org/p/911852


Well, thats makes the Gallery looks like I want it. The bad thing is
that I should see what to do with the fling, as it's a Runnable that
runs on the Gallery object (yes, pretty ugly design).

I have to say that this widget is not flexible at all. Hope that
serves to anyone there. Bad luck that the topic it's not descriptive
though, here's the code:

http://pastebin.com/cEVd03t8

This is how it works (at the end I left the fling effect to see how it
should be changed, or prevent to fling):

http://labombiya.com.ar/media/vid.mpeg


If anyone can provide a probable solution to the fling effect, I would
be grateful.

Best regards,
-- 
If you want freedom, compile the source.

Sebastián Treu
http://labombiya.com.ar

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to