如何加快进/快退的过程,当按钮$ P $不断pssed [英] how to speed up the forward/rewind process when button pressed continuously

查看:347
本文介绍了如何加快进/快退的过程,当按钮$ P $不断pssed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想增加进/快退的速度,如果按钮持续pssed $ P $。

I want to increase the forward/rewind speed if the button is pressed continuously.

我创建了定制的媒体控制器从这里

I created my customized media controller from here.

什么是加快进/快退过程中的好方法吗?

What would be the good way to speed up the forward/rewind process?

我有一些想法形式<一个href=\"http://stackoverflow.com/questions/7938516/continuously-increase-integer-value-as-the-button-is-$p$pssed\">here.最后,我实现了它太多,但触摸事件在我的模拟器或与Android手机成功合作过,但没有工作了Android的机顶盒。其他的解决方案,而不是使用这将是AP preciated。

I got some idea form here. Finally I implemented it too but the touch event worked successfully in my emulator or and android mobile too but didn't worked for android stb. Other solutions rather than using it would be appreciated.

推荐答案

你怎么样监听MotionEvent.ACTION_DOWN和MotionEvent.ACTION_UP和看到按钮多久pressed。

How about you monitor the MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP and see how long the button is pressed.

button.setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if(event.getAction() == MotionEvent.ACTION_DOWN) {
            // the button is down monitor time to see how long it is down or anything you want
        } else if (event.getAction() == MotionEvent.ACTION_UP) {
            // the button is up reset your timer
        }
    }
};

这篇关于如何加快进/快退的过程,当按钮$ P $不断pssed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆