人脸识别+采集分开处理
This commit is contained in:
@@ -69,4 +69,15 @@ fun View.clickWithCoroutines(
|
||||
lastClickTime = currentTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun View.clickWithDebounce(delay: Long = 500, action: () -> Unit) {
|
||||
var job: Job? = null
|
||||
setOnClickListener {
|
||||
job?.cancel()
|
||||
job = CoroutineScope(Dispatchers.Main).launch {
|
||||
delay(delay)
|
||||
action()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user