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

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 <>


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).



Other Threads


RR sekalian yg masih pegang htc magic / dream , cyanogens datang lagi dengan
versi 14 tapi masih donut sih.

"Indonesian Android Community [id-android]" 

2. 'drawable' vs. 'drawable-hdpi' in Online Tutorial

It seems the online tutorials have not been rewritten to reflect
Android 2.1. For they still refer to 'drawable' and 'res/drawable',
but when I create a new project for 2.1 using the wizard, I do not GET
any such directory. Instead, I get 'res/drawable-hdpi', 'res/drawable-
ldpi' and 'res/drawable-mdpi'.

Now for some tutorials, I have been able to get by by putting files in
'res/drawable-hdpi'. But for the TabLayout tutorial,,
this does not work. I still get the error message (on completion of
step 3) "R.drawable.ic_tab_artists cannot be resolved".

The files "ic_tab_artists_grey.png" and "ic_tab_artists_whit.png"
really are in res/drawable-hdpi.

I also tried changing the name 'drawable' to 'drawable-hdpi', but Java
did not like the '-' in the name (no surprise).

So how are we supposed to get this to work? Go back to 1.5? Surely
there is a better way.

Just for clarity's sake, the line of code I get the error on is: spec
= tabHost.newTabSpec("artists").setIndicator("Artists",
//                          res.getDrawable


I get the same class of error message on the other three
res.getDrawable calls, too.


3. Where to correctly place xml containing data?

4. RemoteViews, ImageView, setAlpha?

5. Is it possible to un-parcel a parcel without knowing what is in it?

6. TextView & StaticLayout

7. Remote Log