久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='RDZ2G'><style id='RDZ2G'><dir id='RDZ2G'><q id='RDZ2G'></q></dir></style></legend>

  1. <small id='RDZ2G'></small><noframes id='RDZ2G'>

        <bdo id='RDZ2G'></bdo><ul id='RDZ2G'></ul>
      <tfoot id='RDZ2G'></tfoot>

      <i id='RDZ2G'><tr id='RDZ2G'><dt id='RDZ2G'><q id='RDZ2G'><span id='RDZ2G'><b id='RDZ2G'><form id='RDZ2G'><ins id='RDZ2G'></ins><ul id='RDZ2G'></ul><sub id='RDZ2G'></sub></form><legend id='RDZ2G'></legend><bdo id='RDZ2G'><pre id='RDZ2G'><center id='RDZ2G'></center></pre></bdo></b><th id='RDZ2G'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RDZ2G'><tfoot id='RDZ2G'></tfoot><dl id='RDZ2G'><fieldset id='RDZ2G'></fieldset></dl></div>

      LongClick 事件發(fā)生得太快.如何增加觸發(fā)它所需的點

      LongClick event happens too quickly. How can I increase the clicktime required to trigger it?(LongClick 事件發(fā)生得太快.如何增加觸發(fā)它所需的點擊時間?)
      • <legend id='2Gwex'><style id='2Gwex'><dir id='2Gwex'><q id='2Gwex'></q></dir></style></legend>

          1. <i id='2Gwex'><tr id='2Gwex'><dt id='2Gwex'><q id='2Gwex'><span id='2Gwex'><b id='2Gwex'><form id='2Gwex'><ins id='2Gwex'></ins><ul id='2Gwex'></ul><sub id='2Gwex'></sub></form><legend id='2Gwex'></legend><bdo id='2Gwex'><pre id='2Gwex'><center id='2Gwex'></center></pre></bdo></b><th id='2Gwex'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2Gwex'><tfoot id='2Gwex'></tfoot><dl id='2Gwex'><fieldset id='2Gwex'></fieldset></dl></div>

          2. <small id='2Gwex'></small><noframes id='2Gwex'>

              <bdo id='2Gwex'></bdo><ul id='2Gwex'></ul>
                <tbody id='2Gwex'></tbody>
                <tfoot id='2Gwex'></tfoot>

              • 本文介紹了LongClick 事件發(fā)生得太快.如何增加觸發(fā)它所需的點擊時間?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                在我正在處理的應(yīng)用程序中,我要求用戶必須單擊 &在某個動作發(fā)生之前持有一個組件一段時間.

                In an application I'm working on, I have the requirement that a user must click & hold a component for a period time before a certain action occurs.

                我目前正在使用OnLongClickListener來監(jiān)聽longclick,但是我發(fā)現(xiàn)觸發(fā)OnLongClick事件的點擊時長太短了.

                I'm currently using an OnLongClickListener to listen for the longclick, but I find that the length of a click to trigger the OnLongClick event is too short.

                例如,假設(shè) LongClick 事件在單擊 400 毫秒后觸發(fā),但我希望用戶必須單擊 &在事件觸發(fā)前保持 1200ms.

                For example, let's say the LongClick event triggers after a 400ms click, but I want the user to have to click & hold for 1200ms before the event triggers.

                有什么方法可以將 LongClick 事件配置為需要更長的點擊時間?
                或者是否有其他構(gòu)造可以讓我聽到更長的點擊?

                Is there any way I can configure the LongClick event to require a longer click?
                Or is there perhaps another construct that would allow me to listen for longer clicks?

                推薦答案

                onLongClick事件不能改變定時器,由android自己管理.

                It is not possible to change the timer on the onLongClick event, it is managed by android itself.

                可以使用 .setOnTouchListener().

                What is possible is to use .setOnTouchListener().

                然后在 MotionEvent 為 ACTION_DOWN 時注冊.
                請注意變量中的當(dāng)前時間.
                然后當(dāng)一個帶有 ACTION_UP 的 MotionEvent 被注冊并且 current_time - actionDown 時間 > 1200 毫秒時,然后做一些事情.

                Then register when the MotionEvent is a ACTION_DOWN.
                Note the current time in a variable.
                Then when a MotionEvent with ACTION_UP is registered and the current_time - actionDown time > 1200 ms then do something.

                差不多:

                Button button = new Button();
                long then = 0;
                    button.setOnTouchListener(new OnTouchListener() {
                
                        @Override
                        public boolean onTouch(View v, MotionEvent event) {
                            if(event.getAction() == MotionEvent.ACTION_DOWN){
                                then = (Long) System.currentTimeMillis();
                            }
                            else if(event.getAction() == MotionEvent.ACTION_UP){
                                if(((Long) System.currentTimeMillis() - then) > 1200){
                                    return true;
                                }
                            }
                            return false;
                        }
                    })
                

                這篇關(guān)于LongClick 事件發(fā)生得太快.如何增加觸發(fā)它所需的點擊時間?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                Get current location during app launch(在應(yīng)用啟動期間獲取當(dāng)前位置)
                locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)
                <tfoot id='d6lVU'></tfoot>

                  <small id='d6lVU'></small><noframes id='d6lVU'>

                    • <bdo id='d6lVU'></bdo><ul id='d6lVU'></ul>
                        <tbody id='d6lVU'></tbody>
                      <legend id='d6lVU'><style id='d6lVU'><dir id='d6lVU'><q id='d6lVU'></q></dir></style></legend>
                      <i id='d6lVU'><tr id='d6lVU'><dt id='d6lVU'><q id='d6lVU'><span id='d6lVU'><b id='d6lVU'><form id='d6lVU'><ins id='d6lVU'></ins><ul id='d6lVU'></ul><sub id='d6lVU'></sub></form><legend id='d6lVU'></legend><bdo id='d6lVU'><pre id='d6lVU'><center id='d6lVU'></center></pre></bdo></b><th id='d6lVU'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='d6lVU'><tfoot id='d6lVU'></tfoot><dl id='d6lVU'><fieldset id='d6lVU'></fieldset></dl></div>

                        1. 主站蜘蛛池模板: 韩国欧洲一级毛片 | 久草热在线| 色性av | 日韩成人免费视频 | 亚洲国产精品一区二区三区 | 国产精品日本一区二区在线播放 | 国产98色在线 | 日韩 | 欧美一区二区免费 | 国产国产精品久久久久 | 日韩在线观看 | 亚洲性综合网 | 国产成人99久久亚洲综合精品 | 成人在线免费观看 | 亚洲国产高清免费 | 国产精品久久久久久久久图文区 | 五月婷婷激情 | 91精品中文字幕一区二区三区 | 免费亚洲婷婷 | 久久极品 | 狠狠艹 | 亚洲大片| 国产激情一区二区三区 | 国产日韩一区 | 网站国产| 91网站在线观看视频 | 五月激情六月婷婷 | 国产在线拍偷自揄拍视频 | 日韩av大片免费看 | 天天操天天操 | 国产精品成人品 | 伊人免费视频二 | 亚洲+变态+欧美+另类+精品 | 91精品久久久久久久久久 | 欧美亚洲激情 | 欧美激情精品久久久久久变态 | 69av网| av电影一区二区 | 手机av免费在线 | 国产999精品久久久久久 | 国产精品视频久久久 | 欧美福利视频一区 |