Question

Hi I'm writing a gallery library for a few projects i'm working on so far i have slide show and buttons for navigating the gallery besides using fling. I'd like to hide the navigation buttons after say 3 seconds of not swiping. So the idea is once scrolling stops, start a runnable to set the imageviews view to gone after the 3 seconds and then once scrolling starts again set the view to visible again.

How can i listen for fling in android Gallery class

Gallery g = (Gallery) findViewById(R.id.gallery);

Thanks

Was it helpful?

Solution

There is an inherited method called onFling which is perfectly suitable for that. Just let it call an interface's method and provide all the parameters you're needing.

Using an interface as listener is pretty common when coding for Android.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top