How to implement android's Gallery fling action in my own widget

by Meryl Silverburgh » Fri, 13 Mar 2009 01:27:23 GMT


Sponsored Links
 Hi,

Can you please tell me how implement android's Gallery fling action
(with the animation) in my own widget?

Thank you.

--~--~---------~--~----~------------~-------~--~----~



How to implement android's Gallery fling action in my own widget

by Streets Of Boston » Fri, 13 Mar 2009 03:27:20 GMT


 Take a look at the GestureDetector class.

- Create an instance of GestureDetector.
- Handle the onTouch event of your activity.
  In your onTouch event handler, forward the MotionEvent to this
GestureDetector instance.
- Assign a listener to this GestureDetector (one that implements
onFling, amongst others)
  Implement the onFling method in your listener to handle flings.

On Mar 12, 1:27pm, Meryl Silverburgh <silverburgh.me...@gmail.com>


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to implement android's Gallery fling action in my own widget

by gymshoe » Fri, 13 Mar 2009 11:17:37 GMT


 The fling animation is automatic with the Gallery class.  If you need
your own (new) widget class, just
make your own MyGallery class which extends Gallery.
Then just overwrite the onFling() method to do whatever you want to
do, and at the end of that method call super.onFling(args).

Jim




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Multiple Listviews in a single Activity

Hi

I've just started off with Android development and would like to add
multiple Listviews to a single activity. I've done all the layout in
XML and would now like to know how to programatically set these up. I
can't extend a ListActivity as I've got multiple lists. Any
suggestions?

Thanks!
--~--~---------~--~----~------------~-------~--~----~

2. Is it possible to run ADB shell command from inside an Android app

Also please note that shell commands are NOT part of the SDK.  If you rely
on them in your app, expect to break in the future.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~

3. Video and Audio format Supported by Android

4. Disable Auto Rotate?

5. How do I custom highlight selected ImageView like Grid demo

6. voice commands

7. using layout defined in xml with a custom class