简体   繁体   English

更改图片的Android Gallery

[英]Android Gallery on image change

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. 嗨,我正在为一些我正在从事的项目编写一个图库库,到目前为止,除了使用fling之外,我还有幻灯片放映和用于浏览图库的按钮。 I'd like to hide the navigation buttons after say 3 seconds of not swiping. 我想在不滑动3秒后隐藏导航按钮。 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. 因此,想法是一旦滚动停止,启动可运行对象以将imageviews视图设置为在3秒钟后消失,然后一旦滚动开始再次将视图设置为再次可见。

How can i listen for fling in android Gallery class 我该如何在Android Gallery类中收听fling

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

Thanks 谢谢

There is an inherited method called onFling which is perfectly suitable for that. 有一个称为onFling的继承方法非常适合该方法。 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. 在为Android编码时,通常使用接口作为侦听器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM