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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top