黑莓:拨轮定格动画监听器
我正在实现一个具有 MapField
的应用程序,我正在扩展它。
我正在使用 navigationMovement(int dx, int dy, int status, int time)
在此地图上移动(除了 touchEvent(TouchEvent event)
,我没有问题和)。
问题是,当用户停止使用 trackwheel
移动时,我想执行某些操作,但我找不到像 TouchEvent.UP 这样的
listener
例如。
有谁知道我可以用什么来检测这个?
提前致谢!
I'm implementing an app that has a MapField
, which I am extending.
I'm using navigationMovement(int dx, int dy, int status, int time)
to move around this map (besides touchEvent(TouchEvent event)
which i dont have a problem with).
The problem is that I want to do something when the user stops moving using the trackwheel
, but I can't find a listener
for this like the TouchEvent.UP
for example.
Does anyone have an idea of what I can use to detect this?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我(还)不太熟悉黑莓编程,但我不记得在任何地方见过监听器。
我能想到的实现此目的的一种方法是创建一个 TimerTask,并在 TrackWheel 移动时(调用 navigationMovement 时)将时间戳存储在某个类变量中。然后在navigationMovement中,设置移动发生时的时间戳(从传递给方法的时间参数),并启动一个TimerTask,它会在一段时间后检查时间戳是否被标记为向后一定的时间(轮子有从那以后就没有移动过),如果是这样,你就知道拨轮已经停止了。
I'm not (yet) that familiar with BlackBerry-programming, but I don't remember seeing a listener for that anywhere.
One way I could think of to accomplish this could be to create a TimerTask, and store a timestamp in some class-variable when the TrackWheel moves (when your navigationMovement is called). Then in the navigationMovement, set the timestamp when the movement occurred (from the time-parameter passed to the method), and start a TimerTask which would then check after a while if the timestamp is marked a certain amount of time back (the wheel has not moved since), and if so, you know the trackwheel has stopped.