Skip to content

Commit

Permalink
fix: #469 修改本地时间导致点击防抖动错误
Browse files Browse the repository at this point in the history
  • Loading branch information
liangjingkanji committed Nov 30, 2024
1 parent 608f1de commit a6a9897
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package com.drake.brv.listener

import android.os.SystemClock
import android.view.View
import com.drake.brv.utils.BRV

Expand All @@ -43,7 +44,7 @@ private class OnDebounceClickListener(
set(value) = if (BRV.debounceGlobalEnabled) BRV.lastDebounceClickTime = value else _lastDebounceClickTime = value

override fun onClick(v: View) {
val currentTime = System.currentTimeMillis()
val currentTime = SystemClock.elapsedRealtime()
if (currentTime - lastDebounceClickTime > interval) {
lastDebounceClickTime = currentTime
block(v)
Expand Down

0 comments on commit a6a9897

Please sign in to comment.