久久久久久久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 事件發生得太快.如何增加觸發它所需的點

      LongClick event happens too quickly. How can I increase the clicktime required to trigger it?(LongClick 事件發生得太快.如何增加觸發它所需的點擊時間?)
      • <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 事件發生得太快.如何增加觸發它所需的點擊時間?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

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

                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來監聽longclick,但是我發現觸發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.

                例如,假設 LongClick 事件在單擊 400 毫秒后觸發,但我希望用戶必須單擊 &在事件觸發前保持 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 事件配置為需要更長的點擊時間?
                或者是否有其他構造可以讓我聽到更長的點擊?

                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 時注冊.
                請注意變量中的當前時間.
                然后當一個帶有 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;
                        }
                    })
                

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

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

                相關文檔推薦

                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                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 或網絡提供商)
                Get current location during app launch(在應用啟動期間獲取當前位置)
                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. 主站蜘蛛池模板: 色婷婷一区二区三区四区 | 999热在线视频 | 久久综合99 | 欧美精品第一区 | 国产中文字幕在线 | 久久精品 | 欧美精品啪啪 | 亚洲日产精品 | 男女视频在线观看 | 97免费在线观看视频 | 久久99精品久久久久婷婷 | 久久精品免费观看 | 中文成人无字幕乱码精品 | 天天看天天爽 | 欧美日韩精品在线一区 | 在线欧美| 成人二区 | 国产亚洲一区二区精品 | 成人亚洲精品久久久久软件 | 欧美日韩国产一区二区三区 | 久久久久久久久国产 | 91大神在线看 | 欧美精品在线一区 | 久久久国产精品视频 | 资源首页二三区 | 韩国av网站在线观看 | 手机av免费在线 | 国产成人精品亚洲日本在线观看 | 九九在线视频 | www视频在线观看 | 精品国产一区二区三区性色av | 91亚洲免费 | 国产精品久久九九 | 亚洲在线中文字幕 | 精品三级| 无码日韩精品一区二区免费 | 亚洲一区二区久久 | 91视频在线观看免费 | 中文字幕 在线观看 | 九色91视频 | 九九热在线观看 |